Magento&贝宝四舍五入问题 [英] Magento & Paypal tax rounding issue

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

问题描述

我在使用Paypal和Magento 1.7.0.2时遇到一些舍入问题-该网站上的所有价格均含税,税额为20%(增值税).

I have some rounding issues with Paypal and Magento 1.7.0.2 - All prices on the site include tax and the tax is worked out at 20% (VAT).

我将去结帐,并且一切正确:

I will go to checkout and everything is correct:

然后我将单击下订单,贝宝将是这样,这是不正确的,因为总计现在减少了1p.这似乎是由税收的四舍五入引起的.

I will then click on place order, and Paypal will be like this, which is incorrect because the grand total is now 1p less. This appears to be cause by how the tax is rounded.

在某些情况下,它可以正常运行,但在其他情况下,税额却四舍五入不正确.我尝试在app/code/core/Mage/Tax/Model/Calculation.php

In some cases, it works ok, but in others the tax is rounded incorrectly. I have tried making changes to the tax calculation method calcTaxAmount() in app/code/core/Mage/Tax/Model/Calculation.php

我将其添加到calcTaxAmount方法中,该方法似乎可以解决该问题,但是这会导致产品页面上的价格不正确(少1p).

I added this to the calcTaxAmount method which seemed to fix it, but it cause the prices on the product page to then be incorrect (1p less).

$amount = $this->roundUp($amount);

我可以肯定这是一个错误,但是我没有主意.如果有人以前遇到过这种情况并且有解决方案,我将很高兴听到它.任何帮助表示赞赏.

I'm pretty certain this is a bug, but I'm out of ideas. If anyone has come across this before and has a solution I'd be happy to hear it. Any help much appreciated.

这是我在Magento中的纳税设置

推荐答案

我今天为我的客户修复"了此问题,但对解决方案并不满意.但这有效.

I "fixed" this today for i client but not really happy with the solution. But it works.

最好将此文件复制到本地文件夹: app/code/core/Mage/Paypal/Model/Api/Nvp.php

It is better if you copy this file to your local folder: app/code/core/Mage/Paypal/Model/Api/Nvp.php

我在606行中添加了此代码(仅用于快速结帐),因此看起来像这样.

I added this code (Only for the express checkout) on line 606 so it look like this.

$request['SHIPPINGAMT'] = ($request['AMT'] - ($request['TAXAMT'] + $request['ITEMAMT']));

$response = $this->call(self::SET_EXPRESS_CHECKOUT, $request);
$this->_importFromResponse($this->_setExpressCheckoutResponse, $response);

您需要在后端的Paypal帐户中打开转移购物车订单项"

And you need to turn of Transfer Cart Line Items in the paypal moule in the backend

如果有人知道更好的解决方案,那就覆盖运费就让我知道

If somebody knows a better solution then just overwriting the shippingcost let me know

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

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