VRBL-INV-PT-2p1-196

Basic Info

Rule The value of the Invoice Line Quantity Unit Code must be contained in UN/ECE Recommendation 20 [VRBL-CL-UnitCode-Rec20]. For more information visit: https://docs.peppol.eu/poacc/billing/3.0/codelist/UNECERec20/
Context /ubl:Invoice/cac:InvoiceLine/cbc:InvoicedQuantity
Pattern vrbl-invoice-pt-2p1
Severity fatal

Used Template: CodeList

Parameter Value
probe = @unitCode
codeList = $VRBL-CL-UnitCode-Rec20

Implementation

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