mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Update client paid to date for full amount with overpayments
This commit is contained in:
parent
a7532c1e01
commit
89024a173b
@ -55,6 +55,11 @@ class UpdateInvoicePayment
|
||||
$paid_amount = $paid_invoice->amount;
|
||||
}
|
||||
|
||||
$client
|
||||
->service()
|
||||
->updatePaidToDate($paid_amount)
|
||||
->save();
|
||||
|
||||
/* Need to determine here is we have an OVER payment - if YES only apply the max invoice amount */
|
||||
if($paid_amount > $invoice->partial && $paid_amount > $invoice->balance)
|
||||
$paid_amount = $invoice->balance;
|
||||
@ -77,7 +82,6 @@ class UpdateInvoicePayment
|
||||
$client
|
||||
->service()
|
||||
->updateBalance($paid_amount * -1)
|
||||
->updatePaidToDate($paid_amount)
|
||||
->save();
|
||||
|
||||
$pivot_invoice = $this->payment->invoices->first(function ($inv) use ($paid_invoice) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user