From 37ce03cc553cb40e7030f96df348945a95cdcc7d Mon Sep 17 00:00:00 2001 From: Edmond Lang Date: Tue, 17 Jun 2025 20:27:39 +0800 Subject: [PATCH] fix fully refund bug - the price is not equal --- .../Bookings/ControllersLogic/CreateBookingRefundLogic.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php index 6148291c..2e8a34b2 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php @@ -120,7 +120,9 @@ class CreateBookingRefundLogic extends AbstractControllerLogic $bookingAmountAfterRefunded = $booking->fix_amount - $refundInPending - $request->input('amount'); - $isFullyRefund = ($refund + $request->input('amount')) == $transaction->original_amount; + $refundAmount = round($refund + $request->input('amount'), 2); + $originalAmount = round((float) $transaction->original_amount, 2); + $isFullyRefund = $refundAmount == $originalAmount; $voucherCode = null; $redemptionId = null;