Change the tax calculation to single item

Hi,
I’m experiencing some rounding issues in invoices and would like to change the way the taxes are calculated:

Example:
For one item of 1,64€ the taxes (19%) and totals are calculated as expected: 1,64€ + 0,31€ tax = 1,95€ total
but if I sell lets say100 items of the same price the calculation is as follows: 100*1,64€ =164€ + 31,16€ tax = 195,16 € total.

As I sell one item for 1,95€ (incl. tax), the calculation above can be technically correct, but confusing. The customer expects an amount of total 195€.

So the possible solution I see is to calculate tax for a single item, round it and multiply by the amount.

Now the part of my question :smile:

  • Will this be a good idea or a suitable solution?
  • Where can I do it? I know that this will probably not be update-save.

Thank for help.

I found already a solution that seems to work by now. Hope I don’t discover any side-effects. If somebody else is interested in this quick solution:

I changed the tax calculation in mdl_item_amounts.php to:

$item_tax_total = $item->item_quantity * (round($item->item_price * ($item->item_tax_rate_percent / 100),2));

and in my invoice PDF template to:

<?php echo format_currency(format_amount($item->item_quantity) * ($item->item_price + (round($item->item_price * ($item->item_tax_rate_percent / 100),2)))); ?>