VRBL-INV-PH-1p0-16

Basic Info

Rule When the Invoice Subtype Code is CAS, the value of the Invoiced Item Tax Category Code must be contained in Tax Category Code List [VRBL-CL-PH-TaxCategory].
Context /ubl:Invoice/cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory
Pattern vrbl-invoice-ph-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = cbc:ID
codeList = $VRBL-CL-PH-TaxCategory

Implementation

(
	not(normalize-space(/ubl:Invoice/cec:UBLExtensions/cec:UBLExtension/cec:ExtensionContent/vrbl:InvoiceExtension/vrbl:InvoiceSubtypeCode) = 'VRBL:PH:CAS')
)
or
(
	not(boolean(cbc:ID))
	or
	(
		(
			not(
				contains(
					normalize-space(cbc:ID),
					substring($VRBL-CL-PH-TaxCategory, 1, 1)
				)
			)
			and
			contains(
				$VRBL-CL-PH-TaxCategory,
				concat(
					substring($VRBL-CL-PH-TaxCategory, 1, 1),
					normalize-space(cbc:ID),
					substring($VRBL-CL-PH-TaxCategory, 1, 1)
				)
			)
		)
	)
)