VRBL-INV-CORE-556

Basic Info

Rule Each Allowance Group must have a Invoice Tax Subtotal Group corresponding to its Allowance Tax ID and Allowance Tax Percent.
Context /ubl:Invoice/cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'false']
Pattern vrbl-invoice-core
Severity fatal

Implementation

not(
	boolean(cac:TaxCategory/cbc:ID)
	and
	boolean(cac:TaxCategory/cbc:Percent)
)
or
boolean(/ubl:Invoice/cac:TaxTotal[cbc:TaxAmount/@currencyID = ../cbc:DocumentCurrencyCode]/cac:TaxSubtotal[current()/cac:TaxCategory/cbc:ID = cac:TaxCategory/cbc:ID and number(current()/cac:TaxCategory/cbc:Percent) = number(cac:TaxCategory/cbc:Percent)])