1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Adjust client balance when deleting payment

This commit is contained in:
David Bomba 2020-07-05 20:24:13 +10:00
parent 83e62dcd90
commit 920bbf8b75

View File

@ -71,7 +71,8 @@ class DeletePayment
$paymentable_invoice->service()->updateBalance($paymentable_invoice->pivot->amount)->save();
$paymentable_invoice->ledger()->updateInvoiceBalance($paymentable_invoice->pivot->amount)->save();
$paymentable_invoice->client->service()->updateBalance($paymentable_invoice->pivot->amount)->save();
if(floatval($paymentable_invoice->balance) == 0)
$paymentable_invoice->service()->setStatus(Invoice::STATUS_SENT)->save();
else