Merge pull request #4240 from turbo124/v5-develop

Link entities
This commit is contained in:
David Bomba 2020-11-01 19:53:40 +11:00 committed by GitHub
commit e3696a49ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,12 +314,14 @@ class BaseRepository
if (($state['finished_amount'] != $state['starting_amount']) && ($model->status_id != Invoice::STATUS_DRAFT)) {
$model->ledger()->updateInvoiceBalance(($state['finished_amount'] - $state['starting_amount']));
$model->client->service()->updateBalance(($state['finished_amount'] - $state['starting_amount']))->save();
$model->service()->linkEntities()->save();
}
if (! $model->design_id) {
$model->design_id = $this->decodePrimaryKey($client->getSetting('invoice_design_id'));
}
$model->service()->linkEntities()->save();
}
if ($class->name == Credit::class) {