ErrorEN 16931Manual only

BR-AG-08

For each different value of VAT category rate (BT-119) where the VAT category code (BT-118) is "IPSI", the VAT category taxable amount (BT-116) in a VAT breakdown (BG-23) shall equal the sum of Invoice line net amounts (BT-131) plus the sum of document level charge amounts (BT-99) minus the sum of document level allowance amounts (BT-92) where the VAT category code (BT-151, BT-102, BT-95) is "IPSI" and the VAT rate (BT-152, BT-103, BT-96) equals the VAT category rate (BT-119).

What does this rule mean?

The taxable amount (BT-116) of a breakdown in category M (IPSI, Ceuta and Melilla) does not match the lines, allowances and charges at that rate.

IPSI has several rates and each rate gets its own breakdown, so the sum is per rate (BT-119), not per category.

BG-23
VAT breakdown (group)
BT-92
Document level allowance amount
BT-95
Document level allowance VAT category code
BT-96
Document level allowance VAT rate
BT-99
Document level charge amount
BT-102
Document level charge VAT category code
BT-103
Document level charge VAT rate
BT-116
VAT category taxable amount
BT-118
VAT category code (UNCL 5305)
BT-119
VAT category rate
BT-131
Invoice line net amount
BT-151
Invoiced item VAT category code (UNCL 5305)
BT-152
Invoiced item VAT rate
Official rule message (standard)

For each different value of VAT category rate (BT-119) where the VAT category code (BT-118) is "IPSI", the VAT category taxable amount (BT-116) in a VAT breakdown (BG-23) shall equal the sum of Invoice line net amounts (BT-131) plus the sum of document level charge amounts (BT-99) minus the sum of document level allowance amounts (BT-92) where the VAT category code (BT-151, BT-102, BT-95) is "IPSI" and the VAT rate (BT-152, BT-103, BT-96) equals the VAT category rate (BT-119).

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

  • /*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'M'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']

CII

  • //rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode = 'M'][upper-case(ram:TypeCode) = 'VAT']

Technical test

The rule passes when this Schematron expression holds true:

every $rate in ../ram:RateApplicablePercent/xs:decimal(.) satisfies (../ram:BasisAmount = (round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement[ram:ApplicableTradeTax/ram:CategoryCode = 'M' and ram:ApplicableTradeTax/xs:decimal(ram:RateApplicablePercent) =$rate]/ram:SpecifiedTradeSettlementLineMonetarySummation/xs:decimal(ram:LineTotalAmount)) * 10 * 10) div 100 + round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=true() and ram:CategoryTradeTax/ram:CategoryCode='M' and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate]/xs:decimal(ram:ActualAmount[1])) * 10 * 10) div 100 - round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=false() and ram:CategoryTradeTax/ram:CategoryCode='M' and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate]/xs:decimal(ram:ActualAmount[1])) * 10 * 10) div 100))

How to fix it

Touches amounts, VAT or IBAN. We never change these automatically — correct them in your source data.

Recompute per rate: the line net amounts (BT-131) at that rate, plus charges (BT-99), less allowances (BT-92).

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.

100% local — no upload, no account.

Related rules

← Back to the error library