From d1cf06d7005dc653c0e6aaec6e6a49e60c16f55a Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 16:09:05 +0800 Subject: [PATCH] hide payment button for floating amount --- app/Http/Resources/TransactionResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 668b0947..631f2d8b 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -29,7 +29,7 @@ class TransactionResource extends JsonResource 'amount' => (double) $this->amount, 'payment_method' => (int) $this->payment_method, 'payment_reference' => $this->payment_reference, - 'outstanding' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')), + 'outstanding' => (double) ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')), 'floating' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION])->sum('amount')), 'service_charge' => (double) $this->service_charge, 'tax' => (double) $this->tax,