VRBL-INV-CN-1p0-24

Basic Info

Rule The value of the Seller Party ID Scheme ID must be contained in Party Identification Scheme ID (China) [VRBL-CL-CN-INV-PartyIdentification-SchemeID] (prefixed by 'VRBL:CN:'). Allowed values: VRBL:CN:CODE.
Context /ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID
Pattern vrbl-invoice-cn-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = @schemeID
codeList = $VRBL-CN-Prefix:$VRBL-CL-CN-INV-PartyIdentification-SchemeID
showValues = true

Implementation

not(boolean(@schemeID))
or
(
	(
		substring(normalize-space(@schemeID), 1, string-length($VRBL-CN-Prefix)) = $VRBL-CN-Prefix
		and
		not(
			contains(
				substring-after(normalize-space(@schemeID), $VRBL-CN-Prefix),
				substring($VRBL-CL-CN-INV-PartyIdentification-SchemeID, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-CN-INV-PartyIdentification-SchemeID,
			concat(
				substring($VRBL-CL-CN-INV-PartyIdentification-SchemeID, 1, 1),
				substring-after(normalize-space(@schemeID), $VRBL-CN-Prefix),
				substring($VRBL-CL-CN-INV-PartyIdentification-SchemeID, 1, 1)
			)
		)
	)
)