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,