-
- Downloads
[FIX] account_edi_ubl_cii: tax exempt export
Previously, exporting BIS3 when there is a 0% tax in the invoice will results in the XML showing warning of UBL-CR-601. But if we do not include any TaxExemptionReason reason at all, a fatal error BR-E-10 will pop up. Here is the details of those 2 rules: ```xml (with context: /*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory [normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']) <assert id="BR-E-10" flag="fatal" test="exists(cbc:TaxExemptionReason) or exists(cbc:TaxExemptionReasonCode)"> [BR-E-10]-A VAT breakdown (BG-23) with VAT Category code (BT-118) "Exempt from VAT" shall have a VAT exemption reason code (BT-121) or a VAT exemption reason text (BT-120). </assert> and (no context) <assert id="UBL-CR-601" flag="warning" test=" not((cac:InvoiceLine|cac:CreditNoteLine)/cac:Item/ cac:ClassifiedTaxCategory/cbc:TaxExemptionReason)"> [UBL-CR-601]-A UBL invoice should not include the InvoiceLine Item ClassifiedTaxCategory TaxExemptionReason </assert> ``` Based on these rules, we can conclude that: - TaxExemptionReason must not appear in InvoiceLine/Item/ClassifiedTaxCategory - TaxExemptionReason must appear (when some line in invoice has exempt tax) in TaxTotal/TaxSubtotal/TaxCategory Previously, the TaxExemptionReason will appear on both places. This commit fixes that and adds a test to ensure that when a 0% tax is present, TaxExemptionReason only appear in TaxTotal/TaxSubtotal/TaxCategory closes odoo/odoo#154232 Task-id: 3703206 Signed-off-by:Laurent Smet (las) <las@odoo.com> Signed-off-by:
Yosua Nicolaus (yoni) <yoni@odoo.com>
Showing
- addons/account_edi_ubl_cii/models/account_edi_xml_ubl_bis3.py 11 additions, 2 deletions...ns/account_edi_ubl_cii/models/account_edi_xml_ubl_bis3.py
- addons/l10n_account_edi_ubl_cii_tests/tests/test_files/from_odoo/bis3_out_invoice_tax_exempt.xml 124 additions, 0 deletions...ests/test_files/from_odoo/bis3_out_invoice_tax_exempt.xml
- addons/l10n_account_edi_ubl_cii_tests/tests/test_xml_ubl_be.py 23 additions, 0 deletions...s/l10n_account_edi_ubl_cii_tests/tests/test_xml_ubl_be.py
Loading