3 # Copyright 2000-2002 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA 02111-1307 USA
30 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32 template_name => "serials/acqui-search.tmpl",
36 flagsrequired => { serials => '*' },
42 my $dbh = C4::Context->dbh;
45 "Select flags, branchcode from borrowers where borrowernumber = ?");
46 $sthtemp->execute($loggedinuser);
47 my ( $flags, $homebranch ) = $sthtemp->fetchrow;
48 my @results = GetBookFunds($homebranch);
49 my $count = scalar(@results);
57 for my $r (@results) {
58 my ( $spent, $comtd ) =
59 GetBookFundBreakdown( $r->{'bookfundid'} );
60 my $avail = $r->{'budgetamount'} - ( $spent + $comtd );
62 $line{bookfundname} = $r->{'bookfundname'};
63 $line{budgetamount} = $r->{'budgetamount'};
64 $line{spent} = sprintf( "%.2f", $spent );
65 $line{comtd} = sprintf( "%.2f", $comtd );
66 $line{avail} = sprintf( "%.2f", $avail );
67 push @loop_budget, \%line;
68 $total += $r->{'budgetamount'};
75 my @rates = GetCurrencies();
77 my $loop_currency = [];
79 push @{$loop_currency}, {
80 currency => $r->{'currency'},
85 classlist => $classlist,
87 loop_budget => \@loop_budget,
88 loop_currency => $loop_currency,
89 total => sprintf( "%.2f", $total ),
90 totspent => sprintf( "%.2f", $totspent ),
91 totcomtd => sprintf( "%.2f", $totcomtd ),
92 totavail => sprintf( "%.2f", $totavail )
95 output_html_with_http_headers $query, $cookie, $template->output;