mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Prevent divide by zero with discounts
This commit is contained in:
parent
9846b3f42b
commit
ee0e6a16bb
@ -510,7 +510,9 @@ class InvoiceRepository extends BaseRepository
|
||||
|
||||
if ($invoice->discount > 0) {
|
||||
if ($invoice->is_amount_discount) {
|
||||
if ($total != 0) {
|
||||
$lineTotal -= round(($lineTotal / $total) * $invoice->discount, 2);
|
||||
}
|
||||
} else {
|
||||
$lineTotal -= round($lineTotal * ($invoice->discount / 100), 2);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user