VRBL-INV-MY-1p0-94

Basic Info

Rule The value of the Payment Means Payment Means Code must be contained in MY Payment Means Code [VRBL-CL-MY-PaymentMeansCode] (prefixed by 'VRBL:MY:') or be contained in MY UNCL 4461 [VRBL-CL-MY-UNCL-4461]. Allowed values: VRBL:MY:01, VRBL:MY:02, VRBL:MY:03, VRBL:MY:04, VRBL:MY:05, VRBL:MY:06, VRBL:MY:07, VRBL:MY:08 or 10, 20, 30, 54, 55, 58, ZZZ.
Context /ubl:Invoice/cac:PaymentMeans/cbc:PaymentMeansCode
Pattern vrbl-invoice-my-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = .
codeList = $VRBL-MY-Prefix:$VRBL-CL-MY-PaymentMeansCode or $VRBL-CL-MY-UNCL-4461
showValues = true

Implementation

not(boolean(.))
or
(
	(
		substring(normalize-space(.), 1, string-length($VRBL-MY-Prefix)) = $VRBL-MY-Prefix
		and
		not(
			contains(
				substring-after(normalize-space(.), $VRBL-MY-Prefix),
				substring($VRBL-CL-MY-PaymentMeansCode, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-MY-PaymentMeansCode,
			concat(
				substring($VRBL-CL-MY-PaymentMeansCode, 1, 1),
				substring-after(normalize-space(.), $VRBL-MY-Prefix),
				substring($VRBL-CL-MY-PaymentMeansCode, 1, 1)
			)
		)
	)
)
or
(
	(
		not(
			contains(
				normalize-space(.),
				substring($VRBL-CL-MY-UNCL-4461, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-MY-UNCL-4461,
			concat(
				substring($VRBL-CL-MY-UNCL-4461, 1, 1),
				normalize-space(.),
				substring($VRBL-CL-MY-UNCL-4461, 1, 1)
			)
		)
	)
)