From 7f16b9ead1d793f7862e21d18f39edb66b8ea63b Mon Sep 17 00:00:00 2001 From: Jia Sheng Date: Mon, 8 Jul 2024 12:30:34 +0800 Subject: [PATCH] update refund logic where E2E do not refund service charge --- .../ControllersLogic/CreateBookingRefundLogic.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php index 058e4bc7..8c492eb1 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php @@ -132,8 +132,14 @@ class CreateBookingRefundLogic extends AbstractControllerLogic $service_charges_to_refund = $isFullyRefund ? $quotationBeforeCurrentRefund->getServiceCharge() : $quotationBeforeCurrentRefund->getServiceCharge() - $quotationAfterRefund->getServiceCharge(); - // refund service charges if is fully refund - $refundTotal = $refundAmount + $service_charges_to_refund + $transaction->tax; + // refund service charges if booking is not E2E + $refundTotal = $refundAmount; + + if ($booking->service_id !== 5) { + $refundTotal = $refundTotal + $service_charges_to_refund + $transaction->tax; + } else { + $service_charges_to_refund = 0; + } $object = new TransactionObject($billNumber, TransactionType::REFUND, 1, $booking->company->id, 1, PaymentMethodType::CASH,