From a7ffcfe7b224f72a35986dea618f711087e4e300 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 25 Jan 2017 13:04:45 +0200 Subject: [PATCH] Merge: 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 eede3534fe4c..fd6e54ed3da8 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; } }