Disable auto billing when an invoice has been refunded.

This commit is contained in:
David Bomba 2022-10-26 10:54:23 +11:00
parent dba0b50c50
commit 91cfc33f61

View File

@ -277,6 +277,9 @@ class RefundPayment
$invoice->service()->setStatus(Invoice::STATUS_PARTIAL); $invoice->service()->setStatus(Invoice::STATUS_PARTIAL);
} }
//26-10-2022 - disable autobill to prevent future billings;
$invoice->auto_bill_enabled = false;
$invoice->saveQuietly(); $invoice->saveQuietly();
//06-09-2022 //06-09-2022
@ -285,10 +288,6 @@ class RefundPayment
->updateBalance($refunded_invoice['amount']) ->updateBalance($refunded_invoice['amount'])
->save(); ->save();
// $client = $invoice->client;
// $client->balance += $refunded_invoice['amount'];
// $client->save();
$transaction = [ $transaction = [
'invoice' => $invoice->transaction_event(), 'invoice' => $invoice->transaction_event(),
'payment' => [], 'payment' => [],