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.