From: Jason Boyer Date: Thu, 13 Feb 2014 20:44:44 +0000 (-0500) Subject: Limit circ_modifier selection to items owned by submission lib(s) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=191478f87e972dbd8d3ddbb68202016748678e42;p=contrib%2Fequinox.git Limit circ_modifier selection to items owned by submission lib(s) 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 Signed-off-by: Galen Charlton --- diff --git a/collectionHQ/functions.sql b/collectionHQ/functions.sql index 36925ad..84028da 100644 --- a/collectionHQ/functions.sql +++ b/collectionHQ/functions.sql @@ -246,7 +246,7 @@ CREATE OR REPLACE FUNCTION collectionHQ.write_bib_rows_to_stdout (TEXT, INT) RET 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 :=