An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151, BT-95 or BT-102) is "Reverse charge" shall contain in the VAT breakdown (BG-23) exactly one VAT category code (BT-118) equal with "VAT reverse charge".
If the counted tax details for category AE are not all absent, the test requires exactly one document-level ram:ApplicableTradeTax and at least one matching occurrence under ram:SpecifiedLineTradeSettlement or ram:CategoryTradeTax. The existing occurrences do not meet this condition.
The VAT breakdown associates reverse-charge amounts with category AE. The checked structure limits the number of document-level tax details and requires a matching occurrence in one of the checked structures.
The tax details for category AE do not match the counts and distribution checked by the test. Review the related details at document level and in the relevant tax structures.
- Check where tax category
AEis used on invoice lines, allowances, or charges. - Check the VAT breakdown tax details using
FacturXInvoice.AddApplicableTradeTax(...). - Generate the invoice again and validate it.
TaxCategoryCodes(BT-151; BT-95; BT-102; BT-118)FacturXInvoice.AddApplicableTradeTax(basisAmount, percent, taxAmount, typeCode, categoryCode, allowanceChargeBasisAmount, exemptionReasonCode, exemptionReason, lineTotalBasisAmount)(BG-23)FacturXInvoice.AnyApplicableTradeTaxes()(BG-23)FacturXInvoice.GetApplicableTradeTaxes()(BG-23)FacturXInvoice.Taxes(BG-23)
Technical details
The XPath passes if all counted AE occurrences are absent, or if exactly one ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax with category AE exists together with at least one AE occurrence under ram:SpecifiedLineTradeSettlement or ram:CategoryTradeTax.
The rule applies to the entire document when invoice lines, allowances, or charges use tax category AE. It checks occurrences of that category in line-level tax details, document-level tax details, and the VAT breakdown.
rule/@context)assert/@test)