diff --git a/app/Repositories/BaseRepository.php b/app/Repositories/BaseRepository.php index 127387abbfff..4d9451dcf83a 100644 --- a/app/Repositories/BaseRepository.php +++ b/app/Repositories/BaseRepository.php @@ -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 */