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