Peppol BIS Billing 3.0.21 · UBL

BR-AG-08: For each different value of VAT category rate (BT-119) where the VAT category code…

Peppol BIS Billing 3.0.21 · UBL

fatalbusiness

Original rule text

[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).

Stored validation assertion
every $rate in xs:decimal(cbc:Percent) satisfies ((exists(//cac:InvoiceLine) and ((../xs:decimal(cbc:TaxableAmount - 1) < (sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='M'][cac:Item/cac:ClassifiedTaxCategory/xs:decimal(cbc:Percent) =$rate]/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='M'][cac:TaxCategory/xs:decimal(cbc:Percent) = $rate]/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='M'][cac:TaxCategory/xs:decimal(cbc:Percent) = $rate]/xs:decimal(cbc:Amount)))) and (../xs:decimal(cbc:TaxableAmount + 1) > (sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='M'][cac:Item/cac:ClassifiedTaxCategory/xs:decimal(cbc:Percent) =$rate]/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='M'][cac:TaxCategory/xs:decimal(cbc:Percent) = $rate]/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='M'][cac:TaxCategory/xs:decimal(cbc:Percent) = $rate]/xs:decimal(cbc:Amount)))))) or (exists(//cac:CreditNoteLine) and ((../xs:decimal(cbc:TaxableAmount - 1) < (sum(../../../cac:CreditNoteLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='M'][cac:Item/cac:ClassifiedTaxCategory/xs:decimal(cbc:Percent) =$rate]/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='M'][cac:TaxCategory/xs:decimal(cbc:Percent) = $rate]/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='M'][cac:TaxCategory/xs:decimal(cbc:Percent) = $rate]/xs:decimal(cbc:Amount)))) and (../xs:decimal(cbc:TaxableAmount + 1) > (sum(../../../cac:CreditNoteLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='M'][cac:Item/cac:ClassifiedTaxCategory/xs:decimal(cbc:Percent) =$rate]/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='M'][cac:TaxCategory/xs:decimal(cbc:Percent) = $rate]/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='M'][cac:TaxCategory/xs:decimal(cbc:Percent) = $rate]/xs:decimal(cbc:Amount)))))))

BR-AG-08 is a fatal rule in the business layer of Peppol BIS Billing 3.0.21 · UBL. An invoice that breaks it is rejected. It refers to BT-119, BT-118, BT-116, BG-23, BT-131, BT-99, BT-92, BT-151, BT-102, BT-95, BT-152, BT-103, BT-96.

What this rule requires

Rule BR-AG-08 requires that for each VAT rate in a VAT breakdown (BG-23) with VAT category code M (the message text says “IPSI”, but both syntax tests use the literal code M), the taxable amount equals the sum of line net amounts with that code and rate plus document-level charges minus document-level allowances with that code and rate. In UBL, the test permits a tolerance of ±1 currency unit around that sum; in CII, the comparison is exact after rounding each component sum to two decimals. A fatal error means the document does not satisfy validation if the taxable amount is outside tolerance (UBL) or not equal after rounding (CII).

How to fix

Check the taxable amount cac:TaxSubtotal/cbc:TaxableAmount (UBL) or ram:BasisAmount (CII) for the M VAT category at each rate. For UBL, set it to the sum of cbc:LineExtensionAmount from invoice lines (or cbc:LineExtensionAmount from credit note lines if cac:CreditNoteLine is present) where the line's cac:Item/cac:ClassifiedTaxCategory/cbc:ID is M and cbc:Percent equals the rate, plus document-level cac:AllowanceCharge/cbc:Amount with cbc:ChargeIndicator=true() and the same category code/rate, minus document-level allowances (cbc:ChargeIndicator=false()). For CII, set ram:BasisAmount to the sum of ram:LineTotalAmount from lines whose ram:ApplicableTradeTax/ram:CategoryCode is M and ram:RateApplicablePercent equals the rate, plus header ram:SpecifiedTradeAllowanceCharge/ram:ActualAmount with ram:ChargeIndicator/udt:Indicator=true() and same category/rate, minus those with false, rounding each sum to two decimals. In UBL, the amount may be within 1 of this calculation; in CII it must be exactly equal after rounding.

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

Validate an invoice against these rules · All release changes