VRBL-INV-AU-1p0-79

Basic Info

Rule The value of the Invoice Type Code must be contained in Invoice Type Code [VRBL-CL-AU-InvoiceTypeCode]. Allowed values: 261, 380, 381, 389.
Context /ubl:Invoice
Pattern vrbl-invoice-au-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = cbc:InvoiceTypeCode
codeList = $VRBL-CL-AU-InvoiceTypeCode
showValues = true

Implementation

not(boolean(cbc:InvoiceTypeCode))
or
(
	(
		not(
			contains(
				normalize-space(cbc:InvoiceTypeCode),
				substring($VRBL-CL-AU-InvoiceTypeCode, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-AU-InvoiceTypeCode,
			concat(
				substring($VRBL-CL-AU-InvoiceTypeCode, 1, 1),
				normalize-space(cbc:InvoiceTypeCode),
				substring($VRBL-CL-AU-InvoiceTypeCode, 1, 1)
			)
		)
	)
)