fatalEN 16931EN 16931 business ruleCIIUBLBG-23BT-119
Each VAT breakdown (BG-23) shall have a VAT category rate (BT-119), except if the Invoice is not subject to VAT.
A VAT breakdown group (BG-23) has no VAT category rate (BT-119).
Add BT-119 (UBL cac:TaxCategory/cbc:Percent) as a percentage number: 22, not 0.22. Groups at zero VAT still need it, written as 0. The only exception is category O (not subject to VAT), where the rate must be absent entirely.
CII — context $VAT_breakdown
(.[upper-case(ram:TypeCode) = 'VAT']/ram:RateApplicablePercent) or (.[upper-case(ram:TypeCode) = 'VAT']/ram:CategoryCode = 'O')
UBL — context $VAT_breakdown
exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:Percent) or (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/normalize-space(cbc:ID)='O')