Fixes for invoice paid to date calculations on refund

This commit is contained in:
David Bomba 2021-10-04 20:43:00 +11:00
parent 151cc07560
commit 5a31634f81

View File

@ -242,6 +242,7 @@ class RefundPayment
$invoice->service()->updateBalance($refunded_invoice['amount'])->save();
$invoice->ledger()->updateInvoiceBalance($refunded_invoice['amount'], "Refund of payment # {$this->payment->number}")->save();
$invoice->paid_to_date -= $refunded_invoice['amount'];
if ($invoice->amount == $invoice->balance) {
$invoice->service()->setStatus(Invoice::STATUS_SENT);