From 89b537273d0937cba822df452faa033715490145 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 8 Apr 2009 12:18:39 +0200 Subject: [PATCH] bug 3097: statistics on itemcount not working replacing issues.itemnumber by statistics.itemnumber since issues was not included in the query. All statistics on circulation for item count were zeroed. [RM note: specifically, this patch fixes the results when you set the 'cell value' to 'count unique items'] Signed-off-by: Galen Charlton --- reports/issues_stats.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index df848bdeed..63ea68ea50 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -426,12 +426,12 @@ sub calculate { my $strcalc = "SELECT $linefield, $colfield, "; $strcalc .= ($process == 1) ? " COUNT(*) " : ($process == 2) ? "(COUNT(DISTINCT borrowers.borrowernumber))" : - ($process == 3) ? "(COUNT(DISTINCT issues.itemnumber))" : ''; + ($process == 3) ? "(COUNT(DISTINCT statistics.itemnumber))" : ''; if ($process == 4) { my $rqbookcount = $dbh->prepare("SELECT count(*) FROM items"); $rqbookcount->execute; my ($bookcount) = $rqbookcount->fetchrow; - $strcalc .= "100*(COUNT(DISTINCT issues.itemnumber))/ $bookcount " ; + $strcalc .= "100*(COUNT(DISTINCT statistics.itemnumber))/ $bookcount " ; } $strcalc .= " FROM statistics -- 2.39.2