VRBL-INV-PH-1p0-10

Basic Info

Rule The value of the Correction Method must be contained in Correction Method Code List [VRBL-CL-PH-CorrectionMethod] (prefixed by 'VRBL:PH:').
Context /ubl:Invoice/cec:UBLExtensions/cec:UBLExtension/cec:ExtensionContent/vrbl:InvoiceExtension/vrbl:CorrectionData
Pattern vrbl-invoice-ph-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = vrbl:CorrectionMethod
codeList = $VRBL-PH-Prefix:$VRBL-CL-PH-CorrectionMethod

Implementation

not(boolean(vrbl:CorrectionMethod))
or
(
	(
		substring(normalize-space(vrbl:CorrectionMethod), 1, string-length($VRBL-PH-Prefix)) = $VRBL-PH-Prefix
		and
		not(
			contains(
				substring-after(normalize-space(vrbl:CorrectionMethod), $VRBL-PH-Prefix),
				substring($VRBL-CL-PH-CorrectionMethod, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-PH-CorrectionMethod,
			concat(
				substring($VRBL-CL-PH-CorrectionMethod, 1, 1),
				substring-after(normalize-space(vrbl:CorrectionMethod), $VRBL-PH-Prefix),
				substring($VRBL-CL-PH-CorrectionMethod, 1, 1)
			)
		)
	)
)