VRBL-INV-RO-1p0-54

Basic Info

Rule If the Seller Country Identification Code is RO, the Seller Country Subentity is RO-B (corresponding to Bucharest Municipality) and the Seller City Subdivision Name is provided, the value of the Seller City Subdivision Name must be contained in SECTOR Code [VRBL-CL-RO-SECTOR-CODE] (prefixed by 'VRBL:RO:'). Allowed values: VRBL:RO:SECTOR1, VRBL:RO:SECTOR2, VRBL:RO:SECTOR3, VRBL:RO:SECTOR4, VRBL:RO:SECTOR5, VRBL:RO:SECTOR6.
Context /ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName
Pattern vrbl-invoice-ro-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = .
codeList = $VRBL-RO-Prefix:$VRBL-CL-RO-SECTOR-CODE
showValues = true

Implementation

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