I am running Magento 1.5.1.0 and had problems with tax calculation on bill amounts. While the calculation will be correct for all totals in my store, incorrect totals will be displayed on the invoice screen and in pdf invoices.
The difference between the incorrect, displayed value and the correct value can be seen in this figure: (Short version: the subtotal will include sales tax, although delivery tax is already included in the shipping cost) http://i731.photobucket.com/albums/ww318 /vitamin6/orderview_fixed.jpg
So, I posted this problem on freelancer.com, and someone managed to fix it. BUT, as I found out later, the correction does not apply to each scenario - if the order has free delivery, the invoice subtotal will still be incorrect. Here is a screenshot to show the difference: http://i731.photobucket.com/albums/ww318/vitamin6/orderview_freeship.jpg
The freelancer edited the following file to correct the incorrect tax calculation: Application \ code \ Local \ Mage \ Sales \ Model \ Order \ Account \ General \ Subtotal.php
Here is the following code:
if ($invoice->isLast()) { $subtotal = $allowedSubtotal; $baseSubtotal = $baseAllowedSubtotal; $subtotalInclTax = $allowedSubtotalInclTax; $baseSubtotalInclTax = $baseAllowedSubtotalInclTax;
has been replaced by the following:
if ($invoice->isLast()) { $subtotal = $allowedSubtotal; $baseSubtotal = $baseAllowedSubtotal; //$subtotalInclTax = $allowedSubtotalInclTax; //$baseSubtotalInclTax = $baseAllowedSubtotalInclTax; $subtotalInclTax = min($allowedSubtotalInclTax, $subtotalInclTax); $baseSubtotalInclTax = min($baseAllowedSubtotalInclTax, $baseSubtotalInclTax);
Can someone point me in the right direction, how will I have to modify the file additionally to make the fix work for orders with free delivery? More information on tax settings, etc. It can be provided if necessary - thanks in advance!
source share