Skip to content

Releases: spaze/vat-calculator

Temporary IE VAT rate cut

03 Sep 10:57
Compare
Choose a tag to compare
  • Irish VAT temporarily reduced from 23% to 21% from 1 September 2020 to 28 February 2021 (#6)
  • Add optional non-EU Turkish VAT rate 18% that needs to be added manually with addRateForCountry (#8)

Time machine

13 Jul 00:03
Compare
Choose a tag to compare

Adds a new parameter (optional) to VatCalculator::calculate(), VatCalculator::calculateNet(), VatCalculator::getTaxRateForLocation(), VatRates::getTaxRateForLocation() which allows you to specify an optional date to use the VAT rate for when calculating the price.

Sounds complicated but this allows to issue invoices when a country has changed its VAT rate and you want to issue an invoice for the period when the previous rate was still used. For example Germany has lowered VAT rates temporarily beginning July 1st (#3), and this allows you to issue invoices for June in July with the previous, and correct, rates.

Immutable

31 May 22:26
Compare
Choose a tag to compare

The VatCalculator objects are now immutable, they keep their state, the calculate() and calculateNet() calls return a VatPrice object. These methods have been removed because they're no longer needed, use VatPrice getters instead:

  • getNetPrice()
  • getTaxRate()
  • getCountryCode() & setCountryCode()
  • getPostalCode() & setPostalCode()
  • isCompany() & setCompany()

No-way

30 May 00:41
Compare
Choose a tag to compare

While Norway is not part of the EU, the country also uses VAT. But if you're in EU selling to NO customers, you don't always want to charge VAT. See upstream's driesvints#43 and driesvints#14 (comment). This release removes Norway VAT and adds a method to add it back manually.

  • Norway VAT rate removed, can be manually added back with VatRates::addRateForCountry() (BC BREAK)
  • VatCheckUnavailableException always thrown, forwardSoapFaults option has been removed (BC BREAK)
  • Some countries have various VAT rates depending on location resulting in getTaxRateForCountry() removal, use getTaxRateForLocation() instead (BC BREAK)
  • Separate class VatRates for rates, you need to pass the class to VatCalculator constructor (BC BREAK)

Standalone-ize

30 May 00:37
Compare
Choose a tag to compare

This is a fork of mpociot/vat-calculator. Waiting too long for merging some of my PRs (like driesvints#72) and the need to remove Norway from EU VAT countries were the main reasons for forking the lib. Thanks Marcel Pociot for your work on the lib!

Here are the changes:

  • Version 3 doesn't support Laravel/Cashier anymore (BC BREAK).
  • The namespace has been changed for this fork from to Spaze\VatCalculator (BC BREAK)
  • getIPBasedCountry() & getClientIP() methods have been removed (BC BREAK)
  • Some methods have been properly camelCased (shouldCollectVAT -> shouldCollectVat)
  • VATCheckUnavailableException has been camelCased to VatCheckUnavailableException
  • SoapFault exceptions can be thrown in standalone mode too (previously only in Laravel mode)
  • PSR-4 compatible
  • Requires PHP 7.3 or newer, adds types