VRBL-INV-MX-1p0-125

Basic Info

Rule The value of the Invoiced Quantity Unit of Measure Code must be contained in Unit Code [VRBL-CL-MX-UnitCode].
Context /ubl:Invoice/cac:InvoiceLine/cbc:InvoicedQuantity
Pattern vrbl-invoice-mx-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = @unitCode
codeList = $VRBL-CL-MX-UnitCode
showValues = false

Implementation

not(boolean(@unitCode))
or
(
	(
		not(
			contains(
				normalize-space(@unitCode),
				substring($VRBL-CL-MX-UnitCode, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-MX-UnitCode,
			concat(
				substring($VRBL-CL-MX-UnitCode, 1, 1),
				normalize-space(@unitCode),
				substring($VRBL-CL-MX-UnitCode, 1, 1)
			)
		)
	)
)