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) { if ($invoice->is_amount_discount) {
$total -= $invoice->discount; $total -= $invoice->discount;
} else { } else {
$total *= (100 - $invoice->discount) / 100; $discount = round($total * ($invoice->discount/100), 2);
$total = round($total, 2); $total -= $discount;
} }
} }