From d3b0a44dd0f9e32a4da84ad8d1b50b3f8defca99 Mon Sep 17 00:00:00 2001 From: hdl Date: Fri, 20 Jul 2007 10:41:34 +0000 Subject: [PATCH] Bug FIXING: One query was not mysql5 compliant. --- C4/Bookfund.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/C4/Bookfund.pm b/C4/Bookfund.pm index d3d1016370..2bb190b583 100755 --- a/C4/Bookfund.pm +++ b/C4/Bookfund.pm @@ -257,25 +257,21 @@ sub GetBookFundBreakdown { subscription,title,itemtype,aqorders.biblionumber, aqorders.booksellerinvoicenumber, quantity-quantityreceived AS tleft, - aqorders.ordernumber AS ordnum,entrydate,budgetdate, - booksellerid,aqbasket.basketno - FROM aqorderbreakdown, - aqbasket, - aqorders + aqorders.ordernumber AS ordnum,entrydate,budgetdate + FROM aqorders LEFT JOIN biblioitems ON biblioitems.biblioitemnumber=aqorders.biblioitemnumber + LEFT JOIN aqorderbreakdown ON aqorders.ordernumber=aqorderbreakdown.ordernumber WHERE bookfundid=? - AND aqorders.ordernumber=aqorderbreakdown.ordernumber - AND aqorders.basketno=aqbasket.basketno AND (budgetdate >= ? AND budgetdate < ?) AND (datecancellationprinted IS NULL OR datecancellationprinted='0000-00-00') "; $sth = $dbh->prepare($query); +# warn "$start $end"; $sth->execute( $id, $start, $end ); - my $comtd; + my $comtd=0; - my $total = 0; while ( my $data = $sth->fetchrow_hashref ) { my $left = $data->{'tleft'}; if ( !$left || $left eq '' ) { @@ -287,6 +283,7 @@ sub GetBookFundBreakdown { $data->{'left'} = $left; $comtd += $subtotal; } +# use Data::Dumper; warn Dumper($data); } $sth->finish; -- 2.39.5