VRBL-INV-AU-1p0-53

Basic Info

Rule The Invoice Line Extension 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:InvoiceLine
Pattern vrbl-invoice-au-1p0
Severity fatal

Used Template: VRBL-NumberFormat

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

Implementation

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