Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento Discount ANd Tax Calculation

Tags:

magento

enter image description here

Kindly have a look the image showing the checkout details on my magento store. The subtotal price of 6929.82 is correct - to which a discount of 10% is to be applied. The discount amount of 692.98 is also correct. However I cannot figure out how in the world could magento calculate the difference of 6929.82 and 692.98 as 6321.94 . Though I am using a custom theme but I have tried restoring to default theme and the result remains the same which tells that the problem is either in the backend settings or in the core magento files. Further into the calculations - application of 14% tax after discount is calculated correctly and added to the figure.

Can anybody help me out in locating the setting that is leading to this strange behaviour from Magento.

like image 581
Sarthak Gupta Avatar asked Apr 22 '13 10:04

Sarthak Gupta


3 Answers

Looks like its a bug. See https://magento.stackexchange.com/questions/2900/completely-incorrect-tax-calculation

Try the following solution

app/code/local/Mage/Tax/Model/Sales/Total/Quote/Tax.php

Line 144

 if('cart' == Mage::app()->getRequest()->getControllerName()){
    $address->setGrandTotal($address->getGrandTotal() + $address->getTaxAmount());
    $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseTaxAmount());
} // if 
like image 160
Dushyant Joshi Avatar answered Oct 11 '22 05:10

Dushyant Joshi


Maybe there is Shipping&handling total is not displayed (amount 85.1). You can check all totals and their value through database, review sales_flat_quote_address table.

like image 35
complex Avatar answered Oct 11 '22 04:10

complex


After a lot of searching for possible solutions I could not come across any full proof solution to my problem. Modifying the Core Magento files is also something I would not recommend unless and until you are very sure what all areas of your website it will affect.

The solution I have implemented is to set the catalog prices as "excluding tax" in Tax Settings and thereafter manually changing all product prices by deducting the tax applicable on them.

e.g Before Implementing the solution:

Tax Setting - Catalog prices include tax

Price of Item (as entered in product specification)- 100 {subtotal 86 + 14@14% tax}

After Solution

Tax Setting - Catalog prices exclude tax

Price of Item (as entered in product specification)- 86

After implementing this I found the discount totals and everything was being calculated correctly. Since I had only 400 odd products I did it manually over the week just to be sure. However for larger number of products you can also run a query through phpmyadmin(etc) to change the values directly in the database. Do remember to backup your DB before doing so.

like image 2
Sarthak Gupta Avatar answered Oct 11 '22 06:10

Sarthak Gupta