No more ugly math in your business logic.
You just require using composer and you're good to go!
composer require rackbeat/php-vat-helper
Rackbeat\VAT::include($amountExclVat = 100.0, 25); // 125.0
Rackbeat\VAT::exclude($amountInclVat = 100.0, 25); // 80.0
Rackbeat\VAT::amount($amountInclVat = 100.0, 25); // 25.0
Rackbeat\VAT::percentage($amountInclVat = 100.0, $amountExclVat = 80.0); // 0.25
- Better documentation
- Per-country/region defined vat zones
- PHP >= 7.1