View Source VatchexGreece.Validate (VatchexGreece v0.8.0)

Module with functions used to validate Greek VAT IDs.

Link to this section Summary

Functions

Check whether both VAT IDs passed (as strings) are valid. If not, log the corresponding error in the results struct.

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

all_valid(input)

View Source (since 0.7.0)

Check whether both VAT IDs passed (as strings) are valid. If not, log the corresponding error in the results struct.

Link to this function

check_correct_checksum(vat_id)

View Source (since 0.5.0)

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

Link to this function

check_correct_checksum!(vat_id)

View Source (since 0.5.0)

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

Link to this function

check_only_digits(vat_id)

View Source (since 0.5.0)

Check that the passed VAT ID only contains digits.

Link to this function

check_only_digits!(vat_id)

View Source (since 0.5.0)

Unsafe check that the passed VAT ID only contains digits.

Link to this function

check_proper_length(vat_id)

View Source (since 0.5.0)

Check that the passed VAT ID has the proper length.

Link to this function

check_proper_length!(vat_id)

View Source (since 0.5.0)

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

Link to this function

correct_checksum?(vat_id)

View Source (since 0.5.0)

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

Link to this function

minimize(vat_id)

View Source (since 0.5.0)

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 function

only_digits?(vat_id)

View Source (since 0.5.0)

Boolean check that the passed VAT ID only contains digits.

Link to this function

proper_length?(vat_id)

View Source (since 0.5.0)

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

Link to this function

valid?(vat_id)

View Source (since 0.5.0)

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.