View Source VatchexGreece.Validate (VatchexGreece v0.6.0)

Module with functions used to validate Greek VAT IDs.

Link to this section Summary

Functions

Check that the passed VAT ID contains the correct checksum digit.

Unsafe check that the passed VAT ID contains the correct checksum digit.

Check that the passed VAT ID only contains digits.

Unsafe check that the passed VAT ID only contains digits.

Check that the passed VAT ID has the proper length.

Unsafe check that the passed VAT ID has the proper length.

Boolean check that the passed VAT ID contains the correct checksum digit.

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).

Boolean check that the passed VAT ID only contains digits.

Boolean check that the passed VAT ID has the proper length.

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.

Link to this section Functions

Link to this function

check_correct_checksum(vat_id)

View Source

Check that the passed VAT ID contains the correct checksum digit.

Link to this function

check_correct_checksum!(vat_id)

View Source

Unsafe check that the passed VAT ID contains the correct checksum digit.

Link to this function

check_only_digits(vat_id)

View Source

Check that the passed VAT ID only contains digits.

Link to this function

check_only_digits!(vat_id)

View Source

Unsafe check that the passed VAT ID only contains digits.

Link to this function

check_proper_length(vat_id)

View Source

Check that the passed VAT ID has the proper length.

Link to this function

check_proper_length!(vat_id)

View Source

Unsafe check that the passed VAT ID has the proper length.

Link to this function

correct_checksum?(vat_id)

View Source

Boolean check that the passed VAT ID contains the correct checksum digit.

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).

Boolean check that the passed VAT ID only contains digits.

Boolean check that the passed VAT ID has the proper length.

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.