← All changes
|
app/Scripts/DepartureCapacitySyncFromAvailabilityScript.php
+2
-2
3.0.9
→
3.0.16
View file →
| @@ -43,9 +43,9 @@ | ||
| 43 | 43 | foreach ($allDepartures as $departure) { |
| 44 | 44 | $date = $departure->start_date ?: $departure->date; |
| 45 | 45 | |
| 46 | 46 | // Get correct capacity from availability |
| 47 | - $correctCapacity = $this->capacityService->getCapacityForDate($departure->trip_id, $date); | |
| 47 | + $correctCapacity = $this->capacityService->getCapacityForDate($departure->trip_id, $date, $departure->time ?? null); | |
| 48 | 48 | |
| 49 | 49 | if ($correctCapacity > 0) { |
| 50 | 50 | // Update if capacity is different |
| 51 | 51 | if ($departure->max_capacity !== $correctCapacity) { |
| @@ -86,9 +86,9 @@ | ||
| 86 | 86 | $summary['total_departures'] = count($allDepartures); |
| 87 | 87 | |
| 88 | 88 | foreach ($allDepartures as $departure) { |
| 89 | 89 | $date = $departure->start_date ?: $departure->date; |
| 90 | - $correctCapacity = $this->capacityService->getCapacityForDate($departure->trip_id, $date); | |
| 90 | + $correctCapacity = $this->capacityService->getCapacityForDate($departure->trip_id, $date, $departure->time ?? null); | |
| 91 | 91 | |
| 92 | 92 | if ($correctCapacity > 0) { |
| 93 | 93 | if ($departure->max_capacity !== $correctCapacity) { |
| 94 | 94 | $summary['need_update']++; |