Re: Local Sales Tax Mod - Support Thread
It seems this plug-in (v2.6) doesn't work well with the zc group pricing (zc 1.57d). The tax rate is calculated based on the sub-total rate (before the group discount). The discount amount by group pricing is not used to calculate the tax. In the settings of my group discount, I set "Re-calculate Tax" option as standard, so the tax should be based on the sub-total minus discount amount.
I tried to set this option as "none" or "credit note", the result is unchanged. So it looks like no matter which option I set, it will be treated as "none".
This bug is not critical but hopefully it can be fixed later.
Re: Local Sales Tax Mod - Support Thread
If you look at includes/modules/order_total/ot_local_sales_taxes.php line 129-139 - the block that starts with
if ($apply_tax_to_shipping) {
You could use some similar logic to back out the tax on the group discount amount.
Re: Local Sales Tax Mod - Support Thread
Hi Swguy,
Thanks for your tip. I added the following code below your mentioned "if ($apply_tax_to_shipping)" section, and now it shows the correct group discount amount (calculated based on the total minus group discount). I don't think this way is proper but I don't know how to get the discount amount from the group pricing php file. I don't know if there is a public parameter for the group discount which I can use in this tax php file.
$tax_total_for_class_group_discount = '';
$tax_total_for_class_group_discount = zen_calculate_tax (($order->info['total'] - $order->info['tax'] - $order->info['shipping_cost']), $taxrec['tax']);
$tax_total_for_class = $tax_total_for_class_group_discount;
Also, now the total amount (last line of the checkout page) is incorrect/unchanged. How can I update the total amount?
Re: Local Sales Tax Mod - Support Thread
Ok. The following code fixed the incorrect total amount issue. Still, I'm not sure if it is the proper way...
PHP Code:
$tax_total_for_class_group_discount = '';
$tax_total_diff = '';
$tax_total_for_class_group_discount = zen_calculate_tax (($order->info['total'] - $order->info['tax'] - $order->info['shipping_cost']), $taxrec['tax']);
$tax_total_diff = $tax_total_for_class - $tax_total_for_class_group_discount;
if($tax_total_diff > 0) {
$order->info['total'] -= $tax_total_diff;
$tax_total_for_class = $tax_total_for_class_group_discount;
}
Re: Local Sales Tax Mod - Support Thread
Found that I was getting thrown Fatal errors on ZC 1.5.8/PHP 8.2 when trying to edit a tax rate in the backend. (When you would insert a row and click edit, you would not get the edit form and would generate a bunch of PHP errors in the log directory.) I made the following changes to get it to work:
1. Open YOUR_ADMIN/local_sales_taxes.php.
2. Edit line 255. Find
PHP Code:
zen_get_countries(TEXT_ALL_COUNTRIES)
and replace with:
PHP Code:
zen_get_countries_for_admin_pulldown()
.
3. Edit line 272. Find
PHP Code:
zen_get_countries(TEXT_ALL_COUNTRIES)
and replace with:
PHP Code:
zen_get_countries_for_admin_pulldown()
.
This should fix the error in 1.5.8a.
Re: Local Sales Tax Mod - Support Thread
Looking for help.
Running the module, as is, running into two problems.
First, the module is adding the result local sales tax twice. I configured it for New York City which is New York State's 4% Sales Tax + NYC's 4.875%. Which totals 8.875%.
However, running an order through: The total tax being calculated is: The "state" sales tax of 4% + The City Tax of 4.875% + The City Tax of 4.875%. I went through and made sure the entry for the City was only entered once. But I cannot see where to stop the tax is being calculated twice.
Additionally, when the order is ran against a payment module: say PayPal, Stripe, Square, etc., the local sales tax module is completely bypassed and ignored.
Debugging the cart, I can see the per item tax is being calculated as 13.75% (aka 4% + 4.875% + 4.875%) and that the tax description is "State Tax + County Tax + County Tax".
Looking for any assistance on the matter.
EDIT: Seems this is kind of a known issue of sorts (https://www.zen-cart.com/showthread....-Sales-Tax-mod)
Re: Local Sales Tax Mod - Support Thread
Quote:
Originally Posted by
retched
Looking for help.
Running the module, as is, running into two problems.
First, the module is adding the result local sales tax twice. I configured it for New York City which is New York State's 4% Sales Tax + NYC's 4.875%. Which totals 8.875%.
However, running an order through: The total tax being calculated is: The "state" sales tax of 4% + The City Tax of 4.875% + The City Tax of 4.875%. I went through and made sure the entry for the City was only entered once. But I cannot see where to stop the tax is being calculated twice.
Additionally, when the order is ran against a payment module: say PayPal, Stripe, Square, etc., the local sales tax module is completely bypassed and ignored.
Debugging the cart, I can see the per item tax is being calculated as 13.75% (aka 4% + 4.875% + 4.875%) and that the tax description is "State Tax + County Tax + County Tax".
Looking for any assistance on the matter.
EDIT: Seems this is kind of a known issue of sorts (
https://www.zen-cart.com/showthread....-Sales-Tax-mod)
Just my 2C.
When I installed this plug-in, I disabled the original tax rate for my state, which is under locations/taxes - Tax Rates. I set the tax rate there to 0. I didn't delete it there. Then I only use local sales tax to calculate the total tax rate for every zipcode.
I'm not sure, if I didn't disable the zc tax rate, will it be double counted or not.
For your 2nd question, I'm using paypal legacy module. So on paypal end, it cannot see how much tax was charged for every order. But the total order amount is correct (goods+shipping+tax). In the past before I installed this plug-in, I can see a separate row in paypal transaction showing the tax.
But for other places such as order confirmation email or zc back end order details, I can see a separate row for the sales tax.
Re: Local Sales Tax Mod - Support Thread
Quote:
Originally Posted by
njcyx
Just my 2C.
When I installed this plug-in, I disabled the original tax rate for my state, which is under locations/taxes - Tax Rates. I set the tax rate there to 0. I didn't delete it there. Then I only use local sales tax to calculate the total tax rate for every zipcode.
I'm not sure, if I didn't disable the zc tax rate, will it be double counted or not.
For your 2nd question, I'm using paypal legacy module. So on paypal end, it cannot see how much tax was charged for every order. But the total order amount is correct (goods+shipping+tax). In the past before I installed this plug-in, I can see a separate row in paypal transaction showing the tax.
But for other places such as order confirmation email or zc back end order details, I can see a separate row for the sales tax.
Actually managed to get it to work with the Squash Taxes module (they should just be combined at this point). I'm working on submitting my changes to both shortly. Still don't see why it was being added twice.
Re: Local Sales Tax Mod - Support Thread
> Still don't see why it was being added twice.
I have seen the same issue. The order line items all look good, but the entry in orders_products.products_tax is doubled, as you note.
Re: Local Sales Tax Mod - Support Thread
v3.0.0 of Local Sales Tax is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=422
Released as a Zen Cart encapsulated plugin, supporting zc210+, EO 5.0.0+ and PHP 8.0+.