Wrong VAT calculation
Posted: 10 Feb 2010, 20:39
I am not a coder, but i solved a critical bug in the code so i share.
In delivery.pdf.php, this line is not correct:
it's not possible tu deduce the VAT from a rounded included tax price because the result in the invoice is:
- wrong including price summary,
- wrong VAT per unit;
- wrong VAT total;
- wrong total amount of the invoice.
I modified the code this way:
Now my bills are correct, but hardcode is not clean: It would be better to request in the db the taxrates per product, especially if you have several tax rates in your shop...
Hope this helps
In delivery.pdf.php, this line is not correct:
Code: Select all
$price_with_tax['sum'] = $db->f('product__price') * $db->f('product_quantity_delivered');
- wrong including price summary,
- wrong VAT per unit;
- wrong VAT total;
- wrong total amount of the invoice.
I modified the code this way:
Code: Select all
$price_with_tax['sum'] = $db->f('product_item_price') *[TAX RATE OF YOUR COUTRY]* $db->f('product_quantity_delivered');
Hope this helps
