VRBL-INV-BE-1p0-2

Basic Info

Rule If the Seller ID is marked as a Belgian Enterprise Number, it must be 10 digits, with the last 2 digits being the check-digits for the previous 8 digits.
Context /ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID
Pattern vrbl-invoice-be-1p0
Severity fatal

Used Template: VRBL-BE-schemeID-0208

Implementation

not(@schemeID = '0208')
or
(
	string-length(translate(normalize-space(.), $Numerics, '')) = 0
	and
	string-length(normalize-space(.)) = 10
	and
	format-number(97 - (number(substring(normalize-space(.), 1, 8)) mod 97), '00') = substring(normalize-space(.), 9, 2)
)