spaze / vat-calculator

[EOL, use driesvints/vat-calculator] Handle all the hard stuff related to EU MOSS tax/vat regulations, the way it should be. Fork of mpociot/vat-calculator, standalone, PHP 7.3+, modernized, with more features.
MIT License
48 stars 2 forks source link

Turkey vat apply bug still continues #10

Closed officialmmt closed 4 years ago

officialmmt commented 4 years ago

Hi, I just trying your package. I got the same problem with "mpociot/vat-calculator" and more. When I try to query the country with divisions sample "United Kingdom", it gives 500 error. But the same query work well with "mpociot/vat-calculator".

spaze commented 4 years ago

Hi, I'm afraid I don't understand. Can you share your code that triggers the error, and the error message 9r stack trace you see? Thanks.

spaze commented 4 years ago

Aha, TR is already in VatRules although it shouldn't be. I misunderstood your bug in upstream, and it's not clear from this bug either.

However, I still don't understand what's the problem where you see HTTP 500.

officialmmt commented 4 years ago

I just trying to get rate with $vatRate = new VatCalculator(); $rates = $vatRate->getTaxRateForLocation($code); it gives 18% vat for turkey and failed with UK

spaze commented 4 years ago

Thanks but please show me the exact code and the error message you see with UK.

The UK rate is tested so that's why I'm interested: https://github.com/spaze/vat-calculator/blob/b51a719545997086c4eb004f261ae75708d2dc70/tests/VatCalculatorTest.php#L266-L272

The VatCalculator constructor requires VatRates object: https://github.com/spaze/vat-calculator/blob/b51a719545997086c4eb004f261ae75708d2dc70/src/VatCalculator.php#L34 But as it gives you some result for Turkey, it's probably a typo here.

The Turkey's 18% is wrong unless you add the rules manually by calling addRatesForCountry, see #8.

spaze commented 4 years ago

Just released a new version 3.4.0 that removes TR from the default VAT config.

I'll close this one, please open a new issue with the code and error message you see when calculating GB rate, see my comment above. Thanks.