VRBL-INV-PT-2p1-164

Basic Info

Rule The Allowance Charge Tax Percent must have a maximum of 3 digits before the decimal separator, and a maximum of 2 digits after the decimal separator.
Context /ubl:Invoice/cac:AllowanceCharge/cac:TaxCategory/cbc:Percent
Pattern vrbl-invoice-pt-2p1
Severity fatal

Used Template: VRBL-NumberFormat

Parameter Value
probe = .
maxDigitsBeforeDecimalSeparator = 3
maxDigitsAfterDecimalSeparator = 2

Implementation

(
	3
	>=
	string-length(
		substring-before(
			concat(
				.,
				substring(
					'.',
					number(not(contains(., '.'))),
					1
				)
			),
			'.'
		)
	)
)
and
(
	2
	>=
	string-length(
		substring-after(
			concat(
				.,
				substring(
					'.',
					number(not(contains(., '.'))),
					1
				)
			),
			'.'
		)
	)
)