[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/acqui acqui-home.pl
From: |
Mason James |
Subject: |
[Koha-cvs] koha/acqui acqui-home.pl |
Date: |
Wed, 07 Jun 2006 02:36:24 +0000 |
CVSROOT: /sources/koha
Module name: koha
Changes by: Mason James <sushi> 06/06/07 02:36:24
Modified files:
acqui : acqui-home.pl
Log message:
perltidy before next commit.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/acqui/acqui-home.pl?cvsroot=koha&r1=1.7&r2=1.8
Patches:
Index: acqui-home.pl
===================================================================
RCS file: /sources/koha/koha/acqui/acqui-home.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- acqui-home.pl 7 Jun 2006 02:22:12 -0000 1.7
+++ acqui-home.pl 7 Jun 2006 02:36:24 -0000 1.8
@@ -11,29 +11,33 @@
use C4::Acquisition;
my $query = new CGI;
-my ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "acqui/acqui-home.tmpl",
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "acqui/acqui-home.tmpl",
query => $query,
type => "intranet",
authnotrequired => 0,
- flagsrequired => {acquisition => 1},
+ flagsrequired => { acquisition => 1 },
debug => 1,
- });
+ }
+);
# budget
my $dbh = C4::Context->dbh;
-my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where
borrowernumber = ?");
+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,27 +45,28 @@
else {
$toggle = 0;
}
- my ($spent,$comtd)=bookfundbreakdown($results[$i]->{'bookfundid'});
- my $avail=$results[$i]->{'budgetamount'}-($spent+$comtd);
+ 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{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;
+ $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++){
+for ( my $i = 0 ; $i < $count ; $i++ ) {
my %line;
$line{currency} = $rates->[$i]->{'currency'};
$line{rate} = $rates->[$i]->{'rate'};
@@ -70,15 +75,17 @@
# suggestions ?
my $suggestion = countsuggestion("ASKED");
-$template->param(classlist => $classlist,
+$template->param(
+ classlist => $classlist,
type => 'intranet',
loop_budget => address@hidden,
loop_currency => address@hidden,
- total => sprintf("%.2f",$total),
+ total => sprintf( "%.2f", $total ),
suggestion => $suggestion,
- totspent =>
sprintf("%.2f",$totspent),
- totcomtd =>
sprintf("%.2f",$totcomtd),
- totavail =>
sprintf("%.2f",$totavail),
- nobudget => $#results==-1?1:0);
+ 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;