We have a script to calculate Item price and VAT.
We get a wrong result in terms of precision.
IMPORTANT: variable must be the type of decimal(9, 4) and using of TRUNCATE is not allowed
Let's say the unit price Includes tax = 2.1, and Exclude tax = 1.8261,
we need 1000 items so the total cost Includes VAT should be 2100 (Unit price Inc. VAT * Quantity).
Now, let us calculate it by the unit price excluding the VAT.
First, we find the taxable amount which is (Unit price * quantity) is 1826.1
The tax is 15%, so we compute the VAT, which is (taxable amount * tax rate) is 273.9150
Finally, we need to find the total include tax which is (Taxable amount + VAT) the result is 2100.02
That's unexpected! We expect 2100.
How to solve this issue
8 freelanceria on tarjonnut keskimäärin $21 tähän työhön
I have strong knowledge on SQL tables. I have created 50+ tables and Stored Procedures I have written lot of complex queries also. Please contact through chat, i will start your work if you ok .