Closed thannaske closed 3 years ago
Right, that’s currently not possible as the VAT rates don’t have any time of change associated with it. It would be cool to tackle this problem, but this would be a major refactoring. I’m most concerned about having to keep up with VAT changes - which is already not that easy.
I'm currently solving that issue with a database migration that holds the country code, the VAT as well as a valid_from
datetime field. So administrators can add new VAT rates right within the database and it becomes active when reaching the valid_from
date. However I'm aware that this package was designed to be usable without Laravel as well, which is kind of a problem when it comes to dynamic datasets. The EU provides a list of all VAT rates updated four times in the year, but I see that this would generate a high workload on your side. That's why it should be considerable to ship this package with a sensitive set of default values but give the user the possibility to update the rates without touching the package's files.
Next version will have 19% again.
In commit https://github.com/mpociot/vat-calculator/commit/b65422bfba3121af8ddcb3afc70955358039330f the German VAT rate has been changed from 0.19 to 0.16 which exposes a huge problem the library has at the moment. When using this library for batch invoice creation you'll end up with wrong tax calculations, if you want to create invoices for June in July. The library lacks the possibility to take the invoice date into account when calculating the VAT accordingly.