VatTerritory
in package
The EU VAT territory (Art. 5 to 7 of Directive 2006/112/EC) as far as it can be told from a country code and a postcode.
- The 27 member states with their ISO 3166-1 codes (Greece is "GR"; "EL" is only the VAT prefix).
- Northern Ireland belongs to it for goods only (Windsor Framework). It is recognised by the code "XI" and by United Kingdom addresses with a "BT" postcode.
- Monaco is treated as France and the Isle of Man as the United Kingdom (Art. 7).
- Territories excluded by Art. 6 are recognised by their postcode where it identifies them reliably: Büsingen am Hochrhein and Heligoland (DE, also not part of the German Inland under section 1 (2) UStG), the Canary Islands, Ceuta and Melilla (ES), Livigno and Campione d'Italia (IT), the Åland Islands (FI), Mount Athos (GR) and the French overseas territories (FR 97…, 98… except Monaco 980…). Excluded territories with own country codes (e.g. FO, GL, AX, IC) are outside anyway. Territories without a distinct postcode (e.g. the part of Cyprus not controlled by the government, the Italian waters of Lake Lugano) cannot be detected.
Table of Contents
Constants
- EU_MEMBER_STATES : array<string|int, mixed> = ['AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE'...
- NORTHERN_IRELAND : string = 'XI'
- Northern Ireland: part of the EU VAT area for goods (Windsor Framework).
Methods
- excludedTerritory() : string|null
- Name of the territory excluded from the EU VAT territory that the address lies in, or null.
- isEuMemberState() : bool
- isEuVatTerritory() : bool
- Whether an address lies in the EU VAT territory.
- isNorthernIreland() : bool
- Northern Ireland: the code "XI" or a United Kingdom address with a "BT" postcode.
- memberState() : string|null
- The member state (or "XI" for Northern Ireland and goods) of an address in the EU VAT territory, null outside of it.
- memberStateOfVatId() : string|null
- The member state of a VAT identifier prefix (EL → GR, XI stays XI), or null if the prefix does not belong to the EU VAT area.
- sameVatTerritory() : bool
- Whether two addresses lie in the same VAT territory (the same country and both inside or both outside its excluded territories), e.g. FR and MC, but not DE and Büsingen.
- vatCountry() : string
- The country whose VAT territory the given country belongs to (MC → FR, IM → GB, EL → GR).
Constants
EU_MEMBER_STATES
public
array<string|int, mixed>
EU_MEMBER_STATES
= ['AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GR', 'HR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK']
NORTHERN_IRELAND
Northern Ireland: part of the EU VAT area for goods (Windsor Framework).
public
string
NORTHERN_IRELAND
= 'XI'
Methods
excludedTerritory()
Name of the territory excluded from the EU VAT territory that the address lies in, or null.
public
static excludedTerritory(string $country, string|null $postcode) : string|null
Parameters
- $country : string
- $postcode : string|null
Return values
string|nullisEuMemberState()
public
static isEuMemberState(string $country) : bool
Parameters
- $country : string
Return values
boolisEuVatTerritory()
Whether an address lies in the EU VAT territory.
public
static isEuVatTerritory(string $country[, string|null $postcode = null ][, bool $goods = true ]) : bool
Parameters
- $country : string
- $postcode : string|null = null
- $goods : bool = true
-
Northern Ireland counts for supplies of goods only
Return values
boolisNorthernIreland()
Northern Ireland: the code "XI" or a United Kingdom address with a "BT" postcode.
public
static isNorthernIreland(string $country[, string|null $postcode = null ]) : bool
Parameters
- $country : string
- $postcode : string|null = null
Return values
boolmemberState()
The member state (or "XI" for Northern Ireland and goods) of an address in the EU VAT territory, null outside of it.
public
static memberState(string $country[, string|null $postcode = null ][, bool $goods = true ]) : string|null
Parameters
- $country : string
- $postcode : string|null = null
- $goods : bool = true
Return values
string|nullmemberStateOfVatId()
The member state of a VAT identifier prefix (EL → GR, XI stays XI), or null if the prefix does not belong to the EU VAT area.
public
static memberStateOfVatId(string $vatId) : string|null
Parameters
- $vatId : string
Return values
string|nullsameVatTerritory()
Whether two addresses lie in the same VAT territory (the same country and both inside or both outside its excluded territories), e.g. FR and MC, but not DE and Büsingen.
public
static sameVatTerritory(string $country, string|null $postcode, string $otherCountry, string|null $otherPostcode) : bool
Parameters
- $country : string
- $postcode : string|null
- $otherCountry : string
- $otherPostcode : string|null
Return values
boolvatCountry()
The country whose VAT territory the given country belongs to (MC → FR, IM → GB, EL → GR).
public
static vatCountry(string $country) : string
Parameters
- $country : string