From 7c31f430d0d3694f182855514ab2842a40b8f7a7 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Thu, 19 Aug 2010 15:48:21 +0200 Subject: [PATCH] (bug #5154) fix most checkouts report Ignore null/deleted borrowers Signed-off-by: Chris Cormack (cherry picked from commit 666cc03bd38f5932e96d7b5ff151e097f93cb4e6) Signed-off-by: Chris Nighswonger --- reports/bor_issues_top.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reports/bor_issues_top.pl b/reports/bor_issues_top.pl index 9f912572a1..2e93eef6a4 100755 --- a/reports/bor_issues_top.pl +++ b/reports/bor_issues_top.pl @@ -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 <', -- 2.39.5