From 04b8dfb0ddb52c6877eb07ec29506145256b0461 Mon Sep 17 00:00:00 2001 From: JiaSheng Date: Tue, 19 Mar 2024 00:23:09 +0800 Subject: [PATCH] -fix issue where cannot approve PO when we have refunded transaction --- .../Bookings/Services/CalculatesBookingTransferredAmount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Bookings/Services/CalculatesBookingTransferredAmount.php b/app/Classes/Modules/Bookings/Services/CalculatesBookingTransferredAmount.php index fc355d64..099d4571 100644 --- a/app/Classes/Modules/Bookings/Services/CalculatesBookingTransferredAmount.php +++ b/app/Classes/Modules/Bookings/Services/CalculatesBookingTransferredAmount.php @@ -13,7 +13,7 @@ class CalculatesBookingTransferredAmount public function execute(Booking $booking){ return $booking->transactions()->payments()->complete()->whereHas('transactions', function($query){ - return $query->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]); + return $query->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->where('type', TransactionType::BILL); })->sum('original_amount'); }