If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / Incorrect processing of Tax

Incorrect processing of Tax

Started by dbltoe on 17 Nov 2023, 4:14 PM · Views: 5,047

Results 1 to 20 of 50
17 Nov 2023, 4:14 PM
#1
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Incorrect processing of Tax

Reference post https://www.zen-cart.com/showthread.php?229773-Store-Sales-Tax-Drops-Off-on-Checkout

Here's what you see on any order that is completed.

[Attachment no longer available]

The total should be $153.08

Both Admin Config Settings and USPS are set to "Store"

Tax is set to show in the cart and product pricing.

All Countries with All Zones was created in the database. But it shows up with the red dot.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

17 Nov 2023, 4:43 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

I tried removing the All Countries, set up US 50+ DC and Non US.

Still the same result.:no:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

17 Nov 2023, 7:03 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Incorrect processing of Tax

OK, I've 'modeled' the environment locally:

  • My Store: Basis for Product Tax, Basis for Shipping Tax set to 'store'
  • My Store: Display prices with tax: true
  • Modules :: Shipping. All enabled shipping use "Store" as tax basis, no zone restrictions
  • One "Tax Rate", associated with the store's country and zone.

Taxes are included in prices on product listing/details display, in the cart and in the order.

18 Nov 2023, 4:46 AM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

lat9:

OK, I've 'modeled' the environment locally:

  • My Store: Basis for Product Tax, Basis for Shipping Tax set to 'store' Same on the Toad site
  • My Store: Display prices with tax: true Same on the Toad site
  • Modules :: Shipping. All enabled shipping use "Store" as tax basis, no zone restrictions Only USPS is used and it its set to Store and No restrictions
  • One "Tax Rate", associated with the store's country and zone. One tax rate is set for US and New Mexico of 7.75%

Taxes are included in prices on product listing/details display, in the cart and in the order. Same on the Toad site

Taxes are only shown for New Mexico shipping addresses and are NOT added to the total.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

18 Nov 2023, 6:45 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Incorrect processing of Tax

Does the same thing happen if the shipping method is one of the built-in's, e.g. flat? Just trying to see where the issue lies, since my test site has flat set up and everything looks copacetic.

23 Nov 2023, 1:07 AM
#6
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

It does exactly the same with flat.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

23 Nov 2023, 6:51 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Incorrect processing of Tax

The main difference between your site's setup and my local one (which appears to 'work') is that you've got a Tax Class set for the shipping module(s). Set Tax Class to --none-- and the Tax Basis to Store; does that do what you want?

23 Nov 2023, 7:05 PM
#8
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

Setting either flat or USPS to Tax Class none and store for basis, I get $0.00 tax applied.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

23 Nov 2023, 7:09 PM
#9
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

And checkout now shows>

Sales Tax + Gross Receipts Tax 7.75%: |
$0.00 |

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

23 Nov 2023, 11:16 PM
#10
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Incorrect processing of Tax

@dbltoe, I can't explain why that site's having those issues. I

  • Installed an as-shipped zc158a with no demo data.
  • Configured the store in United States/Florida, tax basis Store/Store, display prices with tax.
  • Changed the default "Taxable Goods" rate to be 10% (easier calculations)
  • Added a $100.00 product, using the default "Taxable Goods"
  • Removed all but the Flat shipping module, which is configured with Tax Basis = Store and Tax Class = "Taxable Goods"

Created an account at the store, added the product to my cart.

  • Shopping-cart page shows $110.00
  • Checkout payment shows: Sub-Total ($110.00), Flat Rate ($5.50), FL TAX 10% ($10.50), Total ($115.50), using either a Florida or California-based shipping address.
24 Nov 2023, 6:38 AM
#11
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

lat9:

@dbltoe, I can't explain why that site's having those issues. I

  • Installed an as-shipped zc158a with no demo data.
  • Configured the store in United States/Florida, tax basis Store/Store, display prices with tax.
  • Changed the default "Taxable Goods" rate to be 10% (easier calculations)
  • Added a $100.00 product, using the default "Taxable Goods"
  • Removed all but the Flat shipping module, which is configured with Tax Basis = Store and Tax Class = "Taxable Goods"

