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".
What does this rule mean?
Lines, allowances or charges are IPSI (Ceuta and Melilla, category M) but the VAT breakdown (BG-23) has no such category.
The breakdown is the invoice summarised by category. With this one missing, part of the invoice is accounted for nowhere.
- BG-20
- Document level allowances (group)
- BG-21
- Document level charges (group)
- BG-23
- VAT breakdown (group)
- BG-25
- Invoice line (group)
- BT-95
- Document level allowance VAT category code
- BT-102
- Document level charge VAT category code
- BT-118
- VAT category code (UNCL 5305)
- BT-151
- Invoiced item VAT category code (UNCL 5305)
Official rule message (standard)
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".
Where the rule applies
Syntax: CII · UBL
The same rule, expressed twice: UBL and CII name the same fields with different paths. Running a CII file against the UBL rules is why you get errors that mean nothing.
UBL
/ubl:Invoice | /cn:CreditNote
CII
/rsm:CrossIndustryInvoice
Technical test
The rule passes when this Schematron expression holds true:
((count(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='M']) + count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='M'])) >=2 or not (//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='M'])) and ((count(//ram:CategoryTradeTax[ram:CategoryCode='M']) + count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='M'])) >=2 or not (//ram:CategoryTradeTax[ram:CategoryCode='M']))How to fix it
Touches amounts, VAT or IBAN. We never change these automatically — correct them in your source data.
Add a breakdown whose category code (BT-118) is IPSI.
Correct the affected entry in your XML, then re-check the invoice. Validation runs locally in your browser — your file never leaves your machine.
Check an e-invoice here
Drop an XML or ZUGFeRD PDF file here. Validation runs locally in your browser against EN 16931 — your file never leaves your machine.