Forums / Bug Reports / [Done v1.3.9b] Tax name wont show up on order if tax is 0.00

[Done v1.3.9b] Tax name wont show up on order if tax is 0.00

Locked

Started by argyle on 24 Apr 2010, 4:22 AM · Views: 5,136

Results 21 to 28 of 28
This thread is locked. New replies are disabled.
30 Apr 2010, 1:41 PM
#21
decostyle avatar

decostyle

Zen Follower

Join Date:
Mar 2008
Posts:
336
Plugin Contributions:
0

[Done v1.3.9b] Tax name wont show up on order if tax is 0.00

Another update to give the DEVS more info:

Fresh install of 1.3.9a
No tax exempt module installed.
Tax set to display even when 0

Result:
No description appears, only ":$0.00"

1.3.8a having the same same settings with tax set to display even when 0 correctly shows description as "Sales Tax: $0.00". Seems like from 1.3.8a to 1.3.9a some bug fixes on the Tax calculation may have broken something.

Hope that helps!

Thanks for helping Rod. Right now am doing upgrade testing and am stuck because of this which would be a problem on our wholesale site.

30 Apr 2010, 8:41 PM
#22
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [Done v1.3.9b] Tax name wont show up on order if tax is 0.00

A fix for this is included in the upcoming v1.3.9b which we hope to release any day.
Carry on with the rest of your upgrade. Applying the 139b updates will be very quick if you're already done upgrading to 139a ;)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 May 2010, 2:29 AM
#23
gg01 avatar

gg01

New Zenner

Join Date:
Jul 2008
Location:
Ontario, Canada
Posts:
85
Plugin Contributions:
0

Re: [Done v1.3.9b] Tax name wont show up on order if tax is 0.00

Upgraded to 1.3.9b
Show Tax Display Status is set to 1 (show even when $0) after the upgrade tax lines that are not applicable to my customer are showing... they are technically $0 :smile: but since they don't apply to this customer they should not show:

Ontario Customer:
Sub-Total: $64.00
Shipping: $9.95
8% PST: $5.12
5% GST: $3.20
8% PST + 5% GST: $1.29
13% HST $0.00 (should not show - only for Eastern Canada NS, NF, NB)
Tax Exempt: $0.00 (for US customers only)
Total: $83.56

Any suggestions other than moving the 1.3.9a file back over?
Thanks!

3 May 2010, 5:51 AM
#24
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [Done v1.3.9b] Tax name wont show up on order if tax is 0.00

You have two options:

a) set it to NOT display $0 when it comes to zero. (Most north american customers will be fine with that, and you're talking about such customers in your example)
b) let them show the $0 anyway, as it's no difference in the end ... they're not charged the tax that doesn't apply to them

Meanwhile, we'll look at the code some more.

The code changes for that from 1.3.9a to 1.3.9b were not contained in just one file. It was more complicated than that ;)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 May 2010, 6:09 AM
#25
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: [Done v1.3.9b] Tax name wont show up on order if tax is 0.00

That was quite a chunk of code change between 1.3.9a & b wasn't it.

I'm not trying to be a smartass or anything, but something like I proposed earlier really may the the best solution, namely:

"possibly output a simple "TAX = $0.00" for those times where the description of a zero value is either indeterminate or consists of multple tax classes each with a zero value"

I didn't realise it when I suggested that, but I reckon it must have been in the back of my mind that outputting multiple tax classes each with a zero value would probably confuse/upset some people.

I never got around to trying my own suggestion though and it may not be as quite straightforward to implement as I imagine.

I'm also not 'happy' with the suggestion to use the text "TAX" as the generic output string... perhaps a DEFINE?

Cheers
Rod.

ps. Response not required/expected. You've better things to do :-)

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

3 May 2010, 6:49 PM
#26
wilt avatar

wilt

Oji-san

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

Re: [Done v1.3.9b] Tax name wont show up on order if tax is 0.00

k, currently testing this as a final fix.

n.b. this applies to 1.3.9b code only

in includes/functions/functions_taxes.php

the final function should be zen_get_all_tax_descriptions

you should replace that function with the code below

 function zen_get_all_tax_descriptions($country_id = -1, $zone_id = -1) 
 {
   global $db;
    if ( ($country_id == -1) && ($zone_id == -1) ) {
      if (isset($_SESSION['customer_id'])) {
        $country_id = $_SESSION['customer_country_id'];
        $zone_id = $_SESSION['customer_zone_id'];
      } else {
        $country_id = STORE_COUNTRY;
        $zone_id = STORE_ZONE;
      }
    }
    
   $sql = "select tr.* 
                  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 . "')";
   $result = $db->Execute($sql);
   $taxDescriptions =array();
   while (!$result->EOF)
   {
     $taxDescriptions[] = $result->fields['tax_description'];
     $result->moveNext();
   }
   return $taxDescriptions;
 }
4 May 2010, 9:04 AM
#27
argyle avatar

argyle

New Zenner

Join Date:
Sep 2009
Posts:
71
Plugin Contributions:
0

Re: [Done v1.3.9b] Tax name wont show up on order if tax is 0.00

Thx for fixing this! Great work here guys!

4 May 2010, 9:15 AM
#28
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: [Done v1.3.9b] Tax name wont show up on order if tax is 0.00

Argyle:

Thx for fixing this! Great work here guys!

Who'd have thought that fixing "nothing" would have caused such a lot of head scratching and so much code?

Certainly not me.:blink:

I'm sure wilt will be pleased to know that it's finally right this time (so far). ;-)

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.