diff --git a/src/Faker/Provider/it_IT/Company.php b/src/Faker/Provider/it_IT/Company.php index f27499a31f..6acb6daa3b 100644 --- a/src/Faker/Provider/it_IT/Company.php +++ b/src/Faker/Provider/it_IT/Company.php @@ -2,6 +2,8 @@ namespace Faker\Provider\it_IT; +use Faker\Calculator\Luhn; + class Company extends \Faker\Provider\Company { protected static $formats = array( @@ -69,6 +71,8 @@ public function bs() */ public static function vatId() { - return static::numerify('IT###########'); + $code = sprintf('%s%03d', static::numerify('#######'), static::numberBetween(1, 121)); + + return sprintf('IT%s%d', $code, Luhn::computeCheckDigit($code)); } }