VRBL-INV-IT-1p2-181

Basic Info

Rule For Social Security Charges, the Charge Tax Exemption Reason Code must be in line with the Charge Tax ID.
Context /ubl:Invoice/cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'true']/cac:TaxCategory/cbc:TaxExemptionReasonCode
Pattern vrbl-invoice-it-1p2
Severity fatal

Implementation

not(
	../../cbc:AllowanceChargeReasonCode = concat($VRBL-IT-Prefix, 'ZZZ')
)
or
(
	not(contains($VRBL-IT-table-TaxExemptionReasonCode, concat(' ', substring-after(normalize-space(.), $VRBL-IT-Prefix),'#')))
	or
	contains($VRBL-IT-table-TaxExemptionReasonCode, concat(' ', substring-after(normalize-space(.), $VRBL-IT-Prefix), '#', normalize-space(../cbc:ID), ' '))
)