Download the PHP package fidelo-software/vatrates without Composer

On this page you can find all versions of the php package fidelo-software/vatrates. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package vatrates

VATRates

Up-to-date European VAT Rates

vatrates.nickstakenburg.com

VAT rates stored in JSON format, with PHP classes for easy access.

Install

Download

CDN

NPM

Composer

For the PHP package:

Javascript

Require vatrates or use a script tag to include vatrates.js:

An instance created with new VATRates() gives you several VAT rate functions. It's recommended to always use an isVATCountry() check before using them, like this:

Default rates are for today, to get rates for a different day pass in a Date:

You can also change the date by calling setDate() on a previously created instance:

getCountry(countryCode)

Another approach is to use getCountry(), it returns a VATCountry or undefined if the country doesn't use VAT. With a VATCountry you'll have all the VAT rate functions and some extra helpers.

The United Kingdom and Greece use extra non standard country codes "UK" and "EL", these are also accepted.

getCountries()

Returns an Array of all the countries using VAT, as VATCountry's.

setDate(date)

Set the Date for which to return VAT rates.

This is identical to:

All other functions take this date into account, so make sure to always set the date first.

isVATCountry(countryCode)

Returns true if a country uses VAT, or false if not.

getSuperReducedRate(countryCode)

Returns the super reduced rate for a country, or undefined when none is available.

A VATCountry returned by getCountry() offers this method directly.

getReducedRates(countryCode)

Returns an Array of reduced rates for a country, or undefined when none are available.

A VATCountry offers this method directly.

getStandardRate(countryCode)

Returns the standard rate for a country, or undefined when none is available.

A VATCountry offers this method directly.

getParkingRate(countryCode)

Returns the parking rate for a country, or undefined when none is available.

A VATCountry offers this method directly.

PHP

After installing through Composer use Staaky\VATRates\VATRates

An instance created with new VATRates() gives you several VAT rate functions. It's recommended to always use an isVATCountry() check before using them, like this:

Default rates are for today, to get rates for a different day pass in a DateTime:

You can also change the date by calling setDate() on a previously created instance:

getCountry(countryCode)

Another approach is to use getCountry(), it returns a VATCountry or null if the country doesn't use VAT. With a VATCountry you'll have all the VAT rate functions and some extra helpers.

The United Kingdom and Greece use extra non standard country codes "UK" and "EL", these are also accepted.

getCountries()

Returns an array of all the countries using VAT, as VATCountry's.

setDate(DateTime $date)

Set the date for which to return VAT rates.

This is identical to:

All other functions take this date into account, so make sure to always set the date first.

isVATCountry($countryCode)

Returns true if a country uses VAT, or false if not.

getSuperReducedRate($countryCode)

Returns the super reduced rate for a country, or null if none is available.

A VATCountry returned by getCountry() offers this method directly.

getReducedRates($countryCode)

Returns an array of reduced rates for a country, or null if none are available.

A VATCountry offers this method directly.

getStandardRate($countryCode)

Returns the standard rate for a country, or null when none is available.

A VATCountry offers this method directly.

getParkingRate($countryCode)

Returns the parking rate for a country, or null when none is available.

A VATCountry offers this method directly.

Development

Webpack

Use webpack to create a new build after you've made changes.

Gulp

Use gulp to load up the page in the /example folder. It shows the output of all files (Javascript, JSON & PHP) and automatically rebuilds with webpack as you modify source code.

Unit Tests

Run unit tests using npm test, this runs tests for every language.

Javascript tests are run with Mocha and PHP tests with Peridot. They can be run individually as well:

Contribute

VAT rates are kept up to date manually using data from the European Commission and VATLive.com. Initial historic rates are based on data from jsonvat.com.

If you notice an incorrect rate please create an issue or send a pull request. Future VAT changes can also be added to the JSON file. If you know of an upcoming change that isn't listed yet, please let me know.

Data on historic VAT rates is also appreciated. This can be hard to track down, especially the non-standard rates.

Flattr VATRates

License

VATRates is MIT Licensed


All versions of vatrates with dependencies

PHP Build Version
Package Version
Requires php Version >5.3.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fidelo-software/vatrates contains the following files

Loading the files please wait ....