Skip to content

Commit

Permalink
MAGETWO-83402: Fix issue #10347 - Wrong order tax amounts displayed w…
Browse files Browse the repository at this point in the history
…hen using specific tax configuration (2.2-develop) #11592
  • Loading branch information
Oleksii Korshenko authored Nov 21, 2017
2 parents 8797e4d + b510857 commit d91671c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/code/Magento/Tax/Model/Plugin/OrderSave.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order)
} else {
$percentSum = 0;
foreach ($taxRates as $rate) {
$realAmount = $rates['amount'] * $rate['percent'] / $rates['percent'];
$realBaseAmount = $rates['base_amount'] * $rate['percent'] / $rates['percent'];
$percentSum += $rate['percent'];
}

foreach ($taxRates as $rate) {
$realAmount = $rates['amount'] * $rate['percent'] / $percentSum;
$realBaseAmount = $rates['base_amount'] * $rate['percent'] / $percentSum;
$ratesIdQuoteItemId[$rates['id']][] = [
'id' => $taxesArray['item_id'],
'percent' => $rate['percent'],
Expand All @@ -110,7 +114,6 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order)
'real_amount' => $realAmount,
'real_base_amount' => $realBaseAmount,
];
$percentSum += $rate['percent'];
}
}
}
Expand Down

0 comments on commit d91671c

Please sign in to comment.