From 91cfc33f6138c16e7a4328ec6dd1e9d191570e00 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 26 Oct 2022 10:54:23 +1100 Subject: [PATCH] Disable auto billing when an invoice has been refunded. --- app/Services/Payment/RefundPayment.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index 2b4b36df758f..17391f96bc81 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -277,6 +277,9 @@ class RefundPayment $invoice->service()->setStatus(Invoice::STATUS_PARTIAL); } + //26-10-2022 - disable autobill to prevent future billings; + $invoice->auto_bill_enabled = false; + $invoice->saveQuietly(); //06-09-2022 @@ -285,10 +288,6 @@ class RefundPayment ->updateBalance($refunded_invoice['amount']) ->save(); - // $client = $invoice->client; - // $client->balance += $refunded_invoice['amount']; - // $client->save(); - $transaction = [ 'invoice' => $invoice->transaction_event(), 'payment' => [],