API reference / Quittio \ Core \ Countries
VatTerritory
final class in quittio/core
Quittio\Core\Countries\VatTerritory · Source
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). Outside the EU, Liechtenstein is treated as Switzerland: both form one area of application of the VAT (treaty of 28 November 1994).
- 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.
Constants#
| Constant | Value | Description |
|---|---|---|
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 | 'XI' | Northern Ireland: part of the EU VAT area for goods (Windsor Framework). |
Methods#
| Method | Description |
|---|---|
::excludedTerritory() | Name of the territory excluded from the EU VAT territory that the address lies in, or null. |
::isEuMemberState() | |
::isEuVatTerritory() | Whether an address lies in the EU VAT territory. |
::isNorthernIreland() | Northern Ireland: the code "XI" or a United Kingdom address with a "BT" postcode. |
::memberState() | The member state (or "XI" for Northern Ireland and goods) of an address in the EU VAT territory, null outside of it. |
::memberStateOfVatId() | 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() | 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() | The country whose VAT territory the given country belongs to (MC → FR, IM → GB, EL → GR, LI → CH). |
excludedTerritory()#
public static function excludedTerritory(string $country, ?string $postcode): ?stringName of the territory excluded from the EU VAT territory that the address lies in, or null.
| Parameter | Type | Description |
|---|---|---|
$country | string | |
$postcode | ?string |
- Returns
?string
isEuMemberState()#
public static function isEuMemberState(string $country): bool| Parameter | Type | Description |
|---|---|---|
$country | string |
- Returns
bool
isEuVatTerritory()#
public static function isEuVatTerritory(
string $country,
?string $postcode = null,
bool $goods = true,
): boolWhether an address lies in the EU VAT territory.
| Parameter | Type | Description |
|---|---|---|
$country | string | |
$postcode | ?string = null | |
$goods | bool = true | Northern Ireland counts for supplies of goods only |
- Returns
bool
isNorthernIreland()#
public static function isNorthernIreland(string $country, ?string $postcode = null): boolNorthern Ireland: the code "XI" or a United Kingdom address with a "BT" postcode.
| Parameter | Type | Description |
|---|---|---|
$country | string | |
$postcode | ?string = null |
- Returns
bool
memberState()#
public static function memberState(
string $country,
?string $postcode = null,
bool $goods = true,
): ?stringThe member state (or "XI" for Northern Ireland and goods) of an address in the EU VAT territory, null outside of it.
| Parameter | Type | Description |
|---|---|---|
$country | string | |
$postcode | ?string = null | |
$goods | bool = true |
- Returns
?string
memberStateOfVatId()#
public static function memberStateOfVatId(string $vatId): ?stringThe 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.
| Parameter | Type | Description |
|---|---|---|
$vatId | string |
- Returns
?string
sameVatTerritory()#
public static function sameVatTerritory(
string $country,
?string $postcode,
string $otherCountry,
?string $otherPostcode,
): boolWhether 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.
| Parameter | Type | Description |
|---|---|---|
$country | string | |
$postcode | ?string | |
$otherCountry | string | |
$otherPostcode | ?string |
- Returns
bool
vatCountry()#
public static function vatCountry(string $country): stringThe country whose VAT territory the given country belongs to (MC → FR, IM → GB, EL → GR, LI → CH).
| Parameter | Type | Description |
|---|---|---|
$country | string |
- Returns
string