Prevent partial from being negative
This commit is contained in:
parent
6088a36175
commit
c5d0786ed6
1 changed files with 1 additions and 1 deletions
|
|
@ -475,7 +475,7 @@ class InvoiceRepository extends BaseRepository
|
|||
}
|
||||
|
||||
if (isset($data['partial'])) {
|
||||
$invoice->partial = min(round(Utils::parseFloat($data['partial']), 2), $invoice->balance);
|
||||
$invoice->partial = max(0,min(round(Utils::parseFloat($data['partial']), 2), $invoice->balance));
|
||||
}
|
||||
|
||||
$invoice->amount = $total;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue