Forums / Currencies & Sales Taxes, VAT, GST, etc. / Charge only one tax from resellers

Charge only one tax from resellers

Views: 11,452

Results 21 to 25 of 25
2 Aug 2008, 5:03 AM
#21
veronika7747 avatar

veronika7747

Zen Follower

Join Date:
Nov 2007
Posts:
270
Plugin Contributions:
0

Charge only one tax from resellers

harmeet:

Hi scully2569

I was not sure if anybody else needs this. I am not expert, but I managed to hack the code to my needs. Here is how I did it -

Please note that you need to have the "dual_pricing_1_3" module installed before making this change.

Open the file includes/functions/functions_taxes.php

Close to line 32, look for -

$tax_query = "select sum(tax_rate) as tax_rate
              from (" . TABLE_TAX_RATES . " tr
              left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id)
              left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) )
              where (za.zone_country_id is null
              or za.zone_country_id = 0
              or za.zone_country_id = '" . (int)$country_id . "')
              and (za.zone_id is null
              or za.zone_id = 0
              or za.zone_id = '" . (int)$zone_id . "')
              and tr.tax_class_id = '" . (int)$class_id . "'
              group by tr.tax_priority";
> 
> Replace it with -
> 
> ```php
// KLUDGE START by Harmeet - To charge only GST from resellers.
if ($_SESSION['customer_id']) {
	$customers_id = $_SESSION['customer_id'];
	$customer_check = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '$customers_id'");
	if ($customer_check->fields['customers_whole'] != "0") {
		$whole = 1;
	}
}
if ($whole) {
    $tax_query = "select tax_rate as tax_rate
                  from (" . TABLE_TAX_RATES . " tr
                  left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id)
                  left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) )
                  where (za.zone_country_id is null
                  or za.zone_country_id = 0
                  or za.zone_country_id = '" . (int)$country_id . "')
                  and (za.zone_id is null
                  or za.zone_id = 0
                  or za.zone_id = '" . (int)$zone_id . "')
                  and tr.tax_class_id = '" . (int)$class_id . "'
                  group by tr.tax_priority";
}
else {
// KLUDGE END
    $tax_query = "select sum(tax_rate) as tax_rate
                  from (" . TABLE_TAX_RATES . " tr
                  left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id)
                  left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) )
                  where (za.zone_country_id is null
                  or za.zone_country_id = 0
                  or za.zone_country_id = '" . (int)$country_id . "')
                  and (za.zone_id is null
                  or za.zone_id = 0
                  or za.zone_id = '" . (int)$zone_id . "')
                  and tr.tax_class_id = '" . (int)$class_id . "'
                  group by tr.tax_priority";
// KLUDGE START by Harmeet - To charge only GST from resellers.
}
// KLUDGE END

Close to line 78, look for -

if ($tax->RecordCount() > 0) {
  $tax_description = '';
  while (!$tax->EOF) {
    $tax_description .= $tax->fields['tax_description'] . ' + ';
    $tax->MoveNext();
  }
  $tax_description = substr($tax_description, 0, -3);

  return $tax_description;
} else {
  return TEXT_UNKNOWN_TAX_RATE;
}
> 
> Replace it with -
> 
> ```php
// KLUDGE START by Harmeet - To charge only GST from resellers.
  if ($_SESSION['customer_id']) {
	$customers_id = $_SESSION['customer_id'];
	$customer_check = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '$customers_id'");
	if ($customer_check->fields['customers_whole'] != "0") {
		$whole = 1;
	}
  }
  if ($whole) {
    if ($tax->RecordCount() > 0) {
      $tax_description = $tax->fields['tax_description'] . ' + ';
      $tax_description = substr($tax_description, 0, -3);
      return $tax_description;
    } else {
      return TEXT_UNKNOWN_TAX_RATE;
    }
  }
  else {
// KLUDGE END
    if ($tax->RecordCount() > 0) {
      $tax_description = '';
      while (!$tax->EOF) {
        $tax_description .= $tax->fields['tax_description'] . ' + ';
        $tax->MoveNext();
      }
      $tax_description = substr($tax_description, 0, -3);

      return $tax_description;
    } else {
      return TEXT_UNKNOWN_TAX_RATE;
    }
// KLUDGE START by Harmeet - To charge only GST from resellers.
  }
// KLUDGE END

Hope it works for you.

Thanks
I know this is 2 years old, but I tried it with the new Dual Pricing/Wholesale module, but it works only for wholesale levels. When I have a retailer (indicated as wholesale level 0) it also does not include PST.
Anyone got it working??
Tx Veronika

