commit
a8e32f69a1
1 changed files with 3 additions and 4 deletions
|
|
@ -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}");
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue