Tweaking CSS on z39.50 popup to improve readability (Bug 3269)
[koha.git] / acqui / acqui-home.pl
index 95f7112..b8e6162 100755 (executable)
@@ -15,7 +15,6 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id$
 
 
 =head1 NAME
@@ -35,6 +34,7 @@ their rates and the pending suggestions.
 =item $status
 C<$status> is the status a suggestion could has. Default value is 'ASKED'.
 thus, it can be REJECTED, ACCEPTED, ORDERED, ASKED, AVAIBLE
+
 =back
 
 =cut
@@ -43,10 +43,9 @@ use strict;
 use CGI;
 use C4::Auth;
 use C4::Output;
-use C4::Interface::CGI::Output;
-use C4::Database;
+
 use C4::Suggestions;
-use HTML::Template;
+
 use C4::Acquisition;
 use C4::Bookfund;
 use C4::Members;
@@ -64,7 +63,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 );
 
 # budget
-my ( $flags, $homebranch ) = GetFlagsAndBranchFromBorrower($loggedinuser);
+my $borrower= GetMember($loggedinuser);
+my ( $flags, $homebranch )= ($borrower->{'flags'},$borrower->{'branchcode'});
 
 my @results = GetBookFunds($homebranch);
 my $count = scalar @results;
@@ -77,11 +77,15 @@ my $totavail    = 0;
 my @loop_budget = ();
 
 for (my $i=0; $i<$count; $i++){
-       my ($spent,$comtd)=GetBookFundBreakdown($results[$i]->{'bookfundid'});
+       my ($spent,$comtd)=GetBookFundBreakdown($results[$i]->{'bookfundid'},$results[$i]->{'startdate'},$results[$i]->{'enddate'});
        my $avail=$results[$i]->{'budgetamount'}-($spent+$comtd);
        my %line;
        $line{bookfundname} = $results[$i]->{'bookfundname'};
        $line{budgetamount} = $results[$i]->{'budgetamount'};
+       $line{aqbudgetid} = $results[$i]->{'aqbudgetid'};
+       $line{bookfundid} = $results[$i]->{'bookfundid'};
+       $line{sdate} = $results[$i]->{'startdate'};
+       $line{edate} = $results[$i]->{'enddate'};
        $line{spent} = sprintf  ("%.2f", $spent);
        $line{comtd} = sprintf  ("%.2f",$comtd);
        $line{avail}  = sprintf  ("%.2f",$avail);
@@ -94,7 +98,7 @@ for (my $i=0; $i<$count; $i++){
 
 # currencies
 my @rates = GetCurrencies();
-my $count = scalar @rates;
+$count = scalar @rates;
 
 my @loop_currency = ();
 for ( my $i = 0 ; $i < $count ; $i++ ) {