VRBL-INV-AE-1p0-67

Basic Info

Rule When Delivery Location Country Identification Code is 'AE',the value of the Delivery Location Country Subentity must be contained in UAE Country subentity codes [VRBL-CL-AE-Subentity] (prefixed by 'VRBL:AE:') or be contained in UAE Country subentity codes [VRBL-CL-AE-Subentity] or be contained in UAE Country subentity codes [VRBL-CL-AE-Subentity]. Allowed values: VRBL:AE:AJM, VRBL:AE:AUH, VRBL:AE:DXB, VRBL:AE:FUJ, VRBL:AE:RAK, VRBL:AE:SHJ, VRBL:AE:UAQ or AJM, AUH, DXB, FUJ, RAK, SHJ, UAQ or AJM, AUH, DXB, FUJ, RAK, SHJ, UAQ.
Context /ubl:Invoice/cac:Delivery/cac:DeliveryLocation/cac:Address
Pattern vrbl-invoice-AE-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = cbc:CountrySubentity
codeList = $VRBL-AE-Prefix:$VRBL-CL-AE-Subentity or $VRBL-CL-AE-Subentity or $VRBL-CL-AE-Subentity
showValues = true

Implementation

(
	not(cac:Country/cbc:IdentificationCode = 'AE')
)
or
(
	not(boolean(cbc:CountrySubentity))
	or
	(
		(
			substring(normalize-space(cbc:CountrySubentity), 1, string-length($VRBL-AE-Prefix)) = $VRBL-AE-Prefix
			and
			not(
				contains(
					substring-after(normalize-space(cbc:CountrySubentity), $VRBL-AE-Prefix),
					substring($VRBL-CL-AE-Subentity, 1, 1)
				)
			)
			and
			contains(
				$VRBL-CL-AE-Subentity,
				concat(
					substring($VRBL-CL-AE-Subentity, 1, 1),
					substring-after(normalize-space(cbc:CountrySubentity), $VRBL-AE-Prefix),
					substring($VRBL-CL-AE-Subentity, 1, 1)
				)
			)
		)
	)
	or
	(
		(
			not(
				contains(
					normalize-space(cbc:CountrySubentity),
					substring($VRBL-CL-AE-Subentity, 1, 1)
				)
			)
			and
			contains(
				$VRBL-CL-AE-Subentity,
				concat(
					substring($VRBL-CL-AE-Subentity, 1, 1),
					normalize-space(cbc:CountrySubentity),
					substring($VRBL-CL-AE-Subentity, 1, 1)
				)
			)
		)
	)
	or
	(
		(
			not(
				contains(
					normalize-space(cbc:CountrySubentity),
					substring($VRBL-CL-AE-Subentity, 1, 1)
				)
			)
			and
			contains(
				$VRBL-CL-AE-Subentity,
				concat(
					substring($VRBL-CL-AE-Subentity, 1, 1),
					normalize-space(cbc:CountrySubentity),
					substring($VRBL-CL-AE-Subentity, 1, 1)
				)
			)
		)
	)
)