Updated the conditions checked while updating the booking status of a room

This commit is contained in:
vishalsingh.qlo325
2025-02-25 16:10:25 +05:30
parent 82ec516719
commit 6cb1426526
2 changed files with 13 additions and 3 deletions

View File

@@ -7173,8 +7173,15 @@ class AdminOrdersControllerCore extends AdminController
|| (strtotime($statusDate) > strtotime($dateTo))
) {
$this->errors[] = Tools::displayError('Date should be between booking from date and to date.');
} else if (date('Y-m-d', strtotime($objHotelBookingDetail->check_out)) != date('Y-m-d', strtotime($objHotelBookingDetail->date_to))
&& ($booked = $objHotelBookingDetail->chechRoomBooked($objHotelBookingDetail->id_room, $objHotelBookingDetail->check_out, $objHotelBookingDetail->date_to))
}
}
if ($objHotelBookingDetail->id_status == HotelBookingDetail::STATUS_CHECKED_OUT
&& (date('Y-m-d', strtotime($objHotelBookingDetail->check_out)) != date('Y-m-d', strtotime($objHotelBookingDetail->date_to)))
&& ($booking = $objHotelBookingDetail->chechRoomBooked($objHotelBookingDetail->id_room, $objHotelBookingDetail->check_out, $objHotelBookingDetail->date_to))
) {
if ($booking['id_status'] != HotelBookingDetail::STATUS_CHECKED_OUT
|| date('Y-m-d', strtotime($booking['check_out'])) > date('Y-m-d', strtotime($objHotelBookingDetail->date_from))
) {
$this->errors[] = Tools::displayError('You cannot update this room\'s booking status as a new booking has been created for this room. Please change the room to update the status.');
}