Skip to content

Commit

Permalink
💄 format code
Browse files Browse the repository at this point in the history
  • Loading branch information
fcurella committed May 13, 2024
1 parent 64ce2c6 commit 0479fbd
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions faker/providers/ssn/nl_BE/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,18 @@ def _checksum(digits):
vat_id_formats = ("BE##########",)

def vat_id(self) -> str:
vat_id_random_section = "#######"

vat_id_random_section = (
'#######'
)

vat_id_possible_initial_numbers = (
'0',
'1'
)
vat_id_possible_initial_numbers = ("0", "1")
"""
http://ec.europa.eu/taxation_customs/vies/faq.html#item_11
https://en.wikipedia.org/wiki/VAT_identification_number
:return: A random Belgian VAT ID starting with 0 or 1 and has a correct checksum with a modulo 97 check
"""
generated_initial_number = self.random_element(vat_id_possible_initial_numbers)
vat_without_check = self.bothify(generated_initial_number + vat_id_random_section)
generated_initial_number: str = self.random_element(vat_id_possible_initial_numbers)
vat_without_check = self.bothify(f"{generated_initial_number}{vat_id_random_section}")
vat_as_int = int(vat_without_check)
vat_check = 97 - (vat_as_int % 97)
vat_check_str = f"{vat_check:0>2}"

return "BE" + vat_without_check + vat_check_str
return f"BE{vat_without_check}{vat_check_str}"

0 comments on commit 0479fbd

Please sign in to comment.