(bug #5154) fix most checkouts report

Ignore null/deleted borrowers

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Nahuel ANGELINETTI 2010-08-19 15:48:21 +02:00 committed by Chris Cormack
parent c49dc072aa
commit 666cc03bd3

View file

@ -296,10 +296,11 @@ sub calculate {
$strcalc .= "SELECT CONCAT(borrowers.surname , \",\\t\",borrowers.firstname), COUNT(*) AS RANK, borrowers.borrowernumber AS ID";
$strcalc .= " , $colfield " if ($colfield);
$strcalc .= " FROM `old_issues`
LEFT JOIN borrowers ON old_issues.borrowernumber=borrowers.borrowernumber
LEFT JOIN items ON items.itemnumber=old_issues.itemnumber
LEFT JOIN biblioitems ON (biblioitems.biblioitemnumber=items.biblioitemnumber)
WHERE 1";
LEFT JOIN borrowers USING(borrowernumber)
LEFT JOIN items USING(itemnumber)
LEFT JOIN biblioitems USING(biblioitemnumber)
WHERE old_issues.borrowernumber IS NOT NULL
";
my @filterterms = (
'old_issues.timestamp >',
'old_issues.timestamp <',