VRBL-INV-DK-1p0-27

Basic Info

Rule If the Allowance Charge Reason Code is marked 'ZZZ' for non VAT-taxes, Allowance Charge Reason is only allowed to be 0 to 9999, padded to 4 digits.
Context /ubl:Invoice/cac:AllowanceCharge
Pattern vrbl-invoice-dk-1p0
Severity fatal

Implementation

not($DKSupplierCountry = 'DK')
or
not(normalize-space(cbc:AllowanceChargeReasonCode) = 'ZZZ')
or
(
	string-length(normalize-space(cbc:AllowanceChargeReason)) = 4
	and
	number(cbc:AllowanceChargeReason) <= 9999
	and
	number(cbc:AllowanceChargeReason) >= 0
)