From 7405887fe8afcd6554e417c30a37ecf4cbe790f9 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Tue, 11 Aug 2026 12:59:31 +0800 Subject: [PATCH] Fix a problem with partial refund reported by Eileen --- .../Bookings/ControllersLogic/CreateBookingRefundLogic.php | 3 ++- .../bookings/elements/RequestCreditNoteComponent.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php index 95efc7c5..bdd482dc 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php @@ -24,6 +24,7 @@ use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber; use App\Classes\Modules\Transactions\DataTransferObjects\TransactionRefundCalculationObject; use App\Classes\ValueObjects\Constants\PaymentMethodType; use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor; +use Illuminate\Support\Facades\Log; class CreateBookingRefundLogic extends AbstractControllerLogic { @@ -111,7 +112,7 @@ class CreateBookingRefundLogic extends AbstractControllerLogic $refundInPending = $transaction->transactions()->refunds()->where('status', ApprovalStatus::PENDING_VERIFICATION)->sum('original_amount'); - if($refund + $request->input('amount') > $transaction->original_amount) throw new MalformedRequestException('Your refund must not be greater than '. $transaction->original_amount .'.'); + if(($refund + $request->input('amount') > $transaction->original_amount) && !$isFullyRefund) throw new MalformedRequestException('Your refund must not be greater than '. $transaction->original_amount .'.'); // $transactionRefundCalculationObject = new TransactionRefundCalculationObject($booking, $transaction, $request->input('amount')); // $transactionRefundCalculationObject->init(); diff --git a/resources/assets/vue/components/bookings/elements/RequestCreditNoteComponent.vue b/resources/assets/vue/components/bookings/elements/RequestCreditNoteComponent.vue index 0181b6df..cf2f0cee 100644 --- a/resources/assets/vue/components/bookings/elements/RequestCreditNoteComponent.vue +++ b/resources/assets/vue/components/bookings/elements/RequestCreditNoteComponent.vue @@ -118,7 +118,7 @@ const refundMethods = [ const moneyV2 = { decimal: '.', - thousands: ',', + thousands: '', precision: 2 };