-fix issue where cannot approve PO when we have refunded transaction

This commit is contained in:
JiaSheng
2024-03-19 00:23:09 +08:00
parent daa422d41a
commit 04b8dfb0dd
@@ -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');
}