Minor fixes for negative invoices

This commit is contained in:
David Bomba 2022-11-13 10:44:01 +11:00
parent d2491476e4
commit f54f4b9200

View File

@ -280,7 +280,7 @@ class BaseRepository
$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)
if((int)$model->balance != 0 && $model->partial > $model->amount && $model->amount > 0)
$model->partial = min($model->amount, $model->balance);
/* Update product details if necessary - if we are inside a transaction - do nothing */