Merge: Fix discount rounding #1305

This commit is contained in:
Hillel Coren 2017-01-25 13:04:45 +02:00
parent 1cc4c9af32
commit a7ffcfe7b2

View File

@ -467,8 +467,8 @@ class InvoiceRepository extends BaseRepository
if ($invoice->is_amount_discount) {
$total -= $invoice->discount;
} else {
$total *= (100 - $invoice->discount) / 100;
$total = round($total, 2);
$discount = round($total * ($invoice->discount/100), 2);
$total -= $discount;
}
}