2

Bug with tax calculation and discount price

Hello,

After reading a lot of threads about problem with tax calculation with discount price I found no solution about what is happening to me.

As you can see in the screenshot joined the price total after discount is different between the 3 products. This is a 30% discount on each products. The first and the last seems good but the second one has a different total. I don't know why. Thanks for your help !

EDIT :

Add a screenshot of my tax configuration settings

enter image description here

2
  • Can you post a screenshot of your settings under system->configuration->tax settings? Commented Jan 15, 2014 at 11:20
  • try and set Tax Calculation Method Based On to unit price instead of Total Commented Feb 18, 2014 at 21:24

2 Answers 2

1

Issue: The result of tax is a bit more than being expected when the tax setting is as follows in system->configuration->tax settings

Tax Calculation Method Based On: Unit Price
Apply Customer Tax: After Discount

Resolution: I rewrite the method _calcUnitTaxAmount in model Mage_Tax_Model_Sales_Total_Quote_Tax

It was:

$discountRate = ($unitTax/$price) * 100;<br/>
$baseDiscountRate = ($baseUnitTax/$basePrice) * 100;

After rewrite, it is

$discountRate = $inclTax == 1 ? ($unitTax/($price - $unitTax)) * 100 : ($unitTax/$price) * 100;<br/>
$baseDiscountRate = $inclTax == 1 ? ($baseUnitTax/($basePrice - $baseUnitTax)) * 100 : ($baseUnitTax/$basePrice) * 100;

Then the result in the totals is correct.

4
  • can you please explain in term of tax have to be calculate in magento store
    – Ami Kamboj
    Commented Jun 2, 2014 at 10:12
  • 1
    The first level tax calculation is Tax Calculation Method Based On which includes CALC_UNIT_BASE, CALC_ROW_BASE, CALC_TOTAL_BASE. Then the process of calculation goes into seperately. <br/> In CALC_UNIT_BASE, it does another level calculation by Apply Customer Tax: Before Discount / After discount. The bugs happens in After discount.
    – Amier
    Commented Jun 2, 2014 at 10:21
  • you can also see the details and view point :magentocommerce.com/knowledge-base/entry/…
    – Ami Kamboj
    Commented Jun 2, 2014 at 10:27
  • Cool Thanks, It needs more time to figure the tax calculation out clearly.
    – Amier
    Commented Jun 2, 2014 at 10:35
0

In magento 1.8.1 are lots of rounding issues fixed (there are still a lot) so you should try making an update.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.