- }
-
- # then do a seperate query for commited totals, (pervious single query was
- # returning incorrect comitted results.
-
- $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
- FROM aqorders
- LEFT JOIN biblioitems ON biblioitems.biblioitemnumber=aqorders.biblioitemnumber
- LEFT JOIN aqorderbreakdown ON aqorders.ordernumber=aqorderbreakdown.ordernumber
- WHERE bookfundid=?
- AND (budgetdate >= ? AND budgetdate < ?)
- AND (datecancellationprinted IS NULL OR datecancellationprinted='0000-00-00')
- ";