VRBL-INV-AT-B2G-UBL-1p0-3

Basic Info

Rule The value of the Buyer Party Identification Scheme ID must be contained in ISO 6523 ICD [VRBL-CL-ISO-6523-ICD] or be contained in SEPA code [VRBL-CL-SEPA] or be contained in Party Identification Scheme ID (Austria extension) [VRBL-CL-AT-PartyIdentificationSchemeID-Extension] (prefixed by 'VRBL:AT:').
Context /ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID
Pattern vrbl-invoice-at-b2g-ubl-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = @schemeID
codeList = $VRBL-CL-ISO-6523-ICD or $VRBL-CL-SEPA or $VRBL-AT-Prefix:$VRBL-CL-AT-PartyIdentificationSchemeID-Extension

Implementation

not(boolean(@schemeID))
or
(
	(
		not(
			contains(
				normalize-space(@schemeID),
				substring($VRBL-CL-ISO-6523-ICD, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-ISO-6523-ICD,
			concat(
				substring($VRBL-CL-ISO-6523-ICD, 1, 1),
				normalize-space(@schemeID),
				substring($VRBL-CL-ISO-6523-ICD, 1, 1)
			)
		)
	)
)
or
(
	(
		not(
			contains(
				normalize-space(@schemeID),
				substring($VRBL-CL-SEPA, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-SEPA,
			concat(
				substring($VRBL-CL-SEPA, 1, 1),
				normalize-space(@schemeID),
				substring($VRBL-CL-SEPA, 1, 1)
			)
		)
	)
)
or
(
	(
		substring(normalize-space(@schemeID), 1, string-length($VRBL-AT-Prefix)) = $VRBL-AT-Prefix
		and
		not(
			contains(
				substring-after(normalize-space(@schemeID), $VRBL-AT-Prefix),
				substring($VRBL-CL-AT-PartyIdentificationSchemeID-Extension, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-AT-PartyIdentificationSchemeID-Extension,
			concat(
				substring($VRBL-CL-AT-PartyIdentificationSchemeID-Extension, 1, 1),
				substring-after(normalize-space(@schemeID), $VRBL-AT-Prefix),
				substring($VRBL-CL-AT-PartyIdentificationSchemeID-Extension, 1, 1)
			)
		)
	)
)