From 9d1c8fa9d2815fa5651dbe264699caed65eea853 Mon Sep 17 00:00:00 2001 From: sushi Date: Wed, 7 Jun 2006 02:36:24 +0000 Subject: [PATCH] perltidy before next commit. --- acqui/acqui-home.pl | 103 +++++++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 48 deletions(-) diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index 20082c9f34..ae36ad5cd3 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -11,29 +11,33 @@ use HTML::Template; use C4::Acquisition; my $query = new CGI; -my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "acqui/acqui-home.tmpl", - query => $query, - type => "intranet", - authnotrequired => 0, - flagsrequired => {acquisition => 1}, - debug => 1, - }); +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "acqui/acqui-home.tmpl", + query => $query, + type => "intranet", + authnotrequired => 0, + flagsrequired => { acquisition => 1 }, + debug => 1, + } +); # budget -my $dbh = C4::Context->dbh; -my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?"); +my $dbh = C4::Context->dbh; +my $sthtemp = + $dbh->prepare( + "Select flags, branchcode from borrowers where borrowernumber = ?"); $sthtemp->execute($loggedinuser); -my ($flags, $homebranch)=$sthtemp->fetchrow; +my ( $flags, $homebranch ) = $sthtemp->fetchrow; -my ($count,@results)=bookfunds($homebranch); -my $classlist=''; -my $total=0; -my $totspent=0; -my $totcomtd=0; -my $totavail=0; +my ( $count, @results ) = bookfunds($homebranch); +my $classlist = ''; +my $total = 0; +my $totspent = 0; +my $totcomtd = 0; +my $totavail = 0; my @loop_budget = (); -for (my $i=0;$i<$count;$i++){ +for ( my $i = 0 ; $i < $count ; $i++ ) { if ( $toggle eq 0 ) { $toggle = 1; @@ -41,44 +45,47 @@ for (my $i=0;$i<$count;$i++){ else { $toggle = 0; } - my ($spent,$comtd)=bookfundbreakdown($results[$i]->{'bookfundid'}); - my $avail=$results[$i]->{'budgetamount'}-($spent+$comtd); - my %line; + my ( $spent, $comtd ) = bookfundbreakdown( $results[$i]->{'bookfundid'} ); + my $avail = $results[$i]->{'budgetamount'} - ( $spent + $comtd ); + my %line; - $line{bookfundname} = $results[$i]->{'bookfundname'}; - $line{budgetamount} = $results[$i]->{'budgetamount'}; - $line{spent} = sprintf ("%.2f", $spent); - $line{comtd} = sprintf ("%.2f",$comtd); - $line{avail} = sprintf ("%.2f",$avail); - $line{'toggle'} = $toggle; - push @loop_budget, \%line; - $total+=$results[$i]->{'budgetamount'}; - $totspent+=$spent; - $totcomtd+=$comtd; - $totavail+=$avail; + $line{bookfundname} = $results[$i]->{'bookfundname'}; + $line{budgetamount} = $results[$i]->{'budgetamount'}; + $line{spent} = sprintf( "%.2f", $spent ); + $line{comtd} = sprintf( "%.2f", $comtd ); + $line{avail} = sprintf( "%.2f", $avail ); + $line{'toggle'} = $toggle; + push @loop_budget, \%line; + $total += $results[$i]->{'budgetamount'}; + $totspent += $spent; + $totcomtd += $comtd; + $totavail += $avail; } + #currencies my $rates; -($count,$rates)=getcurrencies(); +( $count, $rates ) = getcurrencies(); my @loop_currency = (); -for (my $i=0;$i<$count;$i++){ - my %line; - $line{currency} = $rates->[$i]->{'currency'}; - $line{rate} = $rates->[$i]->{'rate'}; - push @loop_currency, \%line; +for ( my $i = 0 ; $i < $count ; $i++ ) { + my %line; + $line{currency} = $rates->[$i]->{'currency'}; + $line{rate} = $rates->[$i]->{'rate'}; + push @loop_currency, \%line; } # suggestions ? my $suggestion = countsuggestion("ASKED"); -$template->param(classlist => $classlist, - type => 'intranet', - loop_budget => \@loop_budget, - loop_currency => \@loop_currency, - total => sprintf("%.2f",$total), - suggestion => $suggestion, - totspent => sprintf("%.2f",$totspent), - totcomtd => sprintf("%.2f",$totcomtd), - totavail => sprintf("%.2f",$totavail), - nobudget => $#results==-1?1:0); +$template->param( + classlist => $classlist, + type => 'intranet', + loop_budget => \@loop_budget, + loop_currency => \@loop_currency, + total => sprintf( "%.2f", $total ), + suggestion => $suggestion, + totspent => sprintf( "%.2f", $totspent ), + totcomtd => sprintf( "%.2f", $totcomtd ), + totavail => sprintf( "%.2f", $totavail ), + nobudget => $#results == -1 ? 1 : 0 +); output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5