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

查看:49
本文介绍了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.我可以在购物篮/结帐中看到此值,这样就可以了.如果我在篮子里只有一件物品就可以了.

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.

推荐答案

最后,我找到了解决方案.我将系统">增值税">基于税额的计算方法"从单价更改为行总计",并且可以使用,更多详细信息

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天全站免登陆