The SQL in fm_IDL.xml for setting up the reporter source "Hold/Copy
Ratio per Bib" includes deleted call numbers which in turn can give
an incorrect copy count. The ratio appears to still be correct because
deleted copies are considered in the ratio calculation, but not the
copy count that is displayed.
Signed-off-by: Steven Callender <stevecallender@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
SELECT
(SELECT id
FROM biblio.record_entry
- WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number)
+ WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false)
) AS "bre",
COUNT(*) AS "copy_count"
FROM asset.copy