From 057fa1ac240e75e23e4f3cfc6486adb8272eb213 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Thu, 8 Oct 2009 16:51:48 +0200 Subject: [PATCH] [followup] (bug #3348) last fixes This patch is the last fix for this ticket. --- C4/Bookfund.pm | 18 +++++++++--------- acqui/spent.pl | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/C4/Bookfund.pm b/C4/Bookfund.pm index 59338580a5..5f754d71f1 100644 --- a/C4/Bookfund.pm +++ b/C4/Bookfund.pm @@ -223,20 +223,20 @@ sub GetBookFundBreakdown { # do a query for spent totals. my $query = " Select quantity,datereceived,freight,unitprice,listprice,ecost,quantityreceived - as qrev,subscription,title,itemtype,aqorders.biblionumber,aqorders.booksellerinvoicenumber, + as qrev,subscription,title,itype as itemtype,aqorders.biblionumber,aqorders.booksellerinvoicenumber, quantity-quantityreceived as tleft, aqorders.ordernumber - as ordnum,entrydate,budgetdate,booksellerid,aqbasket.basketno - from aqorderbreakdown,aqbasket,aqorders - left join biblioitems on biblioitems.biblioitemnumber=aqorders.biblioitemnumber - where bookfundid=? and - aqorders.ordernumber=aqorderbreakdown.ordernumber and - aqorders.basketno=aqbasket.basketno - and ( - (datereceived >= ? and datereceived < ?)) + as ordnum,entrydate,budgetdate,aqbasket.booksellerid,aqbasket.basketno + from aqorders + inner join aqorderbreakdown on aqorderbreakdown.ordernumber = aqorders.ordernumber + inner join aqbasket on aqbasket.basketno = aqorders.basketno + left join items on items.biblionumber=aqorders.biblionumber + where bookfundid=? + and (datereceived >= ? and datereceived < ?) and (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') and (closedate >= ? and closedate < ?) + ORDER BY datereceived "; my $sth = $dbh->prepare($query); $sth->execute( $id, $start, $end, $start, $end); diff --git a/acqui/spent.pl b/acqui/spent.pl index aebe98aa43..ec7977d430 100755 --- a/acqui/spent.pl +++ b/acqui/spent.pl @@ -31,7 +31,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( # correctly due to missing joins between tables my $query = -"Select distinct quantity,datereceived,freight,unitprice,listprice,ecost,quantityreceived +"Select quantity,datereceived,freight,unitprice,listprice,ecost,quantityreceived as qrev,subscription,title,itype as itemtype,aqorders.biblionumber,aqorders.booksellerinvoicenumber, quantity-quantityreceived as tleft, aqorders.ordernumber -- 2.39.5