Fixed:Order status issue during reallocation when the admin upgrades the room category.

This commit is contained in:
Amit sharma
2026-01-05 11:49:34 +05:30
parent 1474ec2c61
commit 6690f4a798

View File

@@ -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
// ===============================================================