Skip to content

Commit

Permalink
Merge pull request #1746 from magento-engcom/2.2-develop-prs
Browse files Browse the repository at this point in the history
Public Pull Requests

#11592 Fix issue #10347 - Wrong order tax amounts displayed when using specific tax configuration (2.2-develop) by @PieterCappelle

Fixed Public Issues

#10347 Wrong order tax amounts displayed when using specific tax configuration
  • Loading branch information
Oleksii Korshenko authored Nov 21, 2017
2 parents 8797e4d + d91671c commit 9fc1138
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 9fc1138

Please sign in to comment.