Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    14
    Plugin Contributions
    0

    Default Re: Serious problem with VAT

    Is it possible to paste in a full example of what the invoice looks like as I am still unsure I have understood you?

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,267
    Plugin Contributions
    3

    Default Re: Serious problem with VAT

    I noticed this years ago and the OP is correct...

    ZC calculates the vat on individual items and rounds it, then adds the rounded amounts. When the cart has ONE item (or perhaps just a couple), this is not serious as the vat total will usually be correct.

    But when a cart has many items, the vat total can be out by several pennies!

    I believe this may have something to do with the policy of sales tax calculation being different in the USA, where tax can be added to individual items and rounded, before it is finally totalled up...

    ... but in the UK, vat policy is to apply the vat to the transaction TOTAL.

    This may be complex to resolve, as it may require a completely separate taxation module for markets where tax is applied to the transaction TOTAL, rather than to individual items.
    20 years a Zencart User

  3. #3
    Join Date
    Apr 2007
    Posts
    14
    Plugin Contributions
    0

    Default Re: Serious problem with VAT

    When I did my testing some time ago I don't recall having any issues. Mind you I had applied several fixes maybe I patched before I tested.

    PS: Sorry was does "the OP" mean?

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,267
    Plugin Contributions
    3

    Default Re: Serious problem with VAT

    Quote Originally Posted by silslendir View Post
    PS: Sorry was does "the OP" mean?
    OP = Original Poster (Person who made the initial request / post)
    20 years a Zencart User

  5. #5
    Join Date
    Oct 2008
    Posts
    22
    Plugin Contributions
    0

    Default Re: Serious problem with VAT

    This is interesting and stems from the same mistake in zen:

    learnwebdesignonline.com/tutorials/zencart/sales-tax-error

    ...But I think the problem I'm encountering is more to do with invoice.php in the admin directory, around line 200, I've cut the echo down a bit for clarity:

    Code:
    <?php
    
    echo '<td class="dataTableContent" align="right" valign="top"><b>' .
            $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) .
            ($order->products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->format(zen_add_tax($order->products[$i]['onetime_charges'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) : '') .
         '</b></td>' . "\n";
    
    ?>
    That scary use of Zencart functions is a little hard to decipher, but as far as I can tell, it is adding the VAT then totalling, which is wrong, not just for the UK but generally.

    Once I've woken up a bit, I might try to post a fix.

  6. #6
    Join Date
    Oct 2008
    Posts
    22
    Plugin Contributions
    0

    Default Re: Serious problem with VAT

    OK this is how you fix it...

    Open invoice.php in the admin directory and scroll down to line 199, it should look like this:

    Code:
                          $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) .
    All we need to do is expand the zen_add_tax() function to also enclose the multiplication by quantity...

    Like this:

    Code:
                          $currencies->format(zen_add_tax($order->products[$i]['final_price'] * $order->products[$i]['qty'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) .
    Simple huh.

  7. #7
    Join Date
    Apr 2007
    Posts
    14
    Plugin Contributions
    0

    Default Re: Serious problem with VAT

    Well that link you posted refreshmentshop seems a good place to go, although I still seem to have fixed it in another way. Sorry can't reverse engineer what I did to quote it. Maybe if I get more time.

 

 

Similar Threads

  1. Serious problem with customizing my online store
    By beautynexus in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 6 May 2011, 09:32 PM
  2. I have a problem with cupons and vat - EU VAT Mod
    By oberheimer in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 8 Feb 2011, 04:31 PM
  3. Customer Order - VAT - Serious Problem -Help
    By rabz in forum Managing Customers and Orders
    Replies: 1
    Last Post: 22 Dec 2008, 05:04 PM
  4. Serious problem with my zencart
    By doll5272 in forum Basic Configuration
    Replies: 3
    Last Post: 1 Aug 2008, 02:56 PM
  5. Problem with VAT after using discount coupon VAT is not changing...
    By mrplants in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 7
    Last Post: 11 Jan 2007, 03:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg