VRBL-INV-AU-1p0-55

Basic Info

Rule The Invoice Line Price Allowance Charge 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 = cac:Price/cac:AllowanceCharge/cbc:Amount
maxDigitsBeforeDecimalSeparator = 13
maxDigitsAfterDecimalSeparator = 2

Implementation

(
	13
	>=
	string-length(
		substring-before(
			concat(
				cac:Price/cac:AllowanceCharge/cbc:Amount,
				substring(
					'.',
					number(not(contains(cac:Price/cac:AllowanceCharge/cbc:Amount, '.'))),
					1
				)
			),
			'.'
		)
	)
)
and
(
	2
	>=
	string-length(
		substring-after(
			concat(
				cac:Price/cac:AllowanceCharge/cbc:Amount,
				substring(
					'.',
					number(not(contains(cac:Price/cac:AllowanceCharge/cbc:Amount, '.'))),
					1
				)
			),
			'.'
		)
	)
)