Skip to content

Instantly share code, notes, and snippets.

View PoeHaH's full-sized avatar
🏠
Working from home

Maarten Belmans PoeHaH

🏠
Working from home
View GitHub Profile
@PoeHaH
PoeHaH / gist:c467d86118557ad17c464a482769f657
Created November 8, 2016 15:03
PHP code to determine VAT rate for your Belgian services-business
<?php
class VatHelper{
private $countrycodes;
private $vatrates;
public function __construct(){
$this->countrycodes = array('Austria'=>'AT','Belgium'=>'BE','Bulgaria'=>'BG','Croatia'=>'HR','Cyprus'=>'CY','Czech Republic'=>'CZ','Denmark'=>'DK','Estonia'=>'EE','Finland'=>'FI','France'=>'FR','Germany'=>'DE','Greece'=>'EL','Hungary'=>'HU','Ireland'=>'IE','Italy'=>'IT','Latvia'=>'LV','Lithuania'=>'LT','Luxembourg'=>'LU','Malta'=>'MT','Netherlands'=>'NL','Poland'=>'PL','Portugal'=>'PT','Romania'=>'RO','Slovakia'=>'SK','Slovenia'=>'SI','Spain'=>'ES','Sweden'=>'SE','United Kingdom'=>'GB');
$this->vatrates = array('AT' => 20,'BE' => 21,'BG' => 20,'HR' => 25,'CY' => 19,'CZ' => 21,'DK' => 25,'EE' => 20,'FI' => 24,'FR' => 20,'DE' => 19,'EL' => 24,'HU' => 27,'IE' => 23,'IT' => 22,'LV' => 21,'LT' => 21,'LU' => 17,'MT' => 18,'NL' => 21,'PL' => 23,'PT' => 23,'RO' => 20,'SK' => 20,'SI' => 22,'ES' => 21,'SE' => 25,'GB' => 20);
}
@PoeHaH
PoeHaH / gist:ab9d8ac1b4ddee168d4d96c71797df31
Last active November 21, 2022 11:12
JSON representation of EU countries, 2 letter codes and VAT amounts. Good to check the EU VIES database
var euList =
[
{country:'Austria',code:'AT',vat:20},
{country:'Belgium',code:'BE',vat:21},
{country:'Bulgaria',code:'BG',vat:20},
{country:'Croatia',code:'HR',vat:25},
{country:'Cyprus',code:'CY',vat:19},
{country:'Czech Republic',code:'CZ',vat:21},
{country:'Denmark',code:'DK',vat:25},
{country:'Estonia',code:'EE',vat:20},