Link between different tax lines

In Spain we have an special tax that is called recargo the equivalencia which is applied to some companies when purchasing goods or services to other companies.

This tax is applied as an extra charge of the main tax and when reporting the list of operations to the tax authority (using the VAT book or the Suministro Inmediato of Information) it is required to detail in a single line both taxes.

Let me put an example:

We have an invoice of an untaxed_amount for 100€, which applies for normall IVA (21%) and normal recargo de equivalencia (5.2%). On tryton the following tax lines are created:

  • IVA 21%: Base 100€ Amount: 21€
  • Recargo 5.2: Base: 100€ Amount: 5.2€

But when reporting this to the tax authorities we need to report the following details:

  • IVA 21%, Base 100€, Amount 21€, Recargo Type: 5.2, Recargo Amount: 5.2€

For those invoices that did not have any recargo amount the recargo type and recargo amounts are empty.

As in a single invoices we may include different IVAs (and so different Recargo Types) we should be able to determine that the RE tax is related to the IVA.

Currently the only relation between both lines is that there is an with the Keep Origin boolean field set between them. This can be used by a functional field to compute it’s amounts. But I’m not sure if this is the way to go.

Any toughs on this will be very welcome.

For me after many years hearing about this “recargo” taxes, I still do not understand what it is.
Is it an increase of the original tax rate and the amount is booked in the same account with a single line?
Is it another tax which is booked differently but then why should it be reported together?

On the invoice lines both taxes should be reported on sepate lines (tax authority cleary say that both amounts should be separated).

When posting the invoice normally both taxes are included on the same account.

For the VAT declaration both taxes are included on the same report (Modelo 303) but they are reported on diferent tax codes.

Because both taxes are related. We have 3kinds of VAT (normal, reduced and super reduced). And we also have 3 types of recargo (one for normal, one for reduced and another for super reduced).

Here are the types:

  • Normal: IVA 21%, Recargo 5.2%
  • Reduced: IVA 10%, Recargo 1.4%
  • Super reduced: IVA 4%, Recargo: 0.5%

So if the supplier applies the Recargo tax, you should always include both taxes on the invoices and so on the report.

Here is another thread explaining the cases.

I do not think it is right to use tax rule to group the invoice tax in a report. Instead I would store in a configuration model, the taxes that must be reported together. Maybe you could use tax group for that (and maybe we should make it a Many2Many).

Adding a reported_with Many2One field on taxes (and templates) that points to the IVA tax should be enought. If this is so specific we can add it only to the account_es module, as I’m not sure if it will be used on other countries.

This sound as a good idea as it will allow to correctly compute the amounts using and sql expresion which has better performance.

Both taxes should be from the same tax group otherwise it won’t be possible to define the tax rule.

Adding a field see very specific but reusing group not.

But if tax had groups this would not be a problem.

But having two diferent tax groups will not allow use to solve the problem. Let me explain:

There are two tax groups: Sales and Recargo (to be created).

Sales tax group contains 5 taxes and recargo contains 3 taxes.

We need to match the 3 taxes from the recargo tax group to three taxes of the IVA group (and leave two alone). For each of this 6 taxes there is a direct relation from tax to tax (Depending if it’s normal, reduced or superreduced).

I mean to create 3 Recargo groups that each link two taxes together. But this may be complicated to implement without adding anyway a field on the group.
So I guess the simplest solution is to add a field on the tax to be reported with the tax.

I’ve just filled Issue 9182: Add link between IVA and recargo taxes - Tryton issue tracker with an initial implementation.
The next step is to use this feature to implement VAT Book and complete the SII module.