Peppol BIS Billing 3.0.20 · UBL

BR-AG-01: An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or…

Peppol BIS Billing 3.0.20 · UBL

fatalbusiness

Original rule text

[BR-AG-01]-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 "IPSI" shall contain in the VAT breakdown (BG-23) at least one VAT category code (BT-118) equal with "IPSI".

Stored validation assertion
((count(//cac:AllowanceCharge/cac:TaxCategory[normalize-space(cbc:ID) = 'M'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']) + count(//cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'M'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'])) > 0 and count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cbc:ID = 'M'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']) > 0) or ((count(//cac:AllowanceCharge/cac:TaxCategory[normalize-space(cbc:ID) = 'M'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']) + count(//cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'M'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'])) = 0 and count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'M'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']) = 0)

BR-AG-01 is a fatal rule in the business layer of Peppol BIS Billing 3.0.20 · UBL. An invoice that breaks it is rejected. It refers to BG-25, BG-20, BG-21, BT-151, BT-95, BT-102, BG-23, BT-118.

What this rule requires

The message says an invoice with an invoice line, a document-level allowance or a document-level charge whose VAT category code is "IPSI" must contain a VAT breakdown entry (BG-23) with that code. Both syntax tests look for the code M, not the word "IPSI".

In UBL, if a cac:AllowanceCharge/cac:TaxCategory or cac:ClassifiedTaxCategory with cbc:ID M and VAT tax scheme exists, then cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory must contain a cbc:ID M entry whose tax scheme is VAT. The test also works the other way: if no such source category exists, the breakdown must not contain a M entry with the VAT tax scheme.

In CII, the test does not simply require one breakdown entry. If ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax has a ram:CategoryCode M, the number of those entries plus the ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax entries with M must be at least 2. The same holds for ram:CategoryTradeTax entries with M (document-level allowances and charges) plus the header entries. The CII test has no reverse check.

How to fix

In UBL, add a cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory with cbc:ID M and the VAT tax scheme whenever a line, allowance or charge uses M, and remove a M breakdown entry when none does. In CII, make sure a header ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax with ram:CategoryCode M exists whenever a line or document-level allowance or charge uses M. Use the code M in the document; the word "IPSI" is not matched by this rule's test.

Guidance on this rule. The original text above is authoritative.

Where to go next

No published Peppol BIS Billing UBL release comparison lists a change to BR-AG-01.

Validate an invoice against these rules · All release changes