[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/acqui bookfund.pl
From: |
Pierrick LE GALL |
Subject: |
[Koha-cvs] koha/acqui bookfund.pl |
Date: |
Wed, 07 Jun 2006 11:03:17 +0000 |
CVSROOT: /sources/koha
Module name: koha
Changes by: Pierrick LE GALL <plg> 06/06/07 11:03:17
Modified files:
acqui : bookfund.pl
Log message:
Improve SQL formatting (following coding guidelines)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/acqui/bookfund.pl?cvsroot=koha&r1=1.1&r2=1.2
Patches:
Index: bookfund.pl
===================================================================
RCS file: /sources/koha/koha/acqui/bookfund.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- bookfund.pl 7 Jun 2006 02:17:54 -0000 1.1
+++ bookfund.pl 7 Jun 2006 11:03:17 -0000 1.2
@@ -40,17 +40,38 @@
}
);
-my $query =
-"Select
quantity,datereceived,freight,unitprice,listprice,ecost,quantityreceived
-as
qrev,subscription,title,itemtype,aqorders.biblionumber,aqorders.booksellerinvoicenumber,
-quantity-quantityreceived as tleft,aqorders.ordernumber
-as ordnum,entrydate,budgetdate,booksellerid,aqbasket.basketno
-from aqorders,aqorderbreakdown,aqbasket
-left join biblioitems on
biblioitems.biblioitemnumber=aqorders.biblioitemnumber
-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')
-";
+my $query = '
+SELECT quantity,
+ datereceived,
+ freight,
+ unitprice,
+ listprice,
+ ecost,
+ quantityreceived AS qrev,
+ subscription,
+ title,
+ itemtype,
+ aqorders.biblionumber,
+ aqorders.booksellerinvoicenumber,
+ quantity-quantityreceived AS tleft,
+ aqorders.ordernumber AS ordnum,
+ entrydate,
+ budgetdate,
+ booksellerid,
+ aqbasket.basketno
+ FROM aqorders
+ INNER JOIN aqorderbreakdown
+ ON aqorderbreakdown.ordernumber = aqorders.ordernumber
+ INNER JOIN aqbasket
+ ON aqbasket.basketno = aqorders.basketno
+ LEFT JOIN biblioitems
+ ON biblioitems.biblioitemnumber = aqorders.biblioitemnumber
+ WHERE bookfundid = ?
+ AND budgetdate >= ?
+ AND budgetdate < ?
+ AND (datecancellationprinted IS NULL
+ OR datecancellationprinted = \'0000-00-00\')
+';
warn $query;
my $sth = $dbh->prepare($query);
$sth->execute( $bookfund, $start, $end );