F-LIB404
The values in cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID on lines, total, and on cac:AllowanceCharge/cac:TaxCategory/cbc:ID must correspond. Values found - cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID: … - (cac:InvoiceLine | cac:CreditNoteLine)/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID: … - cac:AllowanceCharge/cac:TaxCategory/cbc:ID: …
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.
not( ( (/*/(cac:InvoiceLine | cac:CreditNoteLine)/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID | /*/cac:AllowanceCharge/cac:TaxCategory/cbc:ID) [.=('B','M','L','K','O','G','ZeroRated','StandardRated','ReverseCharge')] [not(. = /*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID [.=('B','M','L','K','O','G','ZeroRated','StandardRated','ReverseCharge')])] ) | ( /*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID [.=('B','M','L','K','O','G','ZeroRated','StandardRated','ReverseCharge')] [not(. = (/*/(cac:InvoiceLine | cac:CreditNoteLine)/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID | /*/cac:AllowanceCharge/cac:TaxCategory/cbc:ID) [.=('B','M','L','K','O','G','ZeroRated','StandardRated','ReverseCharge')])] ) )
Checked with Denmark OIOUBL 2.1 Invoice