VRBL-INV-PL-B2B-3-71

Basic Info

Rule The value of the Invoice Line Commodity Classification Code List ID must be contained in UNCL7143 item type identification [VRBL-CL-ItemNumberTypeCode] or be contained in PL Item Number Type Code Extension [VRBL-CL-PL-ItemNumberTypeCode-Extension] (prefixed by 'VRBL:PL:'). For more information visit: https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL7143/
Context /ubl:Invoice/cac:InvoiceLine/cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode
Pattern vrbl-invoice-pl-b2b-3p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = @listID
codeList = $VRBL-CL-ItemNumberTypeCode or $VRBL-PL-Prefix:$VRBL-CL-PL-ItemNumberTypeCode-Extension

Implementation

not(boolean(@listID))
or
(
	(
		not(
			contains(
				normalize-space(@listID),
				substring($VRBL-CL-ItemNumberTypeCode, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-ItemNumberTypeCode,
			concat(
				substring($VRBL-CL-ItemNumberTypeCode, 1, 1),
				normalize-space(@listID),
				substring($VRBL-CL-ItemNumberTypeCode, 1, 1)
			)
		)
	)
)
or
(
	(
		substring(normalize-space(@listID), 1, string-length($VRBL-PL-Prefix)) = $VRBL-PL-Prefix
		and
		not(
			contains(
				substring-after(normalize-space(@listID), $VRBL-PL-Prefix),
				substring($VRBL-CL-PL-ItemNumberTypeCode-Extension, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-PL-ItemNumberTypeCode-Extension,
			concat(
				substring($VRBL-CL-PL-ItemNumberTypeCode-Extension, 1, 1),
				substring-after(normalize-space(@listID), $VRBL-PL-Prefix),
				substring($VRBL-CL-PL-ItemNumberTypeCode-Extension, 1, 1)
			)
		)
	)
)