Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Add VAT french format #1241

Merged
merged 3 commits into from
Aug 7, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/Faker/Provider/fr_FR/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down