]> git.koha-community.org Git - koha.git/commit
Bug 6984 - Holds statistics doesn't work.
authorGarry Collum <gcollum@gmail.com>
Wed, 1 Feb 2012 15:15:46 +0000 (10:15 -0500)
committerChris Nighswonger <chris.nighswonger@gmail.com>
Mon, 20 Feb 2012 03:27:40 +0000 (22:27 -0500)
commit6a120f28ba2a2208afece66c4b30ef4ca772881f
tree848ad756b11d8e72bf8f642c15f10046f13027bc
parent3c9a5be3c9e77b8973053aea383b68a5debc93e8
Bug 6984 - Holds statistics doesn't work.

This patch fixes several errors in reserves_stats.pl and reserves_stats.tt.

Testing -
To test this patch, data must be in either the reserves table or old_reserves or both.  The following SQL will give you the raw data that is used by the report.

SELECT priority, found, reservedate, notificationdate, reminderdate,
waitingdate, cancellationdate, borrowers.categorycode, items.itype,
reserves.branchcode, holdingbranch, items.homebranch, items.ccode,
items.location, items.itemcallnumber, borrowers.sort1, borrowers.sort2
FROM reserves
LEFT JOIN borrowers on (borrowers.borrowernumber = reserves.borrowernumber)
LEFT JOIN items on (items.itemnumber = reserves.itemnumber)
UNION SELECT priority, found, reservedate, notificationdate, reminderdate,
waitingdate, cancellationdate, borrowers.categorycode, items.itype,
old_reserves.branchcode, holdingbranch, items.homebranch, items.ccode,
items.location, items.itemcallnumber, borrowers.sort1, borrowers.sort2
FROM old_reserves
LEFT JOIN borrowers on (borrowers.borrowernumber = old_reserves.borrowernumber)
LEFT JOIN items on (items.itemnumber = old_reserves.itemnumber)

To test the notificationdate and reminderdate, I added data to the old_reserves table, since I have never run notices on my test machine.

Ex:
UPDATE old_reserves
SET notificationdate = "2012-01-29",
reminderdate = "2012-01-29"
WHERE timestamp = "2012-01-29 20:09:34";

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Confirm original bug -- Reports work as expected now!
prove t xt t/db_dependent no different from master.
(cherry picked from commit 67825637beb8ce3fabb7f34548f6962dec2993e5)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
(cherry picked from commit 7ac0d0b9240c99c931234e440a06158aa1647d1b)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt
reports/reserves_stats.pl