Tax not calculatiing properly on 4 decimal tax rate with Shipping Taxable

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
I did see a post but it only applied to earlier version. Where can I correct this rounding problem? I need my tax to be .0925 or 9.25 % and have it calculate properly. It is most always a penny off. Please help. We are trying to go live.


What I think is happening is that the Shipping Tax is being calculated separately then rounded. In the tax service module it is defining shippingtax as :

if (shippingExclTax.HasValue && shippingInclTax.HasValue)
                {
                    shippingTax = shippingInclTax.Value - shippingExclTax.Value;

                    //tax rates
                    if (taxRate > decimal.Zero && shippingTax > decimal.Zero)
                    {
                        if (!taxRates.ContainsKey(taxRate))
                        {
                            taxRates.Add(taxRate, shippingTax);
                        }
                        else
                        {
                            taxRates[taxRate] = taxRates[taxRate] + shippingTax;
                        }
                    }
                }

shippingTax = shippingInclTax.Value - shippingExclTax.Value

Then it is added back in to the tax total. This is where I am losing a penny.

Thanks!

Jim Frye
12 years ago
Hello Jim,
I have the same problem with Tax. I always have penny off.
I remove all rounding in TaxService.cs, ShippingService.cs, ShopCartService.cs etc.
And I fix the problem in Tax. But I still have penny off in total amount.

Regards,
Łukasz
12 years ago
please see:

https://www.nopcommerce.com/boards/t/9721/tax-not-calculated-correctly-with-shipping-taxed-and-taxrate-0925.aspx
that should fix it for ya!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.