VRBL-INV-AE-1p0-142

Basic Info

Rule The value of the Invoice Type Code must be contained in UNTDID 1001 [VRBL-CL-PINT-UNTDID-1001] or be contained in UNTDID 1001+480 [VRBL-CL-AE-InvoiceTypeCode].
Context /ubl:Invoice
Pattern vrbl-invoice-AE-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = cbc:InvoiceTypeCode
codeList = $VRBL-CL-PINT-UNTDID-1001 or $VRBL-CL-AE-InvoiceTypeCode
showValues = false

Implementation

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