From 757ec209ad28a756179367b04a6ca967c66b5929 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Thu, 19 Apr 2018 11:00:33 +0800 Subject: [PATCH] Fix OPL formula in discount calculation #96 --- src/Service/InvoiceCreator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Service/InvoiceCreator.php b/src/Service/InvoiceCreator.php index e5931062..695a9e2b 100644 --- a/src/Service/InvoiceCreator.php +++ b/src/Service/InvoiceCreator.php @@ -166,7 +166,8 @@ class InvoiceCreator $discount = round($total['sell_price'] * $rate, 2); break; case DiscountApply::OPL: - $discount = round($total['sell_price'] * 0.6 / 0.7 * $rate, 2); + // $discount = round($total['sell_price'] * 0.6 / 0.7 * $rate, 2); + $discount = round($total['sell_price'] * (1 - 1.5 / 0.7 * $rate), 2); break; }