View Source VatchexGreece.Validate (VatchexGreece v0.5.1)

Module with functions used to validate Greek VAT IDs.

Link to this section Summary

Functions

Check whether the VAT ID passed (as string) is valid, i.e. it has the correct length (9 total, and only digits), where the last digit is equal to the checksum calculate from the first 8 digits.

Remove the "EL" or "GR" prefixes if present, remove any whitespace (leading, trailing, or internal), and return the VAT ID's minimal valid representation, including adding a leading "0" in case the provided ID had 8 digits (old format).

Link to this section Functions

Check whether the VAT ID passed (as string) is valid, i.e. it has the correct length (9 total, and only digits), where the last digit is equal to the checksum calculate from the first 8 digits.

Remove the "EL" or "GR" prefixes if present, remove any whitespace (leading, trailing, or internal), and return the VAT ID's minimal valid representation, including adding a leading "0" in case the provided ID had 8 digits (old format).