Created an account at the store, added the product to my cart.

  • Shopping-cart page shows $110.00
  • Checkout payment shows: Sub-Total ($110.00), Flat Rate ($5.50), FL TAX 10% ($10.50), Total ($115.50), using either a Florida or California-based shipping address.
    Is this perhaps a typo?
    Even if the tax is on the $100 product versus the Sub-Total of $110, and not charged on shipping, shouldn't that tax show as $10 versus $10.50.
    And, if the tax is taxing both the $100 product and the $5.50 shipping, shouldn't the tax should show $10.55.

Regardless, the only difference between your settings and the site's settings are the tax zone/rate and product price which should only affect the final total not the amounts shown on the shopping cart or in OPC.

I have compared the DB with a standard install and found nothing that should affect the sales tax.

I do note that the site is no longer displaying the price with tax as selected in the admin.

Looking further.:(

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

24 Nov 2023, 8:16 AM
#12
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

Okay, I installed a fresh 1.5.8a with no demo

Configuration >> My Store >> Basis of Product Tax and Basis of Shipping Tax set to Store

Display Prices with Tax to true

Single $100 product added and set as Taxable Goods

Payment is only Check/Money Order

Shipping is Flat Rate set at $5.50, Taxable Goods, Tax Basis - Store

Zone Definitions show Florida and described as Florida local sales tax zone

Tax Classes set to Taxable Goods

Tax Rates is set to Taxable Goods, Zone - Florida, Tax Rate - 10%

Logged in a customer from Texas and the item price changed to $100.

Page 1 of checkout showed Flat Rate at $5.50

Page 2 showed a Sub-Total of $100, a Flat Rate of $5.50, and a total of $105.50

Finally, I was presented a bill for $105.50 at Page 3 of standard checkout. No tax.

Before clicking on the confirm order, I clicked on Shopping Cart and the item showed a price of $100 versus the $110 prior to logging in.

Logged out and went to the product again. The price shown was $110.

:frusty:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

24 Nov 2023, 5:00 PM
#13
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

My initial feeling was that possibly that something in the display prices with tax was not playing well with all the other settings.

I removed just that setting and created a completely new user only to have the same results.

I have even ensured that the Initial Setup Wizard is a valid Miami address and that the Podtal Code under Shipping/Packaging is set to 33130.

I will be glad to furnish access to the test site. This customer is having to pay $$$$ in tax that they are not able to collect.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

28 Nov 2023, 6:03 AM
#14
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

More info since we can't bump:P

The site had EO 4.6.2 installed and, of course, it was not working.

I noticed work on 4.7.0 on GitHub and removed all 4.6.2 EO and installed 4.7.0 with the optional overrides.

EO seems to work but, on the edit page, I get the > Warning: You have configured Zen Cart to display prices without tax. This page is currently displaying prices with tax.. The database reports that the setting IS set to true.

I know you said that you have not tested EO with that feature so, I turned on the debug and got the following:

2023-11-27 22:52:38, Edit Orders entered (4.7.0-beta2) action (edit)Enabled Order Totals: ot_subtotal.php;ot_shipping.php;ot_coupon.php;ot_group_pricing.php;ot_tax.php;ot_loworderfee.php;ot_gv.php;ot_total.php
getOrderInfo(edit), on entry: Called by /home/******/public_html/##########/edit_orders.php on line #112
    Subtotal: (not set), Shipping: (not set), Shipping Tax-Rate:  (not set), Shipping Tax-Description:  (not set), Shipping Tax: (not set), Tax: 0.0000, Total: 40.5500, Tax Groups: {"0.0000":"1"}
    $_SESSION['shipping']: (not set)


Order Totals
        ot_subtotal. Text: $34.95, Value: 34.9500
        ot_shipping. Text: $5.60, Value: 5.6000
        ot_tax. Text: $0.00, Value: 0.0000
        ot_total. Text: $40.55, Value: 40.5500




getProductTaxes(Tax)
{"products_tax_class_id":"1"}{"qty":1,"id":"324","orders_products_id":"2398","name":"Texas Horned Lizard Pewter Figurines","model":"1111-0203 1\"","tax":"0.0000","price":"0.0000","final_price":"34.9500","onetime_charges":"0.0000","products_priced_by_attribute":"1","product_is_free":"0","products_discount_type":"0","products_discount_type_from":"0","products_weight":"0.247","products_virtual":0,"product_is_always_free_shipping":0,"products_quantity_order_min":"1","products_quantity_order_units":"1","products_quantity_order_max":"0","products_quantity_mixed":1,"products_mixed_discount_quantity":0,"attributes":[{"option":"Size:","value":"Stretch 4 inches","option_id":"2","value_id":"13","prefix":"+","price":"34.9500","product_attribute_is_free":1}]}
getProductTaxes, returning 0.


eo_get_country, returning modified country array: {"id":"223","title":"United States","iso_code_2":"US","iso_code_3":"USA"}
eo_get_country, returning modified country array: {"id":"223","title":"United States","iso_code_2":"US","iso_code_3":"USA"}
eo_get_country, returning modified country array: {"id":"223","title":"United States","iso_code_2":"US","iso_code_3":"USA"}
getOrderInfo(edit), on exit:


    Subtotal: 34.9500, Shipping: (not set), Shipping Tax-Rate:  (not set), Shipping Tax-Description:  (not set), Shipping Tax: (not set), Tax: 0.0000, Total: 40.5500, Tax Groups: {"Tax":0}
    $_SESSION['shipping']: (not set)


Order Totals
        ot_subtotal. Text: $34.95, Value: 34.9500
        ot_shipping. Text: $5.60, Value: 5.6000
        ot_tax. Text: $0.00, Value: 0.0000
        ot_total. Text: $40.55, Value: 40.5500


eoInitializeShipping(1559, edit), on entry: 
    Subtotal: 34.9500, Shipping: (not set), Shipping Tax-Rate:  (not set), Shipping Tax-Description:  (not set), Shipping Tax: (not set), Tax: 0.0000, Total: 40.5500, Tax Groups: {"Tax":0}
    $_SESSION['shipping']: (not set)


Order Totals
        ot_subtotal. Text: $34.95, Value: 34.9500
        ot_shipping. Text: $5.60, Value: 5.6000
        ot_tax. Text: $0.00, Value: 0.0000
        ot_total. Text: $40.55, Value: 40.5500


calculateOrderShippingTax returning 0, rate = '0.0000', cost = 5.6000.
removeTaxFromShippingCost, updated: 1, 5.6000, 5.6, 0
eoInitializeShipping(1559, edit), on exit: 
    Subtotal: 34.9500, Shipping: 5.6, Shipping Tax-Rate: 0.0000, Shipping Tax-Description:  (not set), Shipping Tax: 0, Tax: 0, Total: 40.5500, Tax Groups: {"Tax":0}
    $_SESSION['shipping']: {"title":"United States Postal Service (USPS Ground Advantage™)","id":"usps_","cost":"5.6000"}


Order Totals
        ot_subtotal. Text: $34.95, Value: 34.9500
        ot_shipping. Text: $5.60, Value: 5.6000
        ot_tax. Text: $0.00, Value: 0.0000
        ot_total. Text: $40.55, Value: 40.5500


    Checking whether the product's attribute is a download, option_id = 2, value_id = 13: (1)


Checking order for virtual status.  Order contains 1 unique products, 0 of those are virtual


============================================================
= Creating display of Order Product #2398
============================================================
Product Details:
{
    "qty": 1,
    "id": "324",
    "orders_products_id": "2398",
    "name": "Texas Horned Lizard Pewter Figurines",
    "model": "1111-0203 1\"",
    "tax": "0.0000",
    "price": "0.0000",
    "final_price": "34.9500",
    "onetime_charges": "0.0000",
    "products_priced_by_attribute": "1",
    "product_is_free": "0",
    "products_discount_type": "0",
    "products_discount_type_from": "0",
    "products_weight": "0.247",
    "products_virtual": 0,
    "product_is_always_free_shipping": 0,
    "products_quantity_order_min": "1",
    "products_quantity_order_units": "1",
    "products_quantity_order_max": "0",
    "products_quantity_mixed": 1,
    "products_mixed_discount_quantity": 0,
    "attributes": [
        {
            "option": "Size:",
            "value": "Stretch 4 inches",
            "option_id": "2",
            "value_id": "13",
            "prefix": "+",
            "price": "34.9500",
            "product_attribute_is_free": 1
        }
    ]
}




Options ID #2
Product Attribute: 
[
    "1849"
]
Options Info:
{
    "options": {
        "1828": "Please Select Size:",
        "1829": "1 inch",
        "1830": "1 1\/4 inches",
        "1831": "1 3\/4 inches",
        "1832": "2 inches",
        "1840": "2.2 inches",
        "1833": "Up Tail 2 1\/2 inches",
        "1834": "3 inch",
        "1835": "Out Tail 3 1\/2 inches",
        "1836": "Stretch 4 inches",
        "1837": "5 inches",
        "1839": "7 inches"
    },
    "name": "Size:",
    "type": "2",
    "length": "32",
    "size": "32",
    "rows": "0"
}
Preparing to display status history: {
    "date_added": {
        "title": "Date Added",
        "show_function": "zen_datetime_short",
        "include_field_name": false
    },
    "customer_notified": {
        "title": "Customer Notified",
        "show_function": "eo_display_customers_notifications_icon",
        "align": "center",
        "include_field_name": false
    },
    "orders_status_id": {
        "title": "Status",
        "show_function": "built-in"
    },
    "comments": {
        "title": "Comments",
        "show_function": "built-in"
    },
    "updated_by": {
        "title": "Updated By",
        "align": "center",
        "show_function": "built-in"
    }
}
```Perhaps this additional information can get us on the right track

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

28 Nov 2023, 6:21 AM
#15
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

Looking further, EO will change and add the tax on the EO page when the tax is correctly entered as 7.75%.

However, although the tax is shown on the form, it is not added into the total.

The order's invoice also shows the tax but it is not included in the total.

When looking at an in-state order, the tax rate is not shown but the tax is shown below above the total.

As in the other scenario, the Total does not include the tax.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

29 Nov 2023, 4:55 AM
#16
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

dbltoe:

Okay, I installed a fresh 1.5.8a with no demo

Configuration >> My Store >> Basis of Product Tax and Basis of Shipping Tax set to Store

Display Prices with Tax to true

Single $100 product added and set as Taxable Goods

Payment is only Check/Money Order

Shipping is Flat Rate set at $5.50, Taxable Goods, Tax Basis - Store

Zone Definitions show Florida and described as Florida local sales tax zone

Tax Classes set to Taxable Goods

Tax Rates is set to Taxable Goods, Zone - Florida, Tax Rate - 10%

Logged in a customer from Texas and the item price changed to $100.

Page 1 of checkout showed Flat Rate at $5.50

Page 2 showed a Sub-Total of $100, a Flat Rate of $5.50, and a total of $105.50

Finally, I was presented a bill for $105.50 at Page 3 of standard checkout. No tax.

Before clicking on the confirm order, I clicked on Shopping Cart and the item showed a price of $100 versus the $110 prior to logging in.

Logged out and went to the product again. The price shown was $110.

:frusty:
And, in further hopes of getting this :censored: bug fixed.....

I loaded EO 4.70 beta to the test site. It is the only mod.

EO reports that I do not have taxes set to Displa with Price yet the Configuration and DB say I do.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

29 Nov 2023, 12:23 PM
#17
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Incorrect processing of Tax

EO was probably complaining about the fact that you're displaying with taxes on the storefront but not in the admin, as it has for many many years now.

I'll grant that there's an issue here; how about you open the issue on GitHub? I'm kind of heads-down on another project at the current time.

29 Nov 2023, 3:22 PM
#18
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Re: Incorrect processing of Tax

EO or ZC?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

29 Nov 2023, 8:25 PM
#19
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Incorrect processing of Tax

It's a base Zen Cart issue.

29 Nov 2023, 10:09 PM
#20
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,950
Plugin Contributions:
3

Re: Incorrect processing of Tax

have been looking at this and have found a couple of code issues that will be affecting this in the zen_get_tax_locations function
hoping to have a fix asap