VRBL-INV-PL-B2B-3-34

Basic Info

Rule The Tax Exchange Rate Calculation Rate must have a maximum of 16 digits before the decimal separator, and a maximum of 6 digits after the decimal separator.
Context /ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate
Pattern vrbl-invoice-pl-b2b-3p0
Severity fatal

Used Template: VRBL-NumberFormat

Parameter Value
probe = .
maxDigitsBeforeDecimalSeparator = 16
maxDigitsAfterDecimalSeparator = 6

Implementation

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