[Koha] Spent amounts
Winter, James
WinterJ at arcadia.edu
Wed Dec 17 06:06:03 NZDT 2008
I'm working on pulling over all of our order history into Koha, and I
have a question about the Spent amount in the acquisitions home page.
It's calculating it incorrectly, because in Bookfund.pm the select
statement is joining on bookfundid and not the budgetid so it's getting
the amount spent in the entire fund and not the specific budget in that
fund.
Shouldn't the where clause have budgetdate less than or equal to AND
startdate less than or equal to, not or?
Thanks.
Here's the select statement from Bookfund.pm:
SELECT quantity,datereceived,freight,unitprice,listprice,ecost,
quantityreceived,subscription
FROM aqorders
LEFT JOIN aqorderbreakdown ON
aqorders.ordernumber=aqorderbreakdown.ordernumber
LEFT JOIN aqbookfund ON
(aqorderbreakdown.bookfundid=aqbookfund.bookfundid and
aqorderbreakdown.branchcode=aqbookfund.branchcode)
LEFT JOIN aqbudget ON (aqbudget.bookfundid=aqbookfund.bookfundid
and aqbudget.branchcode=aqbookfund.branchcode)
WHERE aqorderbreakdown.bookfundid=?
AND (datecancellationprinted IS NULL OR
datecancellationprinted='0000-00-00')
AND ((budgetdate >= ? and budgetdate < ?) OR (startdate>=?
and enddate<=?))
James Winter
Arcadia University <http://www.arcadia.edu/>
Systems Manager
215.517.2588
winterj at arcadia.edu <mailto:winterj at arcadia.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20081216/7da8a7db/attachment.htm
More information about the Koha
mailing list