Improve tax configuration to support external services


Improve tax configuration to support external services like AvaTax




Elaine Tan
August 15, 2013, 7:33 AM
  • Move the standard tax calculation code to a class called StandardTaxProvider to calculate order & invoice tax total and update order & invoice tax

  • Create Tax Provider Configuration (i.e. C_TaxProviderCfg) table to store the name, class, etc of the tax provider at System level

  • Create Tax Provider (i.e. C_TaxProvider) table to store the credential info of a Tax Provider Configuration at Client level

  • If there is a Tax Provider defined at the Client level, the system will call the tax provider class defined at C_TaxProviderCfg.TaxProviderClass to do the tax calculation

  • If no Tax Provider is defined at the Client level, the system will call the StandardTaxProvider to calculate the tax

  • Create a ITaxProviderFactory to create new instance of the tax provider like IShipmentProcessorFactory

  • Some of the tax providers are country or region specific, same goes for shipping and payment processors. We need to come up with a standardized approach for all services that depends on region

Hiep Lq
May 30, 2018, 7:34 AM

hi ,
i see you write wiki Developing_Plug-Ins_-_ITaxProviderFactory so i mention you to discuss.

on my instance, sometime tax amount on invoice line is a bit diffrence from value return by MTax.calculateTax .
so i want to allow end user modify value of "Tax Amount" on invoice line. i will add a new field call "input tax".
each time call MTax.calculateTax will return value from "input tax"

it look ITaxProvider isn't yet covert this case. what do you think about add ITaxProvider.calculateTaxForLine?

Elaine Tan
May 30, 2018, 9:58 AM

Hi ,

You can use the StandardTaxProvider and make enhancement to MTax.calculateTax to return the value from 'Input Tax' if there is a value defined, else calculate the tax based on the tax rate.

ITaxProvider does not cover MTax.calculateTax because it is not using the standard tax calculation method in ERP to calculate the tax. It is for tax services like Avalara AvaTax where we request for real-time tax calculation from the tax service provider.


Hiep Lq
June 1, 2018, 9:05 AM


Elaine Tan


Elaine Tan



Tested By



Fix versions