VRBL-INV-AU-1p0-76

Basic Info

Rule An Invoice that contains a Tax Subtotal where the Tax Category ID is "O", must not contain Allowance Group where Allowance Tax ID is not "O".
Context /ubl:Invoice/cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'false']
Pattern vrbl-invoice-au-1p0
Severity fatal

Implementation

(
	boolean(/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST' and cbc:ID = 'O'])
	and
	count(cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST' and cbc:ID != 'O']) = 0
)
or
not(boolean(/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST' and cbc:ID = 'O']))