mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 07:44:38 -04:00
Checks for partial/deposit greater than amount/balance
This commit is contained in:
parent
4cd83ba27a
commit
218aa6de73
@ -291,6 +291,10 @@ class BaseRepository
|
||||
/* Apply entity number */
|
||||
$model = $model->service()->applyNumber()->save();
|
||||
|
||||
/* Handle attempts where the deposit is greater than the amount/balance of the invoice */
|
||||
if((int)$model->balance != 0 && $model->partial > $model->amount)
|
||||
$model->partial = min($model->amount, $model->balance);
|
||||
|
||||
/* Update product details if necessary */
|
||||
if ($model->company->update_products)
|
||||
UpdateOrCreateProduct::dispatch($model->line_items, $model, $model->company);
|
||||
|
Loading…
x
Reference in New Issue
Block a user