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

Merge pull request #7628 from turbo124/v5-develop

Minor fixes
This commit is contained in:
David Bomba 2022-07-10 15:53:36 +10:00 committed by GitHub
commit a8e32f69a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -302,12 +302,11 @@ class BaseRepository
/* Perform model specific tasks */
if ($model instanceof Invoice) {
if (($state['finished_amount'] != $state['starting_amount']) && ($model->status_id != Invoice::STATUS_DRAFT)) {
if (($state['finished_amount'] != $state['starting_amount']) && ($model->status_id != Invoice::STATUS_DRAFT && $model->status_id != Invoice::STATUS_PAID)) {
if($model->status_id != Invoice::STATUS_PAID)
$model->client->service()->updateBalance(($state['finished_amount'] - $state['starting_amount']))->save();
//10-07-2022
$model->service()->updateStatus()->save();
$model->client->service()->updateBalance(($state['finished_amount'] - $state['starting_amount']))->save();
$model->ledger()->updateInvoiceBalance(($state['finished_amount'] - $state['starting_amount']), "Update adjustment for invoice {$model->number}");