Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1
    Join Date
    Dec 2008
    Location
    Stockholm
    Posts
    29
    Plugin Contributions
    0

    Default Tax + discount coupon BUG?

    Hello!

    PROBLEM:
    - Tax calculates wrong when using a discount coupon (fixed amount, including tax) in the checkout.

    SETTINGS:
    - Zencart version 1.3.8a, fresh install with sample products, no mods installed
    - My Store -> 'Display Prices with Tax' = true
    - My Store -> 'Zone' = Florida
    - Discount coupon fixed amount of $10.00, including tax
    - 'ot_coupon' settings are: 'Include shipping' = false, 'Include tax' = true, 'recalculate tax' = none

    CHECKOUT BUG: (I have added one product that costs $100.00 including tax) to make the calculation simple)

    Sub-Total: $100.00
    Store Pickup (Walk In): $0.00
    Discount Coupon: 10 : -$10.65 (should be $10.00)
    FL TAX 7.0%: $5.89
    Total: $90.00

    Where is the amount -$10.65 coming from? I have tried different combinations in the ot_coupons module, but with no luck. How is this supposed to work? Is there any documentation about how tax is calculated using different combinations of discounts etc?



    Best Regards

    Erik

  2. #2
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: Tax + discount coupon BUG?

    Hi,

    Please change your settings to

    include_shipping = FALSE
    include_tax = FALSE
    recalculate_tax = Standard

    and try again.

  3. #3
    Join Date
    Dec 2008
    Location
    Stockholm
    Posts
    29
    Plugin Contributions
    0

    Default Re: Tax + discount coupon BUG?

    Hi wilt!

    I tried your suggestion but ended up with this:

    Sub-Total: $100.00
    Store Pickup (Walk In): $0.00
    Discount Coupon: 10 : -$10.7 (should be $10.00)
    FL TAX 7.0%: $5.84 (should be $5.89)
    Total: $89.30 (should be $90.00)



    Thank you for a fast reply anyway

    /Erik

  4. #4
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: Tax + discount coupon BUG?

    k,


    The settings I gave work correctly for me on a clean v138 install.

    Do you have DISPLAY_PRICE_WITH_TAX = true set in the admin. If so this would cause the discount coupon value to be inflated by the tax rate.

    It is also highly unusual for a US based store to have this setting set to true.

  5. #5
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: Tax + discount coupon BUG?

    Further Note.

    If you do have display_price_with_tax = true then there is a bug in 138 regarding the tax calculations for coupons.

    I will dig out the relevant threads where I posted a fix for the behaviour

  6. #6
    Join Date
    Dec 2008
    Location
    Stockholm
    Posts
    29
    Plugin Contributions
    0

    Default Re: Tax + discount coupon BUG?

    Hi again

    As I wrote in the original message, the DISPLAY_PRICE_WITH_TAX is set to true.

    My live shop is swedish and we only sell to people in Sweden. The reason I showed a 'Florida' example with a clean install is that it simplifies for you to troubleshoot.

    In Sweden, almost all 'consumer' shops show prices including tax, and the discount coupons should therefore also include tax.

    Thank you for searching the threads...

    /Erik

  7. #7
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: Tax + discount coupon BUG?

    Hi

    To fix the problem you will need to edit

    includes/modules/order_totals/ot_coupon.php

    line 73

    replace

    PHP Code:
    if (DISPLAY_PRICE_WITH_TAX == 'true') { 
    with

    PHP Code:
    if (DISPLAY_PRICE_WITH_TAX == 'true' && $od_amount['type'] == 'P') { 

    Line 76

    replace

    PHP Code:
    if ($this->calculate_tax == "Standard"$order->info['total'] -= $tax
    with

    PHP Code:
    if ($this->calculate_tax == "Standard"  && $od_amount['type'] == 'P'$order->info['total'] -= $tax
    line 347

    replace

    PHP Code:
    $ratio $od_amount['total']/$order_total
    with

    PHP Code:
    $ratio $od_amount['total']/($order_total+ ( (DISPLAY_PRICE_WITH_TAX == 'true') ? $orderTotalTax )); 
    remember to back files up before editing

  8. #8
    Join Date
    Dec 2008
    Location
    Stockholm
    Posts
    29
    Plugin Contributions
    0

    Default Re: Tax + discount coupon BUG?

    Hi

    Your code fix solves the problem when using a discount coupon with a value less than the total excluding tax. See attachments. The one using a $100 coupon is false...

    ot_coupon settings are:

    include_shipping = FALSE
    include_tax = FALSE
    recalculate_tax = None

    (I have tried different combinations but with no luck)

    Again, thank you for trying to help me out!

    /Erik
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	10 dollars.jpg 
Views:	556 
Size:	34.3 KB 
ID:	5548   Click image for larger version. 

Name:	100 dollars.jpg 
Views:	505 
Size:	35.1 KB 
ID:	5549  

  9. #9
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: Tax + discount coupon BUG?

    Hi,

    I get correct figures with

    include_shipping = FALSE
    include_tax = FALSE
    recalculate_tax = Standard
    display_price_with_tax = true

    Sub=Total = 100.00
    shipping = 0.00
    discount Coupon = -100.00
    Tax = 0.00
    Total = 0.00

  10. #10
    Join Date
    Dec 2008
    Location
    Stockholm
    Posts
    29
    Plugin Contributions
    0

    Default Re: Tax + discount coupon BUG?

    Ok, strange. I get wrong values with the same settings as you. I have attached some screendumps to let you see how everything is set up.

    Is there a setting I have missed?

    /Erik
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	ot.jpg 
Views:	582 
Size:	26.0 KB 
ID:	5551   Click image for larger version. 

Name:	coupon.jpg 
Views:	545 
Size:	21.7 KB 
ID:	5552  

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Replies: 18
    Last Post: 12 Mar 2010, 06:37 PM
  2. Discount Coupon/Free - Tax Bug?
    By clane777 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 24
    Last Post: 8 May 2008, 06:43 PM
  3. Discount Coupon AND Group Discount Tax Problem
    By mrkrinkle in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 11
    Last Post: 5 Apr 2007, 12:16 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR