Tax miscalculation for partial creditmemo
문제
We are working on a project for a customer that is running on Magento Community Edition 1.7.0.1.
We have encountered the following issue:
When we create a partial credit memo the recalculation of the tax amount is done properly. (=Total Tax field)
As soon as we click on the Total Tax field when viewing the details of the partial credit memo we just created the details pop out. (Default Magento behavior).
The calculation of the tax rate is wrong:
As you can see the "Total TVA" (=Total Tax) is correct but the detailed tax rate "TVA (21%)" is not correct.
The given amount next to "TVA (21%)" matches the total tax amount of the complete order we created.
Basically, it means that this isn't recalculated properly... Do any of you also have this issue? Could it be a Magento bug? Any idea what the cleanest way would be to solve this?
해결책
Managed to solve this by editing app/design/frontend/your_package/your_theme/template/tax/order/tax.phtml:
Look for the following:
<?php
$percent = $info['percent'];
$amount = $info['amount'];
$rates = $info['rates'];
$isFirst = 1;
?>
and replace it with:
<?php
$percent = $info['percent'];
$amount = $_source->getTaxAmount();
$rates = $info['rates'];
$isFirst = 1;
?>