From 5f48b7b9326906ed377bdccebf919b52cf0cf4fa Mon Sep 17 00:00:00 2001 From: oleonard Date: Thu, 17 Feb 2005 17:56:58 +0000 Subject: [PATCH] - formatting currency values - fixing table row color toggle, and moving color values to the template (requires update to template) --- admin/itemtypes.pl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index 64fe84aa64..bcace58c0c 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -104,7 +104,7 @@ if ($op eq 'add_form') { $template->param(itemtype => $itemtype, description => $data->{'description'}, renewalsallowed => $data->{'renewalsallowed'}, - rentalcharge => $data->{'rentalcharge'}, + rentalcharge => sprintf("%.2f",$data->{'rentalcharge'}), notforloan => $data->{'notforloan'} ); ; @@ -145,7 +145,7 @@ if ($op eq 'add_form') { $template->param(itemtype => $itemtype, description => $data->{'description'}, renewalsallowed => $data->{'renewalsallowed'}, - rentalcharge => $data->{'rentalcharge'}, + rentalcharge => sprintf("%.2f",$data->{'rentalcharge'}), total => $total); # END $OP eq DELETE_CONFIRM ################## DELETE_CONFIRMED ################################## @@ -166,19 +166,20 @@ if ($op eq 'add_form') { } else { # DEFAULT my $env; my ($count,$results)=StringSearch($env,$searchfield,'web'); - my $toggle="white"; + my $toggle=0; my @loop_data; for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){ my %row_data; - if ($toggle eq 'white'){ - $row_data{toggle}="#ffffcc"; + if ($toggle eq 0){ + $toggle=1; } else { - $row_data{toggle}="white"; + $toggle=0; } + $row_data{toggle} = $toggle; $row_data{itemtype} = $results->[$i]{'itemtype'}; $row_data{description} = $results->[$i]{'description'}; $row_data{renewalsallowed} = $results->[$i]{'renewalsallowed'}; - $row_data{rentalcharge} = $results->[$i]{'rentalcharge'}; + $row_data{rentalcharge} = sprintf("%.2f",$results->[$i]{'rentalcharge'}); push(@loop_data, \%row_data); } $template->param(loop => \@loop_data); -- 2.39.5