VRBL-INV-AU-1p0-75

Basic Info

Rule An Invoice that contains a Tax Subtotal where the Tax Category ID is "O", must not contain other Invoice Line Group where Invoice Line Tax Group is not "O".
Context /ubl:Invoice/cac:InvoiceLine
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:Item/cac:ClassifiedTaxCategory[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']))