Fixes for tests

This commit is contained in:
David Bomba 2025-08-21 12:28:47 +10:00
parent 501b8085f0
commit 002f6914ad
1 changed files with 1 additions and 1 deletions

View File

@ -92,7 +92,7 @@ class DeletePayment
$invoice_ids = $this->payment->invoices()->pluck('invoices.id')->toArray(); $invoice_ids = $this->payment->invoices()->pluck('invoices.id')->toArray();
$this->total_payment_amount = $this->payment->amount + ($this->payment->paymentables->where('paymentable_type', 'App\Models\Credit')->sum('amount') - $this->payment->paymentables->where('paymentable_type', 'App\Models\Credit')->sum('refunded')); $this->total_payment_amount = ($this->payment->amount-$this->payment->refunded) + ($this->payment->paymentables->where('paymentable_type', 'App\Models\Credit')->sum('amount') - $this->payment->paymentables->where('paymentable_type', 'App\Models\Credit')->sum('refunded'));
$this->payment->invoices()->each(function ($paymentable_invoice) { $this->payment->invoices()->each(function ($paymentable_invoice) {
$net_deletable = $paymentable_invoice->pivot->amount - $paymentable_invoice->pivot->refunded; $net_deletable = $paymentable_invoice->pivot->amount - $paymentable_invoice->pivot->refunded;