Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Paypal IPN - Where is Tax calculated Help!


Recommended Posts

Posted

I need to change the formula used to calculate or round up/down taxes. I have a problem:

 

Here is the deal:

 

During checkout OS makes the following calculation:

Item Price: 18.95

Shipping : 3.35

Subtotal: 22.30

Tax (8% Applied to both item and shipping in my state): 1.79

Total: 24.09

 

BUT the tax should be 1.78.

 

It seems that OS is either:

1. incorrectly rounding up (22.30 x .08 = 1.784 which should be 1.78)

2. or incorrectly rounding the tax of each item first and then adding them (18.95 x.08 = 1.516 rounded to 1.52 PLUS 3.35 x .08 = 0.268 rounded to .27 Equals 1.79.

 

Anyone know where is the problem or a possible fix? I spend about 2 hours searching but the rounding issues people seem to have are related to other modifications.

 

Could someone tell me in what file is tax calculated? I want to try to find where the error is. Thanks. xp.

Posted
I need to change the formula used to calculate or round up/down taxes. I have a problem:

 

Here is the deal:

 

During checkout OS makes the following calculation:

Item Price: 18.95

Shipping : 3.35

Subtotal: 22.30

Tax (8% Applied to both item and shipping in my state): 1.79

Total: 24.09

 

BUT the tax should be 1.78.

 

It seems that OS is either:

1. incorrectly rounding up (22.30 x .08 = 1.784 which should be 1.78)

2. or incorrectly rounding the tax of each item first and then adding them (18.95 x.08 = 1.516 rounded to 1.52 PLUS 3.35 x .08 = 0.268 rounded to .27 Equals 1.79.

 

Anyone know where is the problem or a possible fix? I spend about 2 hours searching but the rounding issues people seem to have are related to other modifications.

 

Could someone tell me in what file is tax calculated? I want to try to find where the error is. Thanks. xp.

The rounding bug is an old (and stubborn) osCom bug which is related to the number of digits used to store prices in the db & the functions used to handle prices (currency, tax) calculations.

 

Your second assumption (that the item is rounded first) is correct. It's not a problem related to any contrib but a generic osCom issue .. most shop owners have taken the pragmatic approach that customers won't bail out of a purchase because of a 0.01 difference.

 

more info in these threads:

http://www.oscommerce.com/forums/index.php?sho...c=80953&hl=

http://www.oscommerce.com/forums/index.php?sho...=currency+round

 

all the best - Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...