Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How is my store arriving at this total?


stephvand

Recommended Posts

I've been poking through the rounding / tax problem threads and can't seem to find one that matches my weird issue. Truth is, I'm not sure if I'm having a rounding problem or a tax problem since some of my orders are closer to accuracy than others. Can any of you point out any obvious mistakes if you spot them?

 

It's a Canadian store. The default currency has been switched back and forth from CAD to USD a couple times, which I understand could be causing database issues that relate to rounding and decimal places. The store will end up using CAD as the default currency.

 

I have the "decimal places" set to 2 under both tax and currency in Admin. Is there something I should be checking in the database itself as well, to make sure these values "took" when we changed back and forth between default currencies a bunch of times? I noticed mention of checking the database on a few threads but failed to get the gist of what we need to look for.

 

Now the problem itself: GST calculations are inaccurate at the checkout page. I don't have the taxes included on the item pages.

 

The label "GST on books" in the below example is insignificant... books have their own tax class separate from my other store items and this example order was for a book. This problem is happening store-wide though and not just with this type of item.

 

Sub-Total: $17.07(CAD)

Flat Rate (Best Way): $6.10(CAD)

GST on books + GST on shipping: $2.39(CAD)

Total: $25.56(CAD)

 

The correct GST amount should be 7% of $23.17 (item plus shipping), and comes to $1.6219 (I'm assuming that this rounds to $1.62). I don't know where the $2.39 GST amount is coming from. Does this look like a rounding error to the more experienced folks, or is this something to do with decimal places in the database and my repeated messing with the default currency? Any guesses?

Link to comment
Share on other sites

Also, I just noticed that on each item page the prices are coming up with four decimal places:

 

$16.9900

 

and on my Currencies page, should there be 8 decimal places?:

 

Decimal Point: .

Thousands Point: ,

Decimal Places: 2

 

Last Updated: 10/27/2004

Value: 1.00000000

Link to comment
Share on other sites

Also, I just noticed that on each item page the prices are coming up with four decimal places:

 

$16.9900

 

and on my Currencies page, should there be 8 decimal places?:

 

Decimal Point: .

Thousands Point: ,

Decimal Places: 2

 

Last Updated: 10/27/2004

Value: 1.00000000

 

I've noticed here and there that once in a while a change will not "take".... sometimes closing your browser and starting fresh will reset it.

 

I'm sorry I can't give you help on the tax issue. Did you read the Canadian tax section in the taxes doc in the \extras folder? (I think it's part of the basic install file)

 

Currencies is correct for length. I think there's a bug in osC though where the last 4 digits are off by up to .00000005 in either direction (i.e. plus or minus, e.g. 1.22599998 or 1.22500001.

Link to comment
Share on other sites

I've noticed here and there that once in a while a change will not "take".... sometimes closing your browser and starting fresh will reset it.

 

I'm sorry I can't give you help on the tax issue.  Did you read the Canadian tax section in the taxes doc in the \extras folder?  (I think it's part of the basic install file)

 

Currencies is correct for length.  I think there's a bug in osC though where the last 4 digits are off by up to .00000005 in either direction (i.e. plus or minus, e.g. 1.22599998 or 1.22500001.

 

 

I ended up starting over with a clean installation yesterday because there were too many factors that could have been affecting the order totals - couldn't sort them all out. Haven't attempted the taxes again yet, but yes the documentation was helpful and there was a great thread by Peter Mosier in here about Ontario tax setups which was exactly right.

 

Currency and tax decimal settings are both at 2 decimal places, and the hope is that having started fresh with CAD as the default currency right away (think that switching back and forth so often before we decided to go CAD fux0red a few things up) I won't experience the same issues again.

 

Also I suspect that if the decimal points weren't causing problems, the sort order of the order total module may have been wrong. In a nutshell, back to the drawing board and I'll let every one know what I did if it works. Thanks!

Link to comment
Share on other sites

Also I suspect that if the decimal points weren't causing problems, the sort order of the order total module may have been wrong. In a nutshell, back to the drawing board and I'll let every one know what I did if it works. Thanks!

 

Hope this is useful for someone else...if you're opening a Canadian store, make sure CAD is your default currency and try not to alter this more often than you need to.

 

Peter Mosier (lost the link, but a search will turn up the thread) posted a great article on Ontarian sales tax setups for stores operating from ON. I followed that to the letter (omitting HST requirements) and I've managed to get taxes working as follows:

 

Books - GST is charged Canada-wide with GST on shipping Canada-wide.

Non-book items: PST and GST charged if shipping within Ontario, GST only if outside Ontario, GST on shipping Canada-wide.

No taxes outside Canada.

 

I'd be happy to offer help to any other Canucks looking for this kind of setup.

 

The tax and currency decimals were both set to 2 places in my shop, and this time there were no rounding or decimal issues. WHEW!

Edited by stephvand
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...