From 96e95bce3ccef8e342b30086f794d8ca1b9ab186 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Thu, 21 Jan 2010 12:15:49 +0100 Subject: [PATCH] [followup](bug #3348) fix spent values and spent resume This fix the way to get spent datas, to user aqbudgetid instead of bookfund. --- C4/Bookfund.pm | 5 +++-- acqui/acqui-home.pl | 3 ++- acqui/spent.pl | 6 +++--- .../intranet-tmpl/prog/en/modules/acqui/acqui-home.tmpl | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/C4/Bookfund.pm b/C4/Bookfund.pm index 1743a38a5d..2624edee65 100644 --- a/C4/Bookfund.pm +++ b/C4/Bookfund.pm @@ -232,14 +232,15 @@ sub GetBookFundBreakdown { LEFT JOIN aqorderbreakdown USING (ordernumber) LEFT JOIN aqbasket USING (basketno) LEFT JOIN aqbudget USING (bookfundid) - WHERE bookfundid=? + WHERE aqbudgetid=? AND (datecancellationprinted IS NULL OR datecancellationprinted = '0000-00-00') AND closedate BETWEEN startdate AND enddate AND creationdate > startdate + ORDER BY datereceived "; my $sth = $dbh->prepare($query); - $sth->execute( $id); + $sth->execute($id); my ($spent, $comtd) = (0, 0); while ( my $data = $sth->fetchrow_hashref ) { diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index b8e6162f0a..929779dabc 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -67,6 +67,7 @@ my $borrower= GetMember($loggedinuser); my ( $flags, $homebranch )= ($borrower->{'flags'},$borrower->{'branchcode'}); my @results = GetBookFunds($homebranch); + my $count = scalar @results; my $classlist = ''; @@ -77,7 +78,7 @@ my $totavail = 0; my @loop_budget = (); for (my $i=0; $i<$count; $i++){ - my ($spent,$comtd)=GetBookFundBreakdown($results[$i]->{'bookfundid'},$results[$i]->{'startdate'},$results[$i]->{'enddate'}); + my ($spent,$comtd)=GetBookFundBreakdown($results[$i]->{'aqbudgetid'},$results[$i]->{'startdate'},$results[$i]->{'enddate'}); my $avail=$results[$i]->{'budgetamount'}-($spent+$comtd); my %line; $line{bookfundname} = $results[$i]->{'bookfundname'}; diff --git a/acqui/spent.pl b/acqui/spent.pl index 89a71e50dc..a47d119980 100755 --- a/acqui/spent.pl +++ b/acqui/spent.pl @@ -12,7 +12,7 @@ use CGI; my $dbh = C4::Context->dbh; my $input = new CGI; -my $bookfund = $input->param('bookfund'); +my $budgetid = $input->param('aqbudgetid'); my $start = $input->param('start'); my $end = $input->param('end'); @@ -40,14 +40,14 @@ my $query = LEFT JOIN aqorderbreakdown USING (ordernumber) LEFT JOIN aqbasket USING (basketno) LEFT JOIN aqbudget USING (bookfundid) - WHERE bookfundid=? + WHERE aqbudgetid=? AND (datecancellationprinted IS NULL OR datecancellationprinted = '0000-00-00') AND closedate BETWEEN startdate AND enddate AND creationdate > startdate ORDER BY datereceived "; my $sth = $dbh->prepare($query); -$sth->execute( $bookfund); +$sth->execute( $budgetid ); my $total = 0; my $toggle; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tmpl index 87365b57f7..af98fa151a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tmpl @@ -76,7 +76,7 @@ "> - &start=&end="> + &start=&end="> &start=&end="> -- 2.39.5