Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / [Done 1.3.9] When deleting tax rate in Admin, value appears to be rounded (1.3.8a)

[Done 1.3.9] When deleting tax rate in Admin, value appears to be rounded (1.3.8a)

Locked

Started by alex_clarke on 8 Dec 2008, 3:59 PM · Views: 1,469

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
8 Dec 2008, 3:59 PM
#1
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Post #1 by alex_clarke

When deleting a tax rate the following message is displayed.

Are you sure you want to delete this tax rate?

Taxable Goods 18%

My tax rate was set at 17.5%, however it appears to have been rounded up when displayed in this message.

Only a minor bug here (unless it affects tax calculations in other areas of Zen Cart).

My Contributions: Zen Lightbox | Best Sellers Reloaded

8 Dec 2008, 4:11 PM
#2
drbyte avatar

drbyte

Sensei

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

Post #2 by drbyte

Yes, this is a display-only issue. The displayed rate is incorrectly being formatted to the number of digits set in the My Store area for tax decimal places. That value should not be applied to rates, but only to amounts calculated by those rates.

Edit /admin/tax_rates.php
and change this line:

      $contents[] = array('text' => '<br><b>' . $trInfo->tax_class_title . ' ' . [B]number_format([/B]$trInfo->tax_rate[B], TAX_DECIMAL_PLACES) .[/B] '%</b>');

to:```
$contents[] = array('text' => '<br><b>' . $trInfo->tax_class_title . ' ' . $trInfo->tax_rate . '%</b>');

.
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.

8 Dec 2008, 4:41 PM
#3
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Post #3 by alex_clarke

Thanks for the speedy fix DrByte.

You've gotta love the little bugs! :P

My Contributions: Zen Lightbox | Best Sellers Reloaded