VRBL-INV-EN16931-CM-359

Basic Info

Rule The value of the Legal Monetary Total Payable Rounding Amount Currency ID must be contained in Alpha-3 currency [VRBL-CL-EN16931-CurrencyCode].
Context /ubl:Invoice/cac:LegalMonetaryTotal/cbc:PayableRoundingAmount
Pattern vrbl-invoice-en16931-codesmodel
Severity fatal

Used Template: CodeList

Parameter Value
probe = @currencyID
codeList = $VRBL-CL-EN16931-CurrencyCode

Implementation

not(boolean(@currencyID))
or
(
	(
		not(
			contains(
				normalize-space(@currencyID),
				substring($VRBL-CL-EN16931-CurrencyCode, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-EN16931-CurrencyCode,
			concat(
				substring($VRBL-CL-EN16931-CurrencyCode, 1, 1),
				normalize-space(@currencyID),
				substring($VRBL-CL-EN16931-CurrencyCode, 1, 1)
			)
		)
	)
)