mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Prevent partial from being negative
This commit is contained in:
parent
6088a36175
commit
c5d0786ed6
@ -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…
x
Reference in New Issue
Block a user