From d8fc622fe1e88b99e2b97c9709f50b463916dbfa Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 4 Jun 2024 16:35:25 +0530 Subject: [PATCH] Fixed incorrect cancellation charges in partial payment --- .../classes/HotelOrderRefundRules.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php b/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php index 32a6ad0e0..8cfb22850 100644 --- a/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php +++ b/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php @@ -157,7 +157,6 @@ class HotelOrderRefundRules extends ObjectModel 1, 1 ); - $paidAmount = $objHtlBooking->total_paid_amount + $totalDemandsPrice + $totalServicesPrice; if ($refundRules = $objHtlRefundRules->getHotelRefundRules($objHtlBooking->id_hotel, 0, 1)) { $orderCurrency = $objOrder->id_currency; @@ -185,7 +184,7 @@ class HotelOrderRefundRules extends ObjectModel if ($refRule['payment_type'] == HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE) { $bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE; - $bookingCancellationDetail['cancelation_charge'] = $paidAmount * ($refundValue / 100); + $bookingCancellationDetail['cancelation_charge'] = ($objHtlBooking->total_price_tax_incl + $totalDemandsPrice + $totalServicesPrice) * ($refundValue / 100); } else { $bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_FIXED; if ($defaultCurrency != $orderCurrency) { @@ -197,11 +196,6 @@ class HotelOrderRefundRules extends ObjectModel } else { $bookingCancellationDetail['cancelation_charge'] = $refundValue; } - - // if deduction amount is more than the order total cost - if ($bookingCancellationDetail['cancelation_charge'] > $paidAmount) { - $bookingCancellationDetail['cancelation_charge'] = $paidAmount; - } } $ruleApplied = true;