The problem is, that exists some places, in magento:
app/code/core/Mage/Tax/Model/Sales/Total/Quote/Shipping.php
app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php
wich don't use Mage::helper('tax')->discountTax() to get this settings but: $this->_config->discountTax($store) (_config is: Mage::getSingleton('tax/config'))
My solution was to change in avatax/.../config.xml: <discount_tax>0</discount_tax> (instead 1), but, if this settings was saved before Avatax install, this will not solve the problem.
Probably you need to rewrite Mage_Tax_Model_Config (instead of Mage_Tax_Helper_Data, because helper use Config) or, at install, update in core_config_data the keys:
tax/calculation/{based_on|price_includes_tax|shipping_includes_tax|apply_after_discount|discount_tax|apply_tax_on} we the needed values (same as in helper)
I have a coupoun with 10% discount, and I get:
And I expect a $8.8 discount.
After (not so) few research, I think that I find the problem:
<discount_tax>1</discount_tax>
https://github.com/onepica/avatax/blob/master/app/code/community/OnePica/AvaTax/etc/config.xml#L299But, in helper, you have "return false" in function discountTax: https://github.com/onepica/avatax/blob/master/app/code/community/OnePica/AvaTax/Helper/Tax/Data.php#L119
The problem is, that exists some places, in magento: app/code/core/Mage/Tax/Model/Sales/Total/Quote/Shipping.php app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php
wich don't use Mage::helper('tax')->discountTax() to get this settings but:
$this->_config->discountTax($store)
(_config is: Mage::getSingleton('tax/config'))and, with no other settings, we have:
OnePica_AvaTax_Helper_Tax_Data::discountTax: false Mage_Tax_Model_Config::discountTax: true
My solution was to change in avatax/.../config.xml:
<discount_tax>0</discount_tax>
(instead 1), but, if this settings was saved before Avatax install, this will not solve the problem.Probably you need to rewrite Mage_Tax_Model_Config (instead of Mage_Tax_Helper_Data, because helper use Config) or, at install, update in core_config_data the keys: tax/calculation/{based_on|price_includes_tax|shipping_includes_tax|apply_after_discount|discount_tax|apply_tax_on} we the needed values (same as in helper)