Method EinvoiceParty():hasValidVatIdFor() Professional

Checks whether the VAT identification number is valid for a country.

Syntax
:hasValidVatIdFor( <cCountry> ) --> lValid
Parameters
<cCountry>
The ISO 3166-1 alpha-2 code of the country to test.
Return

.T. (true) if the VAT identification number is syntactically valid and belongs to the given country, .F. (false) otherwise.

Description

Checks whether the VAT identification number of the party is syntactically valid and whether its prefix matches the VAT prefix of the given country. The syntax check is performed by EinvCheckVatId(). It verifies the general structure and, for a number of known countries, the national format. No checksum test and no online lookup are performed.

The expected prefix is determined via EinvVatPrefixFor(), which maps the country code "GR" to the VAT prefix "EL".

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.