Without limiting the items considered to the submission library
it's possible that the circ_modifier chosen may not be in use
anywhere at that library.
Signed-off-by: Jason Boyer <jboyer1@library.in.gov>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
FROM biblio.record_entry
WHERE id = lms_bib_id;
- SELECT circ_modifier INTO lms_item_type FROM asset.copy c, asset.call_number cn WHERE cn.record = lms_bib_id AND cn.id = c.call_number AND NOT cn.deleted AND NOT c.deleted LIMIT 1;
+ SELECT circ_modifier INTO lms_item_type FROM asset.copy c, asset.call_number cn WHERE cn.record = lms_bib_id AND c.circ_lib IN (SELECT id FROM actor.org_unit_descendants(org_unit_id)) AND cn.id = c.call_number AND NOT cn.deleted AND NOT c.deleted LIMIT 1;
SELECT REPLACE(NOW()::DATE::TEXT, '-', '') INTO extract_date;
output :=