VRBL-INV-AU-1p0-49

Basic Info

Rule The Legal Monetary Total Prepaid Amount must have a maximum of 13 digits before the decimal separator, and a maximum of 2 digits after the decimal separator.
Context /ubl:Invoice/cac:LegalMonetaryTotal
Pattern vrbl-invoice-au-1p0
Severity fatal

Used Template: VRBL-NumberFormat

Parameter Value
probe = cbc:PrepaidAmount
maxDigitsBeforeDecimalSeparator = 13
maxDigitsAfterDecimalSeparator = 2

Implementation

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