Skip to content

Commit

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

#11594 Fix issue #10347 - Wrong order tax amounts displayed when using specific tax configuration (2.3-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 51400d9 + ff8d0f6 commit bf12a80
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 bf12a80

Please sign in to comment.