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 <galen.charlton@liblime.com>
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