Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / UK VAT (TAX) is out by £0.01 for flat rate shipping

UK VAT (TAX) is out by £0.01 for flat rate shipping

Locked

Started by shane78 on 25 Feb 2010, 5:32 PM · Views: 911

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
25 Feb 2010, 5:32 PM
#1
shane78 avatar

shane78

Banned

Join Date:
Oct 2008
Location:
newcastle upon tyne (UK)
Posts:
876
Plugin Contributions:
0

Post #1 by shane78

Hi,

am testing a site for flat rate shipping and i have noticed a little error regarding flat rate shipping.

if i have a order total of £6 the total including tax should be £7.05
this works if a product is priced at £6 and no shipping.

however when i have a product priced at £1 and flat rate shipping at £5 the total including tax is 7.06

please help.. is this a bug? how do i get this to be correct

Thanks

25 Feb 2010, 6:59 PM
#2
shane78 avatar

shane78

Banned

Join Date:
Oct 2008
Location:
newcastle upon tyne (UK)
Posts:
876
Plugin Contributions:
0

Post #2 by shane78

i dont know if this is of any help but i have done some playing and found a pattern...

product..... flat rate..... total..... UK VAT..... total order
£1.00..... £5.00..... £6.00..... 17.50%..... 7.05 wrong by 0.01 (7.06)
£2.00..... £5.00..... £7.00..... 17.50%..... 8.23 correct
£3.00..... £5.00..... £8.00..... 17.50%..... 9.40 wrong by 0.01 (9.41)
£4.00..... £5.00..... £9.00..... 17.50%..... 10.58 correct
£5.00..... £5.00..... £10.00..... 17.50%..... 11.75 wrong by 0.01 (11.76)
£6.00..... £5.00..... £11.00..... 17.50%..... 12.93 correct
£7.00..... £5.00..... £12.00..... 17.50%..... 14.10 wrong by 0.01 (14.11)
£8.00..... £5.00..... £13.00..... 17.50%..... 15.28 correct

any ideas? my settings? or a bug?

25 Feb 2010, 7:59 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #3 by ajeh

Check the settings on the Shipping Module to ensure you do not have a Tax Class set on it ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Feb 2010, 8:08 PM
#4
shane78 avatar

shane78

Banned

Join Date:
Oct 2008
Location:
newcastle upon tyne (UK)
Posts:
876
Plugin Contributions:
0

Post #4 by shane78

Hi Ajeh,

these are my settings..

Flat Rate

Enable Flat Shipping
True

Shipping Cost
5

Tax Class
Taxable Goods

Tax Basis
Shipping

Shipping Zone
--none--

Sort Order
0

I have to charge VAT on shipping as UK law sees it as a service :(
bloody government!

i have looked at another site i made that is used as a showcase only,,, fiddled with the settings and thats the same TAX error pattern too... what have i done wrong? LOL

25 Feb 2010, 9:03 PM
#5
cjpinder avatar

cjpinder

Totally Zenned

Join Date:
Apr 2007
Location:
Herts. UK
Posts:
893
Plugin Contributions:
0

Post #5 by cjpinder

mcshane78:

however when i have a product priced at £1 and flat rate shipping at £5 the total including tax is 7.06

please help.. is this a bug? how do i get this to be correct
You've hit a long standing bug in Zen Cart. It adds tax to each individual item, rounds it to the currencies number of decimal places and then totals the result. It should just total all the prices and then apply tax. The problem has been reported numerous times but AFAIK there has never been an official fix released.

A work around can be found here...
http://www.learnwebdesignonline.com/tutorials/zencart/sales-tax-error

Regards,
Christian.

25 Feb 2010, 10:58 PM
#6
shane78 avatar

shane78

Banned

Join Date:
Oct 2008
Location:
newcastle upon tyne (UK)
Posts:
876
Plugin Contributions:
0

Post #6 by shane78

hi CJPinder..

i was so happy when you forward that link...

i followed the instructions so my
includes/functions/functions_taxes.php now reads

// Add tax to a products price based on whether we are displaying tax "in" the price
  function zen_add_tax($price, $tax) {
    global $currencies;

    if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) ) {
      return $price + zen_calculate_tax($price, $tax);
    } else {
      return $price;
    }
  }

and includes/classes/order.php reads

   // calculate the amount of tax for this product (assuming tax is NOT included in the price)
        $tax_add = ($products_tax / 100) * $shown_price;
      }
      $this->info['tax'] += $tax_add;
      if (isset($this->info['tax_groups'][$products_tax_description])) {
        $this->info['tax_groups'][$products_tax_description] += $tax_add;
      } else {
        $this->info['tax_groups'][$products_tax_description] = $tax_add;
      }
      /*********************************************
       * END: Calculate taxes for this product
       *********************************************/

but sadly it has made no change... the same errors occur
:cry:

any advice?

25 Feb 2010, 11:01 PM
#7
cjpinder avatar

cjpinder

Totally Zenned

Join Date:
Apr 2007
Location:
Herts. UK
Posts:
893
Plugin Contributions:
0

Post #7 by cjpinder

You missed the change to the zen_calculate_tax() function in /includes/functions/functions_taxes.php. I've tested the changes on a clean ZC1.3.8 install using the scenario you have described and I'm sure it fixes the problem.

Regards,
Christian.

25 Feb 2010, 11:06 PM
#8
shane78 avatar

shane78

Banned

Join Date:
Oct 2008
Location:
newcastle upon tyne (UK)
Posts:
876
Plugin Contributions:
0

Post #8 by shane78

LOL... im such a div

worked a treat.. thank you so much!!!!
(lol,,, isnt it time for a 1.3.8b ;))

25 Feb 2010, 11:20 PM
#9
cjpinder avatar

cjpinder

Totally Zenned

Join Date:
Apr 2007
Location:
Herts. UK
Posts:
893
Plugin Contributions:
0

Post #9 by cjpinder

mcshane78:

LOL... im such a div

worked a treat.. thank you so much!!!!
You're welcome. Glad it fixed it for you.
mcshane78:

(lol,,, isnt it time for a 1.3.8b ;))

You might well think that; I couldn't possibly comment. :smile:

Regards,
Christian.