Created
July 18, 2020 22:34
-
-
Save thb/2df8d2ee2252cc35adcde5090c64e183 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# frozen_string_literal: true | |
# prendre les 9 premiers chiffres, exception si plus ou moins que 9 chiffres | |
SIREN = ARGV[0] | |
# calculer la clé | |
key = (12 + 3 * (SIREN.to_i % 97)) % 97 | |
# concaténer et prévixer de "FR" pour la france | |
tva = "FR#{key}#{SIREN}" | |
puts tva |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment