diff --git a/modules/hotelreservationsystem/classes/WebserviceSpecificManagementHotelAri.php b/modules/hotelreservationsystem/classes/WebserviceSpecificManagementHotelAri.php index c79aefa2b..65f064afc 100644 --- a/modules/hotelreservationsystem/classes/WebserviceSpecificManagementHotelAri.php +++ b/modules/hotelreservationsystem/classes/WebserviceSpecificManagementHotelAri.php @@ -270,8 +270,15 @@ class WebserviceSpecificManagementHotelAri extends ObjectModel implements Webser if (count($roomType['data']['unavailable'])) { foreach ($roomType['data']['unavailable'] as $unavailableRooms) { foreach ($unavailableRooms['detail'] as $unavailableDetail) { - for ($currentDate = date('Y-m-d', strtotime($unavailableDetail['date_from'])); - $currentDate < date('Y-m-d', strtotime($unavailableDetail['date_to'])); + if ($unavailableDetail['date_from'] && $unavailableDetail['date_to']) { + $startDate = date('Y-m-d', strtotime($unavailableDetail['date_from'])); + $endDate = date('Y-m-d', strtotime($unavailableDetail['date_to'])); + } else { + $startDate = $bookingParams['date_from']; + $endDate = $bookingParams['date_to']; + } + for ($currentDate = $startDate; + $currentDate < $endDate; $currentDate = date('Y-m-d', strtotime('+1 day', strtotime($currentDate))) ) { $unavailableDates[$currentDate][$roomType['id_product']][$unavailableRooms['id_room']] = $unavailableRooms['id_room'];