VRBL-INV-HU-1p0-47

Basic Info

Rule When the Invoice Line Tax ID is 'O', the value of the Invoice Line Tax Exemption Reason Code must be contained in Tax Exemption Reason (O) [VRBL-CL-HU-TaxExemptionReasonCode-O] (prefixed by 'VRBL:HU:'). Allowed values: VRBL:HU:ATK, VRBL:HU:EUE, VRBL:HU:EUFAD37, VRBL:HU:EUFADE, VRBL:HU:HO, VRBL:HU:UNKNOWN.
Context /ubl:Invoice/cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:TaxExemptionReasonCode
Pattern vrbl-invoice-hu-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = .
codeList = $VRBL-HU-Prefix:$VRBL-CL-HU-TaxExemptionReasonCode-O
showValues = true

Implementation

(
	not(../cbc:ID = 'O')
)
or
(
	not(boolean(.))
	or
	(
		(
			substring(normalize-space(.), 1, string-length($VRBL-HU-Prefix)) = $VRBL-HU-Prefix
			and
			not(
				contains(
					substring-after(normalize-space(.), $VRBL-HU-Prefix),
					substring($VRBL-CL-HU-TaxExemptionReasonCode-O, 1, 1)
				)
			)
			and
			contains(
				$VRBL-CL-HU-TaxExemptionReasonCode-O,
				concat(
					substring($VRBL-CL-HU-TaxExemptionReasonCode-O, 1, 1),
					substring-after(normalize-space(.), $VRBL-HU-Prefix),
					substring($VRBL-CL-HU-TaxExemptionReasonCode-O, 1, 1)
				)
			)
		)
	)
)