BR-CO-04
Each Invoice line (BG-25) shall be categorized with an Invoiced item VAT category code (BT-151).
Why it fails
- A line's item has no VAT category:
cac:Item/cac:ClassifiedTaxCategorywith acbc:IDand the tax schemeVATis missing (ram:ApplicableTradeTax/ram:CategoryCodein CII).
How to fix it
Give every line its VAT category code (S standard, Z zero rated, E exempt, AE reverse charge, K intra-community, G export, O not subject to VAT) and, except for O, its rate.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
cac:InvoiceLine | cac:CreditNoteLine
(cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/(normalize-space(upper-case(cbc:ID))='VAT')]/cbc:ID)
Checked with EN 16931 Invoice (UBL), EN 16931 Credit Note (UBL), Croatia eRačun Invoice (UBL), Croatia eRačun Credit Note (UBL)
//ram:IncludedSupplyChainTradeLineItem
(ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[upper-case(ram:TypeCode) = 'VAT']/ram:CategoryCode)
Checked with EN 16931 Invoice (CII)