VRBL-INV-MY-1p0-129

Basic Info

Rule When used for category of products or services, the value of the Invoice Line Commodity Classification Code must be contained in Item Classification Code [VRBL-CL-MY-ItemClassificationCode]. Allowed values: 001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011, 012, 013, 014, 015, 016, 017, 018, 019, 020, 021, 022, 023, 024, 025, 026, 027, 028, 029, 030, 031, 032, 033, 034, 035, 036, 037, 038, 039, 040, 041, 042, 043, 044, 045.
Context /ubl:Invoice/cac:InvoiceLine/cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode
Pattern vrbl-invoice-my-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = .
codeList = $VRBL-CL-MY-ItemClassificationCode
showValues = true

Implementation

(
	not(@listID = concat($VRBL-MY-Prefix, 'CLASS'))
)
or
(
	not(boolean(.))
	or
	(
		(
			not(
				contains(
					normalize-space(.),
					substring($VRBL-CL-MY-ItemClassificationCode, 1, 1)
				)
			)
			and
			contains(
				$VRBL-CL-MY-ItemClassificationCode,
				concat(
					substring($VRBL-CL-MY-ItemClassificationCode, 1, 1),
					normalize-space(.),
					substring($VRBL-CL-MY-ItemClassificationCode, 1, 1)
				)
			)
		)
	)
)