From 97bbc55c232ac8dff451858e1495e72751c21425 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 25 Jan 2017 13:03:26 +0200 Subject: [PATCH] Fix discount rounding #1305 --- app/Ninja/Repositories/InvoiceRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index f720e9119202..8d505218067b 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -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; } }