billing fix up

This commit is contained in:
omair saleh
2022-09-20 07:28:40 +08:00
parent d8b41cbe55
commit 10a95f0b4d
9 changed files with 62 additions and 12 deletions
@@ -26,6 +26,8 @@ class TransactionResource extends JsonResource
'type' => (int) $this->type,
'bill_no' => $this->bill_no,
'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')),
'service_charge' => (double) $this->service_charge,
'tax' => (double) $this->tax,