Fixes for regression

This commit is contained in:
David Bomba 2022-04-05 05:23:39 +10:00
parent c3330b6777
commit fa2019661d

View File

@ -73,6 +73,10 @@ class UpdateInvoicePayment
/*Improve performance here - 26-01-2022 - also change the order of events for invoice first*/
//caution what if we amount paid was less than partial - we wipe it!
$invoice->balance -= $paid_amount;
$invoice->paid_to_date += $paid_amount;
$invoice->save();
$invoice = $invoice->service()
->clearPartial()
// ->updateBalance($paid_amount * -1)
@ -80,10 +84,6 @@ class UpdateInvoicePayment
->updateStatus()
->touchPdf()
->save();
$invoice->balance -= $paid_amount;
$invoice->paid_to_date += $paid_amount;
$invoice->save();
$invoice->service()
->workFlow()