VRBL-STM-MX-1p0-16

Basic Info

Rule The Statement Seller Tax Company ID must be a valid RFC. For a Legal Entity, 12 characters are expected (3 Letters, 6 Digits, 3 Alphanumeric). For a Natural Person, 13 characters are expected (4 Letters, 6 Digits, 3 Alphanumeric).
Context /ubl:Statement/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID
Pattern vrbl-payments-mx-1p0
Severity fatal

Used Template: VRBL-MX-IsRFC

Parameter Value
probe = .

Implementation

(
	string-length(.) = 12 
	and 
	translate(substring(., 1, 3), $AlphabetUpperCase, '') = '' 
	and 
	translate(substring(., 4, 6), $Numerics, '') = '' 
	and 
	translate(substring(., 10, 3), $AlphaNumerics, '') = ''
) 
	or 
(
	string-length(.) = 13 
	and 
	translate(substring(., 1, 4), $AlphabetUpperCase, '') = '' 
	and 
	translate(substring(., 5, 6), $Numerics, '') = '' 
	and 
	translate(substring(., 11, 3), $AlphaNumerics, '') = ''
)