diff --git a/readme.md b/readme.md index 8b34828919..a297ca0602 100644 --- a/readme.md +++ b/readme.md @@ -1072,6 +1072,15 @@ echo $faker->siren; // 082 250 104 echo $faker->siret; // 347 355 708 00224 ``` +### `Faker\Provider\fr_FR\Payment` + +```php +vat; // FR 12 123 456 789 +``` + ### `Faker\Provider\fr_FR\Person` ```php diff --git a/src/Faker/Provider/fr_FR/Payment.php b/src/Faker/Provider/fr_FR/Payment.php index 5316876a0a..5d5ff895e1 100644 --- a/src/Faker/Provider/fr_FR/Payment.php +++ b/src/Faker/Provider/fr_FR/Payment.php @@ -4,6 +4,26 @@ class Payment extends \Faker\Provider\Payment { + /** + * Value Added Tax (VAT) + * + * @example 'FR12123456789', ('spaced') 'FR 12 123 456 789' + * + * @see http://ec.europa.eu/taxation_customs/vies/faq.html?locale=en#item_11 + * @see http://www.iecomputersystems.com/ordering/eu_vat_numbers.htm + * @see http://en.wikipedia.org/wiki/VAT_identification_number + * + * @param bool $spacedNationalPrefix + * + * @return string VAT Number + */ + public function vat($spacedNationalPrefix = true) + { + $prefix = ($spacedNationalPrefix) ? "FR " : "FR"; + + return sprintf("%s%s%s%s", $prefix, self::randomNumber(2, true), $this->siren($spacedNationalPrefix)); + } + /** * International Bank Account Number (IBAN) * @link http://en.wikipedia.org/wiki/International_Bank_Account_Number