Add subdivisions to match account tax rule

Rational

account_tax_rule_country adds from/to country to apply some account tax rule. In some countries there are rule against subdivisions to apply other taxes. For example, in Spain and Canaries Islands.

Proposal

Four criteria fields:

  • From Country: The country of origin
  • To Country: The country of destination
  • From Subdivision: The subdivision of origin
  • To Subdivision: The subdivision of origin

https://bugs.tryton.org/issue8252

I do not see the point to add this to the account_tax_rule_country. A subdivision is not a country. So it should be a new module.
How is the tree nature of subdivision managed?
Is it really the right way to implement it? Does it really depend on the shipping address? Can it not be managed with a different tax rule on the party?
What about local business, do the same rule applies than for non-local business? What about other country business?

In the case of Spain, sending goods to the Canary Islands is treated as an export operation.

The Canary Islands is an “Autonomous Community” which is divided into two “Provinces”:

  • Santa Cruz de Tenerife
  • Las Palmas

It really depends on the shipping address.

Not sure what you mean. If you mean what happens when a Business from the Canary Islands sends goods to another business in the Canary Islands the answer is that they apply a regional VAT named “IGIC”.

Sending goods from the Peninsula to the Peninsula we apply a VAT (21%, 10% or 4%)

Sending goods from the Peninsula to the Islands we apply 0% - Export.

Sending goods from the Islands to the Islands we apply IGIC (lower than Peninsula VAT: 3%, 7%…)

Sending goods from teh Islands to the Peninsula we apply 0% - Import.

Not sure about what you mean here. Do you mean services?

Here’s what appears to be a good summary of several use cases:

http://www.grupobelmar.onored.com/news/Year_2014/News_20140212.html

Well this brings the problem of subdivision tree structure.

Then a tax rule will not be enough for a local business. Or they need a way to define what is the default subdivision when none is provided.

I mean when one of the business is outside the country.

Hi

We worked on a similar module (which I have not yet had time to publish).
We have also added the article accounting category as possible selector for the rule (see a discussion thread in French unfortunately : https://discuss.tryton.org/t/french-vat-substitution/1194)
Do you want me to publish it to make it a work base?

Regard

You can find here our work: https://gitlab.com/ate_modules/a4t-account_tax_rule_subdivision
(the test and doc isn’t writing for now)

For me, it does not solve the tree structure of subdivision and account_category should be in another module.

Yes, maybe, it’s always possible to separate it …

In our case, the tax rules depended on the subdivision and the products we put everything together.

We can write 2 differents modules a proposal of name for the second module ?

Does it require to set a tax rule for specifc product or using categories is enought? Does it depend on accounting or all categories should be used?

Please note that for categories you should also take in account the category tree.

account_tax_rule_product sounds as a good name

For me children subdivisions should match also the parents subdivisions. Like we do for price_lists.

I’m wondering if we should not have just one account_tax_rule_extended module that will include a common sets of criteria. (Of course it should replace account_tax_rule_country).

For the specific case of the subdivision, for me it should go into the account_tax_rule_country module. After all, the “country” module also includes subdivisions. We do not have a “subdivision” module for them.

I’m not very fond of appending “extended” to a module name. At NaN-tic we used to have things like that in OpenERP and we tried to avoid it in Tryton to give it a better, more specific, name.

OK that sounds rational.

So now there are still the question on how to deal when there is no country or subdivision defined on the address. And how such subdivision related tax rules works for importations.
Then we can have someone to write a proper blueprint.

Done here: https://discuss.tryton.org/t/conditional-tax-rule/1435