InvoiceValidator.eu

BR-AG-01

fatalEN 16931EN 16931 business ruleCIIUBLBG-20BG-21BG-23BG-25BT-102BT-118BT-151BT-95

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".

Why it fails

The invoice has at least one line, allowance or charge with VAT category IPSI — the Spanish indirect tax used in Ceuta and Melilla — but the VAT breakdown (BG-23) has no group with that category code.

How to fix it

Add a VAT breakdown group (BG-23) with VAT category code IPSI and its taxable amount (BT-116) — the sum of the net amounts in that category. IPSI behaves like a standard rate, not like an exemption: set the VAT rate (BT-119) to the rate you charged (BR-AG-05 allows 0 or greater) and the VAT category tax amount (BT-117) to taxable amount x rate / 100 (BR-AG-09). Do not add an exemption reason — BR-AG-10 forbids BT-120 and BT-121 here, which is the usual second failure. If you charge more than one IPSI rate you need one breakdown group per rate, not one for the category.

What the validator checks

CII — context /rsm:CrossIndustryInvoice

((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']))

UBL — context /ubl:Invoice | /cn:CreditNote

((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)

Related rules

Part of BR-AG — IPSI (Ceuta and Melilla).

Check your own invoice against BR-AG-01

…or paste the XML instead

Nothing is stored, and the whole invoice is checked, not just this rule. A PDF only works if it is Factur-X / ZUGFeRD — a PDF with the invoice XML inside it.