2 Aug 2008, 4:06 PM
#22
veronika7747 avatar

veronika7747

Zen Follower

Join Date:
Nov 2007
Posts:
270
Plugin Contributions:
0

Re: Charge only one tax from resellers

Veronika7747:

I know this is 2 years old, but I tried it with the new Dual Pricing/Wholesale module, but it works only for wholesale levels. When I have a retailer (indicated as wholesale level 0) it also does not include PST.
Anyone got it working??
Tx Veronika

I got this working, but now I have a problem with HST for wholesalers in Eastern Canada ( ns, nf, nb) as they are still being charged 13% HST. I am assuming their HST should also drop the 8% PST, right?
Any comments
Tx

22 Aug 2008, 8:06 PM
#23
gpx_nyc avatar

gpx_nyc

New Zenner

Join Date:
Aug 2008
Posts:
1
Plugin Contributions:
0

Re: Charge only one tax from resellers

fraso:

I see that the Dual Pricing - Wholesale Pricing download (modified with Harmeet's changes) allows a customer to be set up as a wholesale customer who is tax-exempt. However, the Tax Exemption Status download seems to do something similar.

I would like to set my store up as follows:

  • retail prices shown to the general public.
  • wholesale prices shown only to wholesale customers once they have logged-in.
  • wholesale customers are exempt from paying provincial retail sales tax once they provide their tax exemption number.
  • quantity-based discounts for wholesale customers and possibly also for retail customers.What would be the best way to accomplish this?

Frank

supersnow:

This is exactly what we are looking for except that we are located in California USA and we would be having our wholesale customers to be exempt from CA sales tax once they provide their seller's permit.

Did you find a solution. I have looked at the dual pricing and other modules but none seem to do exactly what we need and I am afraid of combining them as I am scared of breaking my shop.

We really only want to give discounts to our wholesale customers that we want to approve first and only on a quantity discount basis.

Any help?????

I'm running Zen Cart v1.3.8a and is able to setup the following by installing the Dual Pricing - Wholesale Pricing v1.4.2 and Customer Tax Exempt v1.12.

[*]retail prices shown to the general public.

[*]wholesale prices shown only to wholesale customers once they have logged-in.

[*]wholesale customers are exempt from paying provincial retail sales tax once they provide their tax exemption number.

Just installed both mods, extract and upload (replace) the attached customers.php to the admin folder. I have combined the codes from both mods.

You can then grant wholesale status and tax exempt status on admin->customers. (In my case, I entered "1" for Wholesale pricing level and "New York State Sales Tax" completely for Customer Tax Exempt.)

It's working fine for me :clap: but keep in mind that use this AT YOUR OWN RISK! :lamo:

20 Feb 2009, 5:40 AM
#24
Join Date:
Feb 2009
Location:
Ontario, Canada
Posts:
24
Plugin Contributions:
0

Re: Charge only one tax from resellers

GPX_NYC:

I'm running Zen Cart v1.3.8a and is able to setup the following by installing the Dual Pricing - Wholesale Pricing v1.4.2 and Customer Tax Exempt v1.12.

[*]retail prices shown to the general public.

[*]wholesale prices shown only to wholesale customers once they have logged-in.

[*]wholesale customers are exempt from paying provincial retail sales tax once they provide their tax exemption number.

Just installed both mods, extract and upload (replace) the attached customers.php to the admin folder. I have combined the codes from both mods.

You can then grant wholesale status and tax exempt status on admin->customers. (In my case, I entered "1" for Wholesale pricing level and "New York State Sales Tax" completely for Customer Tax Exempt.)

It's working fine for me :clap: but keep in mind that use this AT YOUR OWN RISK! :lamo:

THANK YOU. THANK YOU, THANK YOU....This worked PERFECTLY AMAZING for me. Just the thing I've been trying to do for the past 5 hrs. Life saver. Thanks again.

PS....You should put this in the Software Add Ons sections for others like us.

Stephan Mantha CEO
The Mogensen Moccasin Company Ltd

13 Jun 2011, 12:06 PM
#25
brandwijk avatar

brandwijk

New Zenner

Join Date:
May 2007
Location:
Netherlands
Posts:
6
Plugin Contributions:
0

Re: Charge only one tax from resellers

I installed Dual Pricing and it works fine. BUT, I have one problem: I want to show the prices for the wholesalers without tax and for all others with tax. Of course at the end everybode have to pay the tax.

Anybody an idea???

Dirk