From 9ffc842a495dd4b41b4c12dfbf2b04ca82c19916 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Sat, 1 Feb 2025 10:39:54 +0530 Subject: [PATCH] Fixed: The order status cannot be changed to Partial payment received until at least one partial payment has been made for this order. --- classes/order/Order.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/order/Order.php b/classes/order/Order.php index 99fab549f..d479ac256 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -2737,7 +2737,10 @@ class OrderCore extends ObjectModel $objHotelBooking = new HotelBookingDetail(); $objCurrentOrderState = $this->getCurrentOrderState(); - if ($objCurrentOrderState->id == Configuration::get('PS_OS_REFUND')) { + // if new status is partial payment then do not allow if no entry is done for the payment in that order + if (($objNewOrderState->id == Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED')) && $this->total_paid_real <= 0) { + $result['errors'][] = Tools::displayError('The order status cannot be changed to Partial payment received until at least one partial payment has been made for this order.'); + } elseif ($objCurrentOrderState->id == Configuration::get('PS_OS_REFUND')) { $result['errors'][] = Tools::displayError('Order status can not be changed once order status is set to Refunded.'); } elseif ($objCurrentOrderState->id == Configuration::get('PS_OS_CANCELED')) { $result['errors'][] = Tools::displayError('Order status can not be changed once order status is set to Cancelled.');