VRBL-INV-ES-B2G-59

Basic Info

Rule When the Buyer Address Group is not Spanish, Buyer Postal Zone + " " + Buyer City Name must not exceed 50 characters because of outbound format constraints.
Context /ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress
Pattern vrbl-invoice-es-b2g
Severity fatal

Implementation

(
	normalize-space(cac:Country/cbc:IdentificationCode) = 'ES'
	or
	not(boolean(cbc:PostalZone))
	or
	not(boolean(cbc:CityName))
)
or
(
	string-length(
		concat(
			normalize-space(cbc:PostalZone),
			' ',
			normalize-space(cbc:CityName)
		)
	)
	<=
	50
)