Fix discounts on tax rate report

This commit is contained in:
Hillel Coren 2017-03-02 11:08:53 +02:00
parent edb7e4fdc4
commit 7933aa98bf

View File

@ -1268,7 +1268,7 @@ class Invoice extends EntityModel implements BalanceAffecting
if ($this->discount > 0) { if ($this->discount > 0) {
if ($this->is_amount_discount) { if ($this->is_amount_discount) {
$total -= $invoiceTotal ? ($total / $invoiceTotal * $this->discount) : 0; $total -= $invoiceTotal ? ($total / ($invoiceTotal + $this->discount) * $this->discount) : 0;
} else { } else {
$total *= (100 - $this->discount) / 100; $total *= (100 - $this->discount) / 100;
$total = round($total, 2); $total = round($total, 2);