diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index efc34f46..4b571251 100644 --- a/app/Services/OrderService.php +++ b/app/Services/OrderService.php @@ -817,9 +817,12 @@ class OrderService foreach ($amounts as &$amount) { $i--; + $originalAmount = $amount; + if ($i > 0) { $amount = (int) bcdiv(bcmul($couponAmount, $amount, 0), $totalAmount, 2); $couponAmount -= $amount; + $totalAmount -= $originalAmount; } else { $amount = $couponAmount; }