cancel
Showing results for 
Search instead for 
Did you mean: 

Paypal and Magento's Tax Rounding in Magento1.9.2.4

Paypal and Magento's Tax Rounding in Magento1.9.2.4

I need a solution regarding some customization for Magento's PayPal module.

I want some tax rounding on my website, what I understand is Magento will roundoff the tax total like:

1. Item Tax : 0.6542 => 0.65 (round to 2 place)
2. Shipping Tax : 1.9626 => 1.96 (round to 2 place)
3. Total Tax: 0.65 + 1.96 => 2.61 

But I want it like : 0.6542 + 1.9626 = 2.6168 = 2.62 (round to 2 place)

For this, I will do change in app/code/local/Mage/Core/Model/Store.php

I replaced return round($price,2) to round($price,4).

after this having issue in PayPal.

Paypal is showing amount non-rounding, for this, I have done some changes to achieve the same invoice as my store.

1. app/code/local/Mage/Paypal/Model/Api/Abstract.php In __filterAmount function: Replace return sprintf('%.2F',$value) to return round($value,2);

2. app/code/local/Mage/Paypal/Model/Cart.php In _render function: self::TOTAL_TAX => $this->_salesEntity->getBaseTaxAmount(), to self::TOTAL_TAX => round($this->_salesEntity->getBaseTaxAmount(),2),

And in addItem function: replace 'amount' => (float)$amount, to 'amount' => round((float)$amount,2),

Now the tax is rounded and the purchase total is rounded as well but the issue is will Net and Gross amount.

Where these Gross and Net amount calculation take place in PayPal files, Because if my amount of the tax is 2.62 and Item amount excl. tax 9.35 and shipping 28.04 then Paypal will show me $40.01 as Net and Gross Amount because I have done the rounding of prices. Default It will show me:

Purchase total: $9.34 
Tax: $6.22
Shipping: 28.04
Gross and Net Amount: $40.00

But after rounding:

Purchase total : $9.35 
Tax: $6.22
Shipping: 28.04
Gross and Net Amount: $40.01

Even I tried with Line Item Setting to 'No' but still having the issue. Let me know where these Gross and Net Amount Calculation will take place, Because I want to show the subtotal rounded amount but that will change my Gross and Net amount. I don't have any issue with payment, I am having an issue with Paypal slip for orders invoice.