From 7e671cb268da303226996bf0503f8346c5c351a6 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Fri, 1 Dec 2017 14:35:50 -0500 Subject: [PATCH] Exclude transits for items miscataloged at the system level. While not a common issue, if any items that are miscataloged with an owning library of a PINES system rather than branch, the consolidation step fails because there's more than one row returned from a subquery expecting a single value. Explicitly exclude any items owned by units with a parent_ou of 1 (PINES). --- perl/execreports/erqueries.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perl/execreports/erqueries.pl b/perl/execreports/erqueries.pl index 816b0dd..52dbc79 100755 --- a/perl/execreports/erqueries.pl +++ b/perl/execreports/erqueries.pl @@ -615,7 +615,8 @@ FROM action.hold_transit_copy JOIN actor.org_unit r on (r.id = action.hold_transit_copy.dest) JOIN actor.org_unit p on (r.parent_ou = p.id) WHERE s.id in (SELECT id from actor.org_unit WHERE ou_type=3) - AND s.parent_ou <> r.parent_ou + AND s.parent_ou <> r.parent_ou + AND p.id <> 1 AND source_send_time BETWEEN '$start_date' AND '$end_date' GROUP BY r.id ) -- 2.11.0