details: https://code.tryton.org/tryton/commit/7a1ce6a9afce
branch: 8.0
user: Rémi Letot <[email protected]>
date: Tue Oct 27 14:57:05 2026 +0100
description:
Do not deduct allowances or add charges to the tax-exclusive amount
from UBL
According to BR-CO-13 the tax-exclusive amount already includes the
allowances
and charges. This means that it can be used directly as the source of
untaxed
amount.
Closes #15165
(grafted from 850d8cda06dfcab41506c8e751d524756d1879f1)
diffstat:
modules/edocument_ubl/edocument.py | 32 ++++----------------------------
1 files changed, 4 insertions(+), 28 deletions(-)
diffs (51 lines):
diff -r cb0e01422e78 -r 7a1ce6a9afce modules/edocument_ubl/edocument.py
--- a/modules/edocument_ubl/edocument.py Fri Oct 16 18:16:05 2026 +0200
+++ b/modules/edocument_ubl/edocument.py Tue Oct 27 14:57:05 2026 +0100
@@ -413,21 +413,9 @@
is not None)):
invoice.cash_rounding = True
- if tax_exlusive_amount := root.findtext(
+ if tax_exclusive_amount := root.findtext(
'./{*}LegalMonetaryTotal/{*}TaxExclusiveAmount'):
- untaxed_amount = Decimal(tax_exlusive_amount)
-
- if allowance_total_amount := root.findtext(
- './{*}LegalMonetaryTotal/{*}AllowanceTotalAmount'):
- allowance_total_amount = Decimal(allowance_total_amount)
- untaxed_amount -= allowance_total_amount
-
- if charge_total_amount := root.findtext(
- './{*}LegalMonetaryTotal/{*}ChargeTotalAmount'):
- charge_total_amount = Decimal(charge_total_amount)
- untaxed_amount += charge_total_amount
-
- invoice.source_untaxed_amount = untaxed_amount
+ invoice.source_untaxed_amount = Decimal(tax_exclusive_amount)
tax_amount = sum(Decimal(amount.text) for amount in root.iterfind(
'./{*}TaxTotal/{*}TaxAmount'))
@@ -738,21 +726,9 @@
is not None):
invoice.cash_rounding = True
- if tax_exlusive_amount := root.findtext(
+ if tax_exclusive_amount := root.findtext(
'./{*}LegalMonetaryTotal/{*}TaxExclusiveAmount'):
- untaxed_amount = Decimal(tax_exlusive_amount)
-
- if allowance_total_amount := root.findtext(
- './{*}LegalMonetaryTotal/{*}AllowanceTotalAmount'):
- allowance_total_amount = Decimal(allowance_total_amount)
- untaxed_amount -= allowance_total_amount
-
- if charge_total_amount := root.findtext(
- './{*}LegalMonetaryTotal/{*}ChargeTotalAmount'):
- charge_total_amount = Decimal(charge_total_amount)
- untaxed_amount += charge_total_amount
-
- invoice.source_untaxed_amount = -untaxed_amount
+ invoice.source_untaxed_amount = -Decimal(tax_exclusive_amount)
tax_amount = sum(Decimal(amount.text) for amount in root.iterfind(
'./{*}TaxTotal/{*}TaxAmount'))