Comment 8 for bug 1084822

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hello,

I've carefully read the discussion about this bug, and I believe there is a real issue here. So if you don't mind, I'll re-open it in order to discuss in more details.

Issue description: can't set analytic accounts on tax lines.

How to reproduce:
- install accounting, with l10n_be
- in configuration, enable analytic accounting
- create a supplier invoice
- create an invoice line for 1000€ with account 600000, tax VAT-IN-V82-CAR-EXC, and set an analytic account on the invoice line
- update to compute the taxes

-> notice all analytic account remain empty in the Taxes list
-> since with this tax code, 50% of the VAT is non recoverable, it goes to the base account on which we want an analytic account: the analytic account should therefore be propagated to such tax lines too

- the taxes should look like this

Tax Description | Tax Account | Analytic account | Base | Amount
VAT-IN-V82-CAR-EXC-C1 | 600000 | My Analytic Account | 1,000.00 | 105.00
VAT-IN-V82-CAR-EXC-C2 | 411059 | | 1,000.00 | 105.00
VAT-IN-V82-CAR-EXC-C3 | 600000 | My Analytic Account | 1,000.00 | 0.00

-> if I change the analytic account on taxes manually and click validate I get an error: "Global taxes defined, but they are not in invoice lines !", so I can't validate the invoice
-> if I click on (update) to recompute the taxes, the analytic accounts on taxes are lost again

I understand it is possible to set the analytic account on the tax itself, but this is not what we want to do, as it would imply the same analytic accounts for all invoices using that tax. That may be ok for tax accounts, but it is not for expense accounts.

In my opinion, there are two things to do to solve this:
A/ make the analytic account column read-only in the taxes box on invoices, to avoid confusing the user
B/ when tax lines are generated on the same financial accounts as invoice lines, the analytic accounts should be propagated from the invoice lines to the tax lines.

The rationale for B/ is as follow. In situations like the example above (car expenses in Belgium), only a part of the VAT must go to the VAT Deductible account (411059), and the rest must go to the expense account (600000). Many companies have a rule that all expense and revenue accounts must have an analytic account, and the current implementation makes it impossible to inforce this rule. The only workaround with the current implementation is to set an analytic account on the tax definition itself, but that would require to create a new tax for each analytic account, which is not feasible in practice.

Best regards,

-sbi