| @@ -239,9 +239,9 @@ | ||
| 239 | 239 | $date = $departure->start_date ?: $departure->date; |
| 240 | 240 | |
| 241 | 241 | // Get capacity from availability |
| 242 | 242 | $capacityService = new CapacityService(); |
| 243 | - $correctCapacity = $capacityService->getCapacityForDate($departure->trip_id, $date); | |
| 243 | + $correctCapacity = $capacityService->getCapacityForDate($departure->trip_id, $date, $departure->time ?? null); | |
| 244 | 244 | |
| 245 | 245 | if ($correctCapacity > 0 && $departure->max_capacity !== $correctCapacity) { |
| 246 | 246 | // Remove hook temporarily to prevent infinite loop |
| 247 | 247 | remove_action('yatra_departure_saved', [self::class, 'onDepartureSave'], 10); |