From a31698217124dac585e185a8fa4c24f5b95fc747 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 7 Aug 2021 15:25:22 +1000 Subject: [PATCH] Fixes for client balance when deleting an invoice --- app/Services/Invoice/MarkInvoiceDeleted.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/Invoice/MarkInvoiceDeleted.php b/app/Services/Invoice/MarkInvoiceDeleted.php index 1fcf97268075..95590695d82f 100644 --- a/app/Services/Invoice/MarkInvoiceDeleted.php +++ b/app/Services/Invoice/MarkInvoiceDeleted.php @@ -50,7 +50,8 @@ class MarkInvoiceDeleted extends AbstractService private function adjustLedger() { - $this->invoice->ledger()->updatePaymentBalance($this->adjustment_amount * -1, 'Invoice Deleted - reducing ledger balance'); //reduces the payment balance by payment totals + // $this->invoice->ledger()->updatePaymentBalance($this->adjustment_amount * -1, 'Invoice Deleted - reducing ledger balance'); //reduces the payment balance by payment totals + $this->invoice->ledger()->updatePaymentBalance($this->invoice->balance * -1, 'Invoice Deleted - reducing ledger balance'); //reduces the payment balance by payment totals return $this; }