From: Chris Sharp Date: Wed, 6 Feb 2019 22:29:03 +0000 (-0500) Subject: Exclude all items that are attached to systems in all queries. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=06b74acf3c95c71b28318e3a6affae7115d2e204;p=contrib%2Fpines%2Freport-creator.git Exclude all items that are attached to systems in all queries. --- diff --git a/perl/execreports/erqueries.pl b/perl/execreports/erqueries.pl index 4ab0b0f..24bad4f 100755 --- a/perl/execreports/erqueries.pl +++ b/perl/execreports/erqueries.pl @@ -577,6 +577,7 @@ FROM action.hold_transit_copy JOIN actor.org_unit p on (s.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 p.id <> 1 AND source_send_time BETWEEN '$start_date' AND '$end_date' GROUP BY s.id ) @@ -592,7 +593,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 (s.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 s.parent_ou ) @@ -620,7 +622,7 @@ FROM action.hold_transit_copy 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 p.id <> 1 + AND p.id <> 1 AND source_send_time BETWEEN '$start_date' AND '$end_date' GROUP BY r.id ) @@ -637,6 +639,7 @@ FROM action.hold_transit_copy 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 p.id <> 1 AND source_send_time BETWEEN '$start_date' AND '$end_date' GROUP BY r.parent_ou )