From 3d303852809ef29b1cf2f192c614b90b15f8cd93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9my=20Breuillard?= Date: Wed, 24 Nov 2021 16:56:09 +0100 Subject: [PATCH] Bug 21982: Circulation statistics wizard does not count deleted items By default statistic assistant filter is set on the existing items and doesn't mind about deleted items. The patch corrects this. Items belong to the same library. Test plan: 1)Make sure to have at least 1 or more item(s) in deleteditems database table 2)Home > Reports > Circulation statistics 3)Fill up 'Issuing library', 'Home library' and 'Holding library' 4)Submit 5)Notice that only statistics for active items are shown 6)Apply patch and repeat from 2) to 5) 7)Now active items and deleted items are shown Signed-off-by: Sally Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 610f287db9581bfa6d606468810792d25c6dc47b) Signed-off-by: Lucas Gass (cherry picked from commit c7b78eb133c6ff2bc57739fba5325a46ee289739) Signed-off-by: Arthur Suzuki --- reports/issues_stats.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index f5209b2ff8..ae6a42a12b 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -506,7 +506,7 @@ sub calculate { $strcalc .= " LEFT JOIN borrower_attributes AS attribute_$_ ON (statistics.borrowernumber = attribute_$_.borrowernumber AND attribute_$_.code = '$_') "; } } - $strcalc .= "LEFT JOIN items ON statistics.itemnumber=items.itemnumber " + $strcalc .= "LEFT JOIN (SELECT * FROM items UNION SELECT * FROM deleteditems) items ON statistics.itemnumber=items.itemnumber " if ( $linefield =~ /^items\./ or $colfield =~ /^items\./ or $process == 5 -- 2.39.5