mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 19:34:33 -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 */
|
/* Apply entity number */
|
||||||
$model = $model->service()->applyNumber()->save();
|
$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 */
|
/* Update product details if necessary */
|
||||||
if ($model->company->update_products)
|
if ($model->company->update_products)
|
||||||
UpdateOrCreateProduct::dispatch($model->line_items, $model, $model->company);
|
UpdateOrCreateProduct::dispatch($model->line_items, $model, $model->company);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user