Selecting right tax identifier for invoices

In Spain, a company may have two tax identifiers, one used for transactions inside Spain and another used for European Companies. It will be great if tryton selects the company identifer automatically based on the party tax identifier.

With the current design, it will be easy to pass the prefix for the party tax identifer to the get_tax_identifier function. When such prefix is set, the function will look at all the available identifers to see if any has the same prefix and use it no mather on who it is ordered. This is similar to what we do for contact mechanisms to decide which one to use for each type of communication.

This will be a simple solution to make tryton a little bit smarter. Does it sound reasonable? Do you have some example which such algorith won’t work?

This is not how VAT tax works in Europe. It depends on the source and destination country.
For me it needs to have a rule engine similar to the tax rule (maybe even reusing or extending it).

1 Like

For me its a good idea to relate the identifier with the tax rule as currently one must set a tax rule to properly compute taxes.

Then tax rules may be also automatically set based on the source and destination country.
Furthermore it may depen on the organiztion (European Union) instead of the country.