Skip to content
Snippets Groups Projects
Commit 9a5ba15c authored by Julien Van Roy's avatar Julien Van Roy
Browse files

[FIX] {l10n_}account_edi_ubl_cii{_tests}: handle price_include taxes


In Factur-X, there is no way to represent a tax "price_include" because
every amounts should be tax excluded.

Currently in Factur-X, a line with a tax price_include = True will be
incorrectly exported. Indeed, the Factur-X.xml is generated by setting the
GrossPriceProduct as the price_unit. In Factur-X, this amount (and the others
in the line details) should be tax excluded. Thus, it's wrong to set the
GrossPriceProduct as the price_unit.

To fix this, the GrossPriceProduct should be the price_unit if no tax
price_include = True is set, otherwise, the gross price = price_unit/(1+tax/100).

This way, the Factur-X file will be consistent with the norm.

Note that the import of a Factur-X xml will thus try to pick taxes with price_include = False,
and the price_unit will be tax excluded. If no matching tax with price_include = False is
retrieved, a tax with price_include = True is searched, if found, the price_unit is
recomputed accordingly. In both cases, the lines subtotals are the same.

opw-3032382

closes odoo/odoo#106465

X-original-commit: 649e0f2d
Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
Signed-off-by: default avatarJulien Van Roy <juvr@odoo.com>
parent d4b91b6c
No related branches found
No related tags found
No related merge requests found
Showing
with 422 additions and 91 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment