Magento 税收四舍五入问题 [英] Magento tax rounding issue

查看:27
本文介绍了Magento 税收四舍五入问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Magento 中遇到了奇怪的增值税四舍五入问题.我的产品设置是* 含 20% 增值税的产品价格为 183.59

I got strange rounding issue for VAT in Magento. My product set up is * product price incl 20% VAT is 183.59

我在购物篮中添加了 30 件商品,价格为 30 * 183.59 = 5507.70.我可以在篮子/结帐中看到这个值,所以很好.如果我的篮子里只有 1 件商品,那就没问题了.

I added 30 items into basket and it would cost 30 * 183.59 = 5507.70. I can see this value in basket/checkout so that's fine. If I have just 1 item in basket it's ok.

另外最终的增值税将是 5507.70 * 20/120 = 917.95,但我得到的是 918.00

Also the final VAT would be 5507.70 * 20 / 120 = 917.95, but I'm getting 918.00

你知道如何解决这个问题,或者我可以去哪里看看?提前致谢.

Do you have any idea how to fix this or where would I take a look? Thanks in advance.

推荐答案

最后我找到了解决方案.我将 System > VAT > Tax Calculation Method Based On 从 Unit price 更改为 Row Total 并且它有效,更多详细信息 这里

In the end I found the solution. I changed System > VAT > Tax Calculation Method Based On from Unit price to Row Total and it works, more details here

我发现的问题是在 core/store 模型中.我不得不重写 roundPrice 方法并在那里更改舍入精度.

The issue which I found is in core/store model. I had to rewrite roundPrice method and change rounding precision there.

public function roundPrice($price)
{
   return round($price, 4);
}

这篇关于Magento 税收四舍五入问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