Hello,
Not sure if the best place to discuss is here or on the jira ticket, but i've tested your patch and i still got issues.
But perhaps i miss something on the tax configuration ?
Could you apply your sql migration to
test.idempiere.org and update the c_tax records (by direct sql) - then you won't need to deploy the modified MTax class.
Otherwise, wouldn't be MTax.getAll / Tax.get methods which should be modified ?
I mean, instead of taking the first tax which satisfy all criteria, it could be better to search for a tax that will :
- have good tax category
- have same from country
- have same to country
If no tax is corresponding, then test tax that
- have good tax category
- have same from country or country group
- have same to country or country group
[...] until we found the good tax.
Or perhaps (just an idea), add a 'Applicability case' table
There we can define all use case. Eg:
Tax Category 1 ; FromCountry=France ; ToCountry=France => C_Tax_ID = 1000002
Tax Category 1 ; FromCountry=France ; ToCountryGroup=EU => C_Tax_ID = 1000003
Tax Category 1 ; FromCountry=France ; ToCountry=Colombia => C_Tax_ID = 1000004
Then, when searching for the C_Tax_ID, we "just" need to look into that table to find the correct tax rate.
wdyt ?
Thanks,
Nicolas