Created
January 5, 2018 13:47
-
-
Save jmrenouard/0b85e4b99119bb88e7d3a742ede173f1 to your computer and use it in GitHub Desktop.
Compute TVA NUMBER FROM SIREN NUMBER
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
<?php | |
function getTvaKey($siren) | |
{ | |
return (12+3*(intval($siren) % 97))%97; | |
} | |
function getTvaCode($siren) | |
{ | |
return "FR".getTvaKey($siren).$siren; | |
} | |
$siren=$argv[1]; | |
echo "Cacul Numero TVA:\n"; | |
echo "-----------------\n"; | |
echo "SIREN : ".$siren."\n"; | |
echo "CLE TVA : ".getTvaKey($siren)."\n"; | |
echo "CODE TVA: ".getTvaCode($siren)."\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment