diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 9e5e1c55c8b0..96b5229d25c5 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -1349,7 +1349,9 @@ class Invoice extends EntityModel implements BalanceAffecting if ($this->discount != 0) { if ($this->is_amount_discount) { - $total -= $invoiceTotal ? ($total / ($invoiceTotal + $this->discount) * $this->discount) : 0; + if ($invoiceTotal + $this->discount != 0) { + $total -= $invoiceTotal ? ($total / ($invoiceTotal + $this->discount) * $this->discount) : 0; + } } else { $total *= (100 - $this->discount) / 100; }