VRBL-INV-AU-1p0-78

Basic Info

Rule An Invoice that contains Allowance Tax ID, Charge Tax ID or Invoice Line Tax ID equal to "Standard" must contain Tax Subtotal with the Tax Subtotal Category ID equal to "Standard".
Context /ubl:Invoice
Pattern vrbl-invoice-au-1p0
Severity fatal

Implementation

(
	(
		boolean(cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'false']/cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST']/cbc:ID = 'S')
		or
		boolean(cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'true']/cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST']/cbc:ID = 'S')
		or
		boolean(cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/cbc:ID = 'GST']/cbc:ID = 'S')
	)
	and
	count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST'][cbc:ID='S']/cbc:ID) >= 1
)
or
(
	not(cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'false']/cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST']/cbc:ID = 'S')
	and
	not(cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'true']/cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST']/cbc:ID = 'S')
	and
	not(cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/cbc:ID = 'GST']/cbc:ID = 'S')
	and
	not(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST']/cbc:ID = 'S')
)