From 6690f4a79838ceef52e7758f4bfabe7c4e13cb2b Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Mon, 5 Jan 2026 11:49:34 +0530 Subject: [PATCH] Fixed:Order status issue during reallocation when the admin upgrades the room category. --- .../classes/HotelBookingDetail.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index fbf4ba1c6..8bdbbfdeb 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -2317,6 +2317,23 @@ class HotelBookingDetail extends ObjectModel OrderReturnDetail::deleteReturnDetailByIdBookingDetail($objOldHotelBooking->id_order, $idHotelBooking); } + $totalPaid = (float)$objOrder->getTotalPaid(); + $orderTotal = (float)$objOrder->getOrderTotal(); + $currentState = $objOrder->getCurrentOrderState(); + if (Validate::isLoadedObject($currentState)) { + $idEmployee = (int) $context->employee->id; + if ($totalPaid < $orderTotal && $currentState->id == Configuration::get('PS_OS_PAYMENT_ACCEPTED')) { + $objOrder->setCurrentState( + Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED'), + $idEmployee + ); + } elseif ($totalPaid >= $orderTotal && $currentState->id == Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED')) { + $objOrder->setCurrentState( + Configuration::get('PS_OS_PAYMENT_ACCEPTED'), + $idEmployee + ); + } + } // =============================================================== // END Delete Process of the old booking // ===============================================================