TaxCloud tax rate incorrect but tax calculation is correct

  • Posts: 47
  • Thank you received: 1
  • Hikashop Business
8 months 4 days ago #298033

-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.12

For some reason the TaxCloud tax rate showing on checkout is incorrect but the actual calculation of the tax is correct. Please see attached image. The tax rate of 9% is incorrect. It should be 8.8%. However the actual tax calculation of $7.92 is correct (89.99 + 8.8% = 7.92).

Please advise.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 65661
  • Thank you received: 9582
  • MODERATOR
8 months 4 days ago #298052

Hi,

TaxCloud doesn't send back the tax rate, only the tax amount. So HikaShop has to infer the tax rate from the tax amount and the gross price of the products. Because of that, we choose to round the tax rates. Otherwise, for a tax rate of 10%, you would often end up with 9.99% or 10.01% displayed.
To avoid that you have three possibilities:
- You can turn off the "Detailed tax display" setting of the HikaShop configuration and instead of displaying one row per tax rate, it will sum them up in one row with a generic "sales tax" label that you can change with a translation override.
- You can also directly use a translation override on the translation key TAXCLOUD_TAX to change the default:
TAXCLOUD_TAX="Tax (%s)"
For example, you could remove the (%s) in your override.
- You can also modify the taxName function of the plugins/hikashop/taxcloud/taxcloud.php file which generates the label. You could change the rounding precision, etc.

Here is some documentation on translation overrides:
www.hikashop.com/download/languages.html#modify

Please Log in or Create an account to join the conversation.

  • Posts: 47
  • Thank you received: 1
  • Hikashop Business
8 months 3 days ago #298088

Thank you for your reply.

I have the override to remove the (%s) in taxcloud_tax so that it just says Tax.

I would like to have the tax rate show at the correct rate without rounding up to the nearest whole number. I would like the rate to the tenth place. Example 8.8%. Could you please tell me what code and file to change to accomplish this?

And I just want to throw this out there - for US stores using taxcloud and showing a tax rate that is rounded up even though the actual tax calculation is correct, this may be a compliance violation with state revenue departments. The state that I am in is very strict with transparency in the sales tax being charged to a customer. Showing a rounded up sales tax rate but with a different tax calculation may be considered confusing to the customer.

Thank you for your help.

Please Log in or Create an account to join the conversation.

  • Posts: 65661
  • Thank you received: 9582
  • MODERATOR
8 months 3 days ago #298093

Hi,

As I said in my previous message, if you want to change the rounding of the tax rate, you can modify the taxName function of the plugins/hikashop/taxcloud/taxcloud.php file.

I agree with you that this is less than ideal. However, we can't do nothing from our end. It would require TaxCloud updating its API to also send the tax rate, not just the tax amount. Then we could use what they provide to display the correct tax rate all the time.

Please Log in or Create an account to join the conversation.

  • Posts: 47
  • Thank you received: 1
  • Hikashop Business
8 months 2 days ago #298147

Looking back in my orders, prior to 6/3/2017 the tax rate was correct and did not round up to the nearest whole number.

Is this the code I need to change and is there any way you could provide me the code to change it?
}
protected function taxName($rate) {
$key = 'TAXCLOUD_TAX';
if(JText::_($key) == $key)
$key = 'Tax (%s)';
$rate = round($rate * 100, 2) . '%';
$ret = JText::sprintf($key, $rate);
return $ret;
}

Thank you.

Last edit: 8 months 2 days ago by dbarnhart863.

Please Log in or Create an account to join the conversation.

  • Posts: 65661
  • Thank you received: 9582
  • MODERATOR
8 months 2 days ago #298149

Hi,

Well, there is nothing complex.
In that function you have the code:
$rate = round($rate * 100, 2) . '%';
There, you can change the number "2" to change the rounding precision.

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum