toward renaming mig to emig and tweaking the directory layout
[migration-tools.git] / mig-xml / evergreen_staged_report.xml
diff --git a/mig-xml/evergreen_staged_report.xml b/mig-xml/evergreen_staged_report.xml
deleted file mode 100644 (file)
index 050df4a..0000000
+++ /dev/null
@@ -1,1182 +0,0 @@
-<reports_file>
-    <function>
-        <name>find_cmm</name>
-        <drop>DROP FUNCTION IF EXISTS find_cmm(BIGINT)</drop>
-        <create>
-            CREATE OR REPLACE FUNCTION find_cmm(circ_id BIGINT)
-                RETURNS SETOF INTEGER[]
-                LANGUAGE plpgsql
-            AS $function$
-            DECLARE
-                 aou     INTEGER;
-                 ac      INTEGER;
-                 au      INTEGER;
-                 r       INTEGER[];
-            BEGIN
-                SELECT circ_lib FROM action.circulation WHERE id = circ_id INTO aou;
-                SELECT target_copy FROM action.circulation WHERE id = circ_id INTO ac;
-                SELECT usr FROM action.circulation WHERE id = circ_id INTO au;
-
-                FOR r IN SELECT buildrows FROM action.find_circ_matrix_matchpoint(aou,ac,au,FALSE)
-                    LOOP
-                        RETURN NEXT r;
-                    END LOOP;
-                RETURN;
-            END
-        $function$</create>
-    </function>
-
-    <table>
-        <name>create_subfield_u</name>
-        <drop>DROP TABLE IF EXISTS subfield_u</drop>
-        <create>CREATE UNLOGGED TABLE subfield_u AS SELECT UNNEST(oils_xpath( '//*[@tag="856"]/*[@code="u"]/text()', marc)) AS value FROM m_biblio_record_entry_legacy WHERE x_migrate</create>
-    </table>
-
-<!-- sample reports entry
-    <report>
-        <name>name of report</name>
-        <iteration value='0' /> which version, the first version to run is 0, first backup is 1, then so on
-        <tag>money</tag>  arbitrary tags, each should go in separate tag
-        <report_title>Migrated Billings</report_title>  title used in the asciidoc output
-        <heading column='1'>Number of Billings.Migrated.Total</heading> period delimited 
-        <query>SELECT COUNT(id),x_migrate::TEXT,SUM(amount) FROM m_money_billing_legacy GROUP BY 2;</query>  query itself, will be replaced
-        <note>Arbitrary note that can be included in the entries.</note>
-    </report>
--->
-
-<!-- adding sample pie chart report
-    <report>
-        <name>current_holds_by_state</name>
-        <tag>holds</tag>
-        <iteration>0</iteration>
-        <display>pie_chart</display>
-        <report_title>Holds by Current State (7 days)</report_title>
-        <heading>Captured.Fulfilled.Canceled.Targeted.Waiting</heading>
-        <chart_labels>Hold Type.Count</chart_labels>
-        <query> SELECT
-            (SELECT COUNT(*) FROM action.hold_request WHERE fulfillment_time IS NULL AND capture_time > NOW() - '7 days'::INTERVAL AND cancel_time IS NULL),
-            (SELECT COUNT(*) FROM action.hold_request WHERE fulfillment_time > NOW() - '7 days'::INTERVAL AND capture_time IS NOT NULL AND cancel_time IS NULL),
-            (SELECT COUNT(*) FROM action.hold_request WHERE fulfillment_time IS NULL AND cancel_time > NOW() - '7 days'::INTERVAL),
-            (SELECT COUNT(*) FROM action.hold_request WHERE fulfillment_time IS NULL AND capture_time IS NULL AND cancel_time IS NULL AND current_copy IS NOT NULL),
-            (SELECT COUNT(*) FROM action.hold_request WHERE fulfillment_time IS NULL AND capture_time IS NULL AND cancel_time IS NULL AND current_copy IS NULL)
-        </query>
-    </report>
-
--->
-
-    <!-- CIRC REPORTS -->
-    <report>
-        <name>circ_count</name>
-        <tag>circs</tag>
-        <iteration>0</iteration>
-        <report_title>Migrated Circulations</report_title>
-        <heading>Circulation Status.Count of Circs</heading>
-        <query>SELECT 'Closed Circulations', COUNT(id) FROM m_action_circulation_legacy WHERE xact_finish IS NOT NULL AND x_migrate 
-            UNION ALL SELECT 'Open Circulations', COUNT(id) FROM m_action_circulation_legacy WHERE xact_finish IS NULL AND x_migrate</query>
-    </report>
-
-    <report>
-        <name>circ_count</name>
-        <tag>circs</tag>
-        <iteration>1</iteration>
-        <report_title>Open Circulations</report_title>
-        <heading>Circulation Status.Count of Circs</heading>
-        <query>SELECT 'Closed Circulations', COUNT(id) FROM m_action_circulation WHERE xact_finish IS NOT NULL UNION ALL SELECT 'Open Circulations', COUNT(id) FROM m_action_circulation WHERE xact_finish IS NULL</query>
-    </report>
-
-     <report>
-        <name>circ_by_orgunit</name>
-        <tag>circs</tag>
-        <iteration>0</iteration>
-        <report_title>Circulations by Org Unit</report_title>
-        <heading>Circulations Count.Org Unit</heading>
-        <query>SELECT COUNT(acirc.id), aou.name FROM m_action_circulation_legacy acirc JOIN actor.org_unit aou ON aou.id = acirc.circ_lib WHERE acirc.xact_finish IS NULL AND x_migrate = TRUE GROUP BY 2</query>
-    </report>
-
-     <report>
-        <name>circ_by_orgunit</name>
-        <tag>circs</tag>
-        <iteration>1</iteration>
-        <report_title>Circulations by Org Unit</report_title>
-        <heading>Circulations Count.Org Unit</heading>
-        <query>SELECT COUNT(acirc.id), aou.name FROM m_action_circulation acirc JOIN actor.org_unit aou ON aou.id = acirc.circ_lib WHERE acirc.xact_finish IS NULL GROUP BY 2</query>
-    </report>
-
-     <report>
-        <name>circs_by_duration</name>
-        <tag>circs</tag>
-        <iteration>0</iteration>
-        <report_title>Migrated Circulations by Duration, Fine and Max Fine</report_title>
-        <heading>Count of Circs.Duration.Fine.Max Fine</heading>
-        <query>SELECT COUNT(id), duration_rule, recurring_fine_rule, max_fine_rule FROM m_action_circulation_legacy WHERE x_migrate = TRUE GROUP BY 2, 3, 4</query>
-    </report>
-
-     <report>
-        <name>circs_by_duration</name>
-        <tag>circs</tag>
-        <iteration>1</iteration>
-        <report_title>Circulations by Duration, Fine and Max Fine</report_title>
-        <heading>Count of Circs.Duration.Fine.Max Fine</heading>
-        <query>SELECT COUNT(id), duration_rule, recurring_fine_rule, max_fine_rule FROM m_action_circulation GROUP BY 2, 3, 4 ORDER BY 2, 3, 4</query>
-    </report>
-
-     <report>
-        <name>circs_by_usrgroup</name>
-        <tag>circs</tag>
-        <iteration>0</iteration>
-        <report_title>Circulations by Rules and Patron Group</report_title>
-        <heading>Count of Circs.Duration.Fine.Max Fine.User Group.Matchpoints</heading>
-        <query>SELECT COUNT(acirc.id), acirc.duration_rule, acirc.recurring_fine_rule, acirc.max_fine_rule, pgt.name, x.buildrows FROM m_action_circulation_legacy acirc JOIN actor.usr au ON au.id = acirc.usr JOIN permission.grp_tree pgt ON pgt.id = au.profile JOIN (SELECT acirc.id, ARRAY_TO_STRING(find_cmm(acirc.id),',') AS buildrows FROM m_action_circulation_legacy acirc WHERE acirc.x_migrate = TRUE) x ON x.id = acirc.id WHERE acirc.x_migrate = TRUE GROUP BY 2, 3, 4, 5, 6 ORDER BY 2, 3, 4, 5, 6</query>
-    </report>
-
-     <report>
-        <name>circs_by_usrgroup</name>
-        <tag>circs</tag>
-        <iteration>1</iteration>
-        <report_title>Circulations by Rules and Patron Group</report_title>
-        <heading>Count of Circs.Duration.Fine.Max Fine.User Group.Matchpoints</heading>
-        <query>SELECT COUNT(acirc.id), acirc.duration_rule, acirc.recurring_fine_rule, acirc.max_fine_rule, pgt.name, x.buildrows FROM m_action_circulation acirc JOIN actor.usr au ON au.id = acirc.usr JOIN permission.grp_tree pgt ON pgt.id = au.profile JOIN (SELECT acirc.id, ARRAY_TO_STRING(find_cmm(acirc.id),',') AS buildrows FROM m_action_circulation acirc) x ON x.id = acirc.id GROUP BY 2, 3, 4, 5, 6 ORDER BY 2, 3, 4, 5, 6</query>
-    </report>
-
-     <report>
-        <name>circs_by_circmod</name>
-        <tag>circs</tag>
-        <iteration>0</iteration>
-        <report_title>Circulations by Rules and Circulation Modifier</report_title>
-        <heading>Count of Circs.Duration.Fine.Max Fine.Circulation Modifier.Matchpoints</heading>
-        <query>SELECT COUNT(acirc.id), acirc.duration_rule, acirc.recurring_fine_rule, acirc.max_fine_rule, ac.circ_modifier, x.buildrows FROM m_action_circulation_legacy acirc JOIN asset.copy ac ON ac.id = acirc.target_copy JOIN (SELECT acirc.id, ARRAY_TO_STRING(find_cmm(acirc.id),',') AS buildrows FROM m_action_circulation_legacy acirc WHERE acirc.x_migrate = TRUE) x ON x.id = acirc.id WHERE acirc.x_migrate = TRUE GROUP BY 2, 3, 4, 5, 6 ORDER BY 2, 3, 4, 5, 6</query>
-    </report>
-
-     <report>
-        <name>circs_by_circmod</name>
-        <tag>circs</tag>
-        <iteration>1</iteration>
-        <report_title>Circulations by Rules and Circulation Modifier</report_title>
-        <heading>Count of Circs.Duration.Fine.Max Fine.Circulation Modifier.Matchpoints</heading>
-        <query>SELECT COUNT(acirc.id), acirc.duration_rule, acirc.recurring_fine_rule, acirc.max_fine_rule, ac.circ_modifier, x.buildrows FROM m_action_circulation acirc JOIN asset.copy ac ON ac.id = acirc.target_copy JOIN (SELECT acirc.id, ARRAY_TO_STRING(find_cmm(acirc.id),',') AS buildrows FROM m_action_circulation acirc) x ON x.id = acirc.id
-             GROUP BY 2, 3, 4, 5, 6 ORDER BY 2, 3, 4, 5, 6</query>
-    </report>
-
-     <report>
-        <name>circs_by_orgunit</name>
-        <tag>circs</tag>
-        <iteration>0</iteration>
-        <report_title>Circulations by Rules and Org Unit</report_title>
-        <heading>Count of Circs.Duration.Fine.Max Fine.Library Branch</heading>
-        <query>SELECT COUNT(acirc.id), acirc.duration_rule, acirc.recurring_fine_rule, acirc.max_fine_rule, aou.name FROM m_action_circulation_legacy acirc JOIN actor.org_unit aou ON aou.id = acirc.circ_lib WHERE acirc.x_migrate = TRUE GROUP BY 2, 3, 4, 5 ORDER BY 2, 3, 4, 5</query>
-    </report>
-
-     <report>
-        <name>circs_by_orgunit</name>
-        <tag>circs</tag>
-        <iteration>1</iteration>
-        <report_title>Circulations by Rules and Org Unit</report_title>
-        <heading>Count of Circs.Duration.Fine.Max Fine.Library Branch</heading>
-        <query>SELECT COUNT(acirc.id), acirc.duration_rule, acirc.recurring_fine_rule, acirc.max_fine_rule, aou.name FROM m_action_circulation acirc JOIN actor.org_unit aou ON aou.id = acirc.circ_lib GROUP BY 2, 3, 4, 5 ORDER BY 2, 3, 4, 5</query>
-    </report>
-
-     <report>
-        <name>non_cat_circs</name>
-        <tag>circs</tag>
-        <iteration>0</iteration>
-        <report_title>Non-Cataloged Circulation</report_title>
-        <heading>Circulations Count.Migrated</heading>
-        <query>SELECT COUNT(id), x_migrate::TEXT FROM m_action_non_cataloged_circulation_legacy GROUP BY 2</query>
-    </report>
-
-     <report>
-        <name>non_cat_circs</name>
-        <tag>circs</tag>
-        <iteration>1</iteration>
-        <report_title>Non-Cataloged Circulation</report_title>
-        <heading>Circulations Count</heading>
-        <query>SELECT COUNT(id) FROM m_action_non_cataloged_circulation</query>
-    </report>
-
-     <report>
-        <name>in_house</name>
-        <tag>circs</tag>
-        <iteration>0</iteration>
-        <report_title>In House Use</report_title>
-        <heading>In House Use Records.Migrated</heading>
-        <query>SELECT COUNT(id), x_migrate::TEXT FROM m_action_in_house_use_legacy GROUP BY 2</query>
-    </report>
-
-     <report>
-        <name>in_house</name>
-        <tag>circs</tag>
-        <iteration>1</iteration>
-        <report_title>In House Use</report_title>
-        <heading>In House Use Records</heading>
-        <query>SELECT COUNT(id) FROM m_action_in_house_use</query>
-    </report>
-
-     <report>
-        <name>circs_missing_rules</name>
-        <tag>circs</tag>
-        <iteration>1</iteration>
-        <report_title>Circs Missing Rules</report_title>
-        <heading>Count.Field Missing</heading>
-        <query>SELECT COUNT(id), 'Duration Rule Value' FROM m_action_circulation WHERE duration IS NULL 
-            UNION ALL SELECT COUNT(id), 'Recurring Fine Rule Value' FROM m_action_circulation WHERE recurring_fine IS NULL 
-            UNION ALL SELECT COUNT(id), 'Max Fine Rule Value' FROM m_action_circulation WHERE max_fine IS NULL
-            UNION ALL SELECT COUNT(id), 'Duration Rule' FROM m_action_circulation WHERE duration_rule IS NULL       
-            UNION ALL SELECT COUNT(id), 'Recurring Fine Rule' FROM m_action_circulation WHERE recurring_fine_rule IS NULL      
-            UNION ALL SELECT COUNT(id), 'Max Fine Rule' FROM m_action_circulation WHERE max_fine_rule IS NULL
-        </query>
-    </report>
-
-     <report>
-        <name>circ_open_by_item_status</name>
-        <tag>circs</tag>
-        <iteration>0</iteration>
-        <report_title>Status of Currently Circulating Items</report_title>
-        <heading>Count.Status</heading>
-        <query>SELECT COUNT(acirc.id), ccs.name FROM action.circulation acirc JOIN asset.copy ac ON ac.id = acirc.target_copy JOIN config.copy_status ccs ON ccs.id = ac.status WHERE acirc.xact_finish IS NULL AND acirc.checkin_time IS NULL AND acirc.id IN (SELECT id FROM m_action_circulation) GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <!-- HOLDS REPORTS -->
-
-     <report>
-        <name>holds</name>
-        <tag>holds</tag>
-        <iteration>0</iteration>
-        <report_title>Migrated and Non-Migrated Holds</report_title>
-        <heading>Hold Type.Hold Count.Migrated</heading>
-        <query>SELECT 'Closed Holds', COUNT(id), x_migrate::TEXT FROM m_action_hold_request_legacy WHERE (expire_time::TIMESTAMP &lt; now()) OR cancel_time IS NOT NULL OR fulfillment_time IS NOT NULL GROUP BY 3 UNION ALL SELECT 'Open Holds', COUNT(id), x_migrate::TEXT FROM m_action_hold_request_legacy WHERE (expire_time IS NULL OR expire_time::TIMESTAMP &gt; now()) AND cancel_time IS NULL AND fulfillment_time IS NULL GROUP BY 3</query>
-    </report>
-
-     <report>
-        <name>holds_bytype</name>
-        <tag>holds</tag>
-        <iteration>0</iteration>
-        <report_title>Migrated Holds By Type</report_title>
-        <heading>Hold Type.Hold Count</heading>
-        <query>SELECT hold_type as "Hold Type", COUNT(id) FROM m_action_hold_request_legacy WHERE x_migrate = TRUE GROUP BY 1</query>
-    </report>
-
-     <report>
-        <name>transit_open_by_item_status</name>
-        <tag>holds</tag>
-        <iteration>0</iteration>
-        <report_title>Transit Copy Records and Status of Linked Items</report_title>
-        <heading>Count.Status</heading>
-        <query>SELECT COUNT(atc.id), ccs.name FROM action.transit_copy atc JOIN asset.copy ac ON ac.id = atc.target_copy JOIN config.copy_status ccs ON ccs.id = ac.status WHERE atc.id IN (SELECT id FROM m_action_transit_copy) AND atc.dest_recv_time IS NULL GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-     <report>
-        <name>transit_copies_by_status</name>
-        <tag>holds</tag>
-        <iteration>0</iteration>
-        <report_title>Status of Items with Count of Open In Transits</report_title>
-        <heading>Count.Status.Count of Open Transits</heading>
-        <query>SELECT COUNT(ac.id), ccs.name, SUM(CASE WHEN atc.id IS NULL THEN 0 ELSE 1 END) FROM asset.copy ac JOIN config.copy_status ccs ON ccs.id = ac.status LEFT JOIN (SELECT * FROM action.transit_copy WHERE id IN (SELECT id FROM m_action_transit_copy) AND dest_recv_time IS NULL) atc ON atc.target_copy = ac.id WHERE ac.id IN (SELECT id from m_asset_copy) GROUP BY 2 ORDER BY 2</query>
-    </report>
-    
-     <report>
-        <name>hold_copies_by_status</name>
-        <tag>holds</tag>
-        <iteration>0</iteration>
-        <report_title>Captured Holds with Status of Items</report_title>
-        <heading>Count of Captured Hold.Status of Item</heading>
-        <query>SELECT COUNT(ahr.id), ccs.name FROM action.hold_request ahr JOIN asset.copy ac ON ac.id = ahr.current_copy JOIN config.copy_status ccs ON ccs.id = ac.status WHERE ahr.capture_time IS NOT NULL AND ahr.fulfillment_time IS NULL and ahr.cancel_time IS NULL AND ahr.id IN (SELECT id FROM m_action_hold_request) GROUP BY 2 ORDER By 2</query>
-    </report>
-
-      <report>
-        <name>hold_depth</name>
-        <tag>holds</tag>
-        <iteration>0</iteration>
-        <report_title>Depth of Unfilled Holds</report_title>
-        <heading>Count.Depth</heading>
-        <query>SELECT COUNT(ahr.id), ahr.selection_depth FROM action.hold_request ahr WHERE ahr.id IN (SELECT id FROM m_action_hold_request) AND ahr.cancel_time IS NULL AND ahr.capture_time IS NULL AND ahr.fulfillment_time IS NULL GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <!-- ASSET REPORTS -->
-    
-    <report>
-        <name>m_asset_copy_count</name>
-        <report_title>Count of Copies by Library</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Copy Count.Library</heading>
-        <query>SELECT COUNT(ac.id), aou.name FROM m_asset_copy_legacy ac JOIN actor.org_unit aou ON aou.id = ac.circ_lib WHERE ac.x_migrate = TRUE GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>m_asset_copy_count_non_migrated</name>
-        <report_title>Non-Migrated Count of Copies by Library</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Copy Count.Library</heading>
-        <query>SELECT COUNT(ac.id), aou.name FROM m_asset_copy_legacy ac JOIN actor.org_unit aou ON aou.id = ac.circ_lib WHERE ac.x_migrate = FALSE GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>m_asset_copies_by_status</name>
-        <report_title>Copies by Status</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Copy Count.Status</heading>
-        <query>SELECT COUNT(ac.id), cs.name FROM m_asset_copy_legacy ac JOIN config.copy_status cs ON cs.id = ac.status WHERE ac.x_migrate = TRUE GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>m_asset_circ_mod_copies_count</name>
-        <report_title>Copies by Circulation Modifier</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Copy Count.Circulation Modifier</heading>
-        <query>SELECT COUNT(ac.id), ac.circ_modifier FROM m_asset_copy_legacy ac WHERE ac.x_migrate = TRUE GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>m_asset_copy_notes</name>
-        <report_title>Copy Notes</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Note Count.Public</heading>
-        <query>SELECT COUNT(acnote.id), acnote.pub::TEXT FROM m_asset_copy_note_legacy acnote WHERE acnote.x_migrate = TRUE GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>m_asset_copy_notes</name>
-        <report_title>Copy Notes</report_title>
-        <tag>assets</tag>
-        <iteration>1</iteration>
-        <heading>Note Count.Public</heading>
-        <query>SELECT COUNT(acnote.id), acnote.pub::TEXT FROM m_asset_copy_note acnote GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-   <report>
-        <name>m_asset_vols_by_lib</name>
-        <report_title>Volumes by Library</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Volume Count.Library</heading>
-        <query>SELECT COUNT(acn.id), aou.name FROM m_asset_call_number_legacy acn JOIN m_actor_org_unit_legacy aou ON aou.id = acn.owning_lib WHERE acn.x_migrate = TRUE GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-   <report>
-        <name>m_asset_vols_by_lib</name>
-        <report_title>Volumes by Library</report_title>
-        <tag>assets</tag>
-        <iteration>1</iteration>
-        <heading>Volume Count.Library</heading>
-        <query>SELECT COUNT(acn.id), aou.name FROM m_asset_call_number acn JOIN actor.org_unit aou ON aou.id = acn.owning_lib GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-   <report>
-        <name>m_asset_cops_by_loc_and_org</name>
-        <report_title>Copies by Location</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Copy Count.Location.Circ Library</heading>
-        <query>SELECT COUNT(ac.id), acl.name, aou.name FROM m_asset_copy_legacy ac JOIN asset.copy_location acl ON acl.id = ac.location JOIN actor.org_unit aou ON aou.id = ac.circ_lib WHERE ac.x_migrate = TRUE GROUP BY 2, 3 ORDER BY 2, 3</query>
-    </report>
-
-   <report>
-        <name>m_asset_cops_w_loc_one</name>
-        <report_title>Copies with a Location of Stacks</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Barcode</heading>
-        <query>SELECT barcode FROM m_asset_copy_legacy WHERE location = 1 AND x_migrate</query>
-    </report>
-
-    <report>
-        <name>m_asset_no_barcode</name>
-        <report_title>Items Without Barcodes</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Assigned Barcode</heading>
-        <query>SELECT barcode FROM m_asset_copy_legacy WHERE barcode ~* 'no_barocde' AND x_migrate</query>
-    </report>
-
-    <report>
-        <name>m_asset_barcode_patterns</name>
-        <report_title>Common Barcode Starting Patterns</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Count of Barcodes (greater than 10).Left 60% of Characters</heading>
-        <query>SELECT COUNT(ac.id), LEFT(ac.barcode,(ROUND(LENGTH(ac.barcode)*.6))::INT) FROM m_asset_copy_legacy ac WHERE ac.x_migrate = TRUE GROUP BY 2 HAVING COUNT(ac.id) > 10 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>m_asset_barcode_collisions</name>
-        <report_title>Copy Barcode Collisions</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Collision Count</heading>
-        <query>SELECT COUNT(id) FROM m_asset_copy_legacy WHERE x_migrate = TRUE AND barcode ~* '^x_'</query>
-        <note>Incumbent collisions are those where the migrated barcodes collide with existing barcodes in the database.</note>
-    </report>
-
-    <report>
-        <name>m_asset_barcode_collisions</name>
-        <report_title>Copy Barcode Collisions</report_title>
-        <tag>assets</tag>
-        <iteration>1</iteration>
-        <heading>Collision Count</heading>
-        <query>SELECT COUNT(id) FROM m_asset_copy WHERE barcode ~* '^x_'</query>
-        <note>Incumbent collisions are those where the migrated barcodes collide with existing barcodes in the database.</note>
-    </report>
-
-    <report>
-        <name>m_asset_barcode_collisions_shortlist</name>
-        <report_title>Copy Barcode Collisions (first 20)</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Collision List</heading>
-        <query>SELECT ac.barcode FROM m_asset_copy_legacy ac WHERE ac.barcode ~* '^x_' AND ac.x_migrate = TRUE ORDER BY 1 LIMIT 20</query>
-        <note>This is a shortlist of copy barcode collisions that maxes out at 20.  If there are more collisions we will need to run a custom report.</note>
-    </report>
-
-    <report>
-        <name>m_asset_barcode_collisions_shortlist</name>
-        <report_title>Copy Barcode Collisions (first 20)</report_title>
-        <tag>assets</tag>
-        <iteration>1</iteration>
-        <heading>Collision List</heading>
-        <query>SELECT ac.barcode FROM m_asset_copy ac WHERE ac.barcode ~* '^x_' ORDER BY 1 LIMIT 20</query>
-        <note>This is a shortlist of patron barcode collisions that maxes out at 20.  If there are more collisions we will need to run a custom report.</note>
-    </report>
-
-    <report>
-        <name>m_asset_barcode_collision_patterns</name>
-        <report_title>Common Copy Barcode Collision Patterns</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Number of Barcodes Matching Pattern Greater than 10.Left 60% of Characters</heading>
-        <query>SELECT COUNT(ac.id), LEFT(ac.barcode,(ROUND(LENGTH(ac.barcode)*.6))::INT) FROM m_asset_copy_legacy ac WHERE barcode ~* '^x_' AND ac.x_migrate = TRUE GROUP BY 2 HAVING COUNT(ac.id) > 10 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>m_asset_barcode_collision_patterns</name>
-        <report_title>Common Copy Barcode Collision Patterns</report_title>
-        <tag>assets</tag>
-        <iteration>1</iteration>
-        <heading>Number of Barcodes Matching Pattern Greater than 10.Left 60% of Characters</heading>
-        <query>SELECT COUNT(ac.id), LEFT(ac.barcode,(ROUND(LENGTH(ac.barcode)*.6))::INT) FROM m_asset_copy ac WHERE barcode ~* '^x_' GROUP BY 2 HAVING COUNT(ac.id) > 10 ORDER BY 2</query>
-    </report>
-
-    <report>
-         <name>m_asset_stat_cats</name>
-        <report_title>Copy Statistical Categories</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Stat Cat Count.Library.Statistical Category</heading>
-        <query>SELECT COUNT(ac_sc.id), aou.name, ac_sc.name FROM m_asset_stat_cat_legacy ac_sc JOIN actor.org_unit aou ON aou.id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3</query>
-    </report>
-
-    <report>
-         <name>m_asset_stat_cats</name>
-        <report_title>Copy Statistical Categories</report_title>
-        <tag>assets</tag>
-        <iteration>1</iteration>
-        <heading>Stat Cat Count.Library.Statistical Category</heading>
-        <query>SELECT COUNT(ac_sc.id), aou.name, ac_sc.name FROM m_asset_stat_cat ac_sc JOIN actor.org_unit aou ON aou.id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3</query>
-    </report>
-
-    <report>
-        <name>m_asset_stat_cat_entries</name>
-        <report_title>Copy Stat Cat User Entries</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Copy Stat Count.Library.Statistical Category</heading>
-        <query>SELECT COUNT(map.id), aou.name, ac_sc.name FROM m_asset_stat_cat_entry_copy_map_legacy map JOIN m_asset_stat_cat_legacy ac_sc ON ac_sc.id = map.stat_cat JOIN actor.org_unit aou ON aou.id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3</query>
-    </report>
-
-    <report>
-        <name>m_asset_stat_cat_entries</name>
-        <report_title>Copy Stat Cat User Entries</report_title>
-        <tag>assets</tag>
-        <iteration>1</iteration>
-        <heading>Copy Stat Count.Library.Statistical Category</heading>
-        <query>SELECT COUNT(map.id), aou.name, ac_sc.name FROM m_asset_stat_cat_entry_copy_map map JOIN m_asset_stat_cat ac_sc ON ac_sc.id = map.stat_cat JOIN actor.org_unit aou ON aou.
-id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3</query>
-    </report>
-
-    <report>
-         <name>m_asset_copy_tags</name>
-        <report_title>Copy Tags</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Tag Count.Copy Tag Type.Copy Tag Label.Staff Note.Public</heading>
-        <query>SELECT COUNT(map.id), tag.tag_type, tag.label, tag.staff_note, tag.pub FROM m_asset_copy_tag tag JOIN m_asset_copy_tag_copy_map map ON map.tag = tag.id GROUP BY 2,3,4,5 ORDER BY 2,3</query>
-    </report>
-
-    <report>
-         <name>m_asset_copy_alerts</name>
-        <report_title>Copy Alerts</report_title>
-        <tag>assets</tag>
-        <iteration>0</iteration>
-        <heading>Alert Count.Alert Type</heading>
-               <query>SELECT COUNT(*), cat.name FROM m_asset_copy_alert aca JOIN config.copy_alert_type cat ON cat.id = aca.alert_type GROUP BY 2</query>
-    </report>
-
-    <!-- MONEY REPORTS -->
-
-    <report>
-        <name>m_money_billing_voided</name>
-        <report_title>Bills Voided And Not</report_title>
-        <tag>money</tag>
-        <iteration>0</iteration>
-        <heading>Count.Voided.Sum.Migrated</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount), a.x_migrate::TEXT FROM m_money_billing_legacy a GROUP BY 2, 4 ORDER BY 2, 4</query>
-    </report>
-
-    <report>
-        <name>m_money_billing_voided</name>
-        <report_title>Bills Voided And Not</report_title>
-        <tag>money</tag>
-        <iteration>1</iteration>
-        <heading>Count.Voided.Sum</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount) FROM m_money_billing a GROUP BY 2 ORDER BY 2, 3</query>
-    </report>
-
-    <report>
-        <name>m_money_billing_by_type</name>
-        <report_title>Bills by Type</report_title>
-        <tag>money</tag>
-        <iteration>0</iteration>
-        <heading>Count.Billing Type.Migrated</heading>
-        <query>SELECT COUNT(a.id), a.billing_type, a.x_migrate::TEXT FROM m_money_billing_legacy a GROUP BY 2, 3 ORDER BY 2, 3</query>
-    </report>
-
-    <report>
-        <name>m_money_billing_by_type</name>
-        <report_title>Bills by Type</report_title>
-        <tag>money</tag>
-        <iteration>1</iteration>
-        <heading>Count.Billing Type</heading>
-        <query>SELECT COUNT(a.id), a.billing_type FROM m_money_billing a GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>m_money_cash_payment</name>
-        <report_title>Cash Payments</report_title>
-        <tag>money</tag>
-        <iteration>0</iteration>
-        <heading>Count.Voided.Sum.Migrated</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount), a.x_migrate::TEXT FROM m_money_cash_payment_legacy a GROUP BY 2, 4 ORDER BY 2, 4</query>
-    </report>
-
-    <report>
-        <name>m_money_cash_payment</name>
-        <report_title>Cash Payments</report_title>
-        <tag>money</tag>
-        <iteration>1</iteration>
-        <heading>Count.Voided.Sum</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount) FROM m_money_cash_payment a GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>m_money_check_payment</name>
-        <report_title>Check Payments</report_title>
-        <tag>money</tag>
-        <iteration>0</iteration>
-        <heading>Count.Voided.Sum.Migrated</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount), a.x_migrate::TEXT FROM m_money_check_payment_legacy a GROUP BY 2, 4 ORDER BY 2, 4</query>
-    </report>
-
-    <report>
-        <name>m_money_forgive_payment</name>
-        <report_title>Forgive Payments</report_title>
-        <tag>money</tag>
-        <iteration>0</iteration>
-        <heading>Count.Voided.Sum.Migrated</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount), a.x_migrate::TEXT FROM m_money_forgive_payment_legacy a GROUP BY 2, 4 ORDER BY 2, 4</query>
-    </report>
-
-    <report>
-        <name>m_money_forgive_payment</name>
-        <report_title>Forgive Payments</report_title>
-        <tag>money</tag>
-        <iteration>1</iteration>
-        <heading>Count.Voided.Sum</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount) FROM m_money_forgive_paymen a GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>m_money_goods_payment</name>
-        <report_title>Goods Payments</report_title>
-        <tag>money</tag>
-        <iteration>0</iteration>
-        <heading>Count.Voided.Sum.Migrated</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount), a.x_migrate::TEXT FROM m_money_goods_payment_legacy a GROUP BY 2, 4 ORDER BY 2, 4</query>
-    </report>
-
-    <report>
-        <name>m_money_work_payment</name>
-        <report_title>Work Payments</report_title>
-        <tag>money</tag>
-        <iteration>0</iteration>
-        <heading>Count.Voided.Sum.Migrated</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount), a.x_migrate::TEXT FROM m_money_work_payment_legacy a GROUP BY 2, 4 ORDER BY 2, 4</query>
-    </report>
-
-    <report>
-        <name>m_money_credit_card_payment</name>
-        <report_title>Credit Card Payments</report_title>
-        <tag>money</tag>
-        <iteration>0</iteration>
-        <heading>Count.Voided.Sum.Migrated</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount), a.x_migrate::TEXT FROM m_money_credit_card_payment_legacy a GROUP BY 2, 4 ORDER BY 2, 4</query>
-    </report>
-
-    <report>
-        <name>m_money_credit_payment</name>
-        <report_title>Credit Payments</report_title>
-        <tag>money</tag>
-        <iteration>0</iteration>
-        <heading>Count.Voided.Sum.Migrated</heading>
-        <query>SELECT COUNT(a.id), a.voided::TEXT, SUM(a.amount), a.x_migrate::TEXT FROM m_money_credit_payment_legacy a GROUP BY 2, 4 ORDER BY 2, 4</query>
-    </report>
-
-
-    <!-- BIBS REPORTS -->
-
-    <report>
-        <name>bibs_loaded</name>
-        <report_title>Loaded Bibliographic Records</report_title>
-        <tag>bibs</tag>
-        <iteration>0</iteration>
-        <heading>Count</heading>
-        <query>SELECT COUNT(bre.id) FROM m_biblio_record_entry_legacy bre WHERE id IN (SELECT id FROM biblio.record_entry) ORDER BY 1</query>
-    </report>
-
-    <report>
-        <name>bibs_loaded</name>
-        <report_title>Loaded Bibliographic Records</report_title>
-        <tag>bibs</tag>
-        <iteration>1</iteration>
-        <heading>Count</heading>
-        <query>SELECT COUNT(bre.id) FROM m_biblio_record_entry bre WHERE id IN (SELECT id FROM biblio.record_entry) ORDER BY 1</query>
-    </report>
-
-    <report>
-        <name>bibswovolumes</name>
-        <report_title>Bibliographic Records Without Volumes</report_title>
-        <tag>bibs</tag>
-        <iteration>0</iteration>
-        <heading>Count</heading>
-        <query>SELECT COUNT(id) FROM m_biblio_record_entry where id NOT IN (SELECT DISTINCT record FROM m_asset_call_number)</query>
-               <note>These records would not have been loaded but many may be deduplicated against incumbent records.</note>
-    </report>
-
-    <report>
-        <name>bibswovolumesanduri</name>
-        <report_title>Bibliographic Records Without Volumes And Recognized URI</report_title>
-        <tag>bibs</tag>
-        <iteration>0</iteration>
-        <heading>Service.Domain.Count</heading>
-        <query>SELECT '3M','ebook.3m.com', COUNT(*) FROM subfield_u WHERE value ~* 'ebook.3m.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Axis 360','axis360.baker-taylor.com', COUNT(*) FROM subfield_u WHERE value ~* 'axis360.baker-taylor.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Book Flix','bookflix.digital.scholastic.com', COUNT(*) FROM subfield_u WHERE value ~* 'bookflix.digital.scholastic.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Book Flix','bkflix.grolier.com', COUNT(*) FROM subfield_u WHERE value ~* 'bkflix.grolier.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Comics Plus','library.comicsplusapp.com', COUNT(*) FROM subfield_u WHERE value ~* 'library.comicsplusapp.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Ebrary','site.ebrary.com', COUNT(*) FROM subfield_u WHERE value ~* 'site.ebrary.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Freading','freading.com', COUNT(*) FROM subfield_u WHERE value ~* 'freading.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Hoopla','hoopladigital.com', COUNT(*) FROM subfield_u WHERE value ~* 'hoopladigital.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Infobase','avod.infobase.com', COUNT(*) FROM subfield_u WHERE value ~* 'avod.infobase.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Learning Express','learningexpresslibrary.com', COUNT(*) FROM subfield_u WHERE value ~* 'learningexpresslibrary.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Missouri Overdrive','molib2go.org', COUNT(*) FROM subfield_u WHERE value ~* 'molib2go.org' GROUP BY 1, 2 UNION ALL
-               SELECT 'netLibrary','netLibrary.com', COUNT(*) FROM subfield_u WHERE value ~* 'netLibrary.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'OneClickDigital','oneclickdigital.com', COUNT(*) FROM subfield_u WHERE value ~* 'oneclickdigital.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'Overdrive','overdrive.com', COUNT(*) FROM subfield_u WHERE value ~* 'overdrive.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'ProQuest','ebookcentral.proquest.com', COUNT(*) FROM subfield_u WHERE value ~* 'ebookcentral.proquest.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'RB Digital','rbdigital.com', COUNT(*) FROM subfield_u WHERE value ~* 'rbdigital.com' GROUP BY 1, 2 UNION ALL
-               SELECT 'U.S. Government Sites','.gov', COUNT(*) FROM subfield_u WHERE value ~* '\.gov' GROUP BY 1,2;;
-               </query>
-        <note>This list is built from known services and domains. If you have records for electronic resources that are not here please let us know.</note>
-    </report>
-
-    <report>
-        <name>bibswuri</name>
-        <report_title>Bibliographic Records With 856$9s</report_title>
-        <tag>bibs</tag>
-        <iteration>0</iteration>
-        <heading>Count</heading>
-        <query>SELECT COUNT(id) FROM m_biblio_record_entry where id IN (SELECT record FROM asset.call_number WHERE label ~* '##URI##')</query>
-    </report>
-
-       <report>
-               <name>bibsff</name>
-               <report_title>Bibliographic Records with Adjusted Fixed Fields</report_title>
-               <tag>bibs</tag>
-               <iteration>0</iteration>
-               <heading>Count.Original Search Format.New Search Format</heading>
-               <query>SELECT COUNT(*), ARRAY_TO_STRING(x_search_format,','), ARRAY_TO_STRING(x_after_search_format,',') FROM m_biblio_record_entry_legacy WHERE x_migrate AND x_after_search_format IS NOT NULL GROUP BY 2, 3 ORDER BY 3,2</query>
-       </report>
-
-    <report>
-        <name>bibs_notes</name>
-        <report_title>Bib Record Notes</report_title>
-        <tag>bibs</tag>
-        <iteration>0</iteration>
-        <heading>Count.Migrated</heading>
-        <query>SELECT COUNT(b.id), b.x_migrate::TEXT FROM m_biblio_record_note_legacy b GROUP BY 2</query>
-    </report>
-
-    <report>
-        <name>bibs_notes</name>
-        <report_title>Bib Record Notes</report_title>
-        <tag>bibs</tag>
-        <iteration>1</iteration>
-        <heading>Count</heading>
-        <query>SELECT COUNT(b.id) FROM m_biblio_record_note b</query>
-    </report>
-
-    <report>
-        <name>bibs_peers</name>
-        <report_title>Peer Bib Copies</report_title>
-        <tag>bibs</tag>
-        <iteration>0</iteration>
-        <heading>Count.Migrated</heading>
-        <query>SELECT COUNT(b.id), b.x_migrate::TEXT FROM m_biblio_peer_bib_copy_map_legacy b GROUP BY 2</query>
-    </report>
-
-    <report>
-        <name>bibs_peers</name>
-        <report_title>Peer Bib Copies</report_title>
-        <tag>bibs</tag>
-        <iteration>1</iteration>
-        <heading>Count</heading>
-        <query>SELECT COUNT(b.id) FROM m_biblio_peer_bib_copy_map b</query>
-    </report>
-
-    <report>
-        <name>bibs_parts</name>
-        <report_title>Monograph Parts</report_title>
-        <tag>bibs</tag>
-        <iteration>0</iteration>
-        <heading>Count.Migrated</heading>
-        <query>SELECT COUNT(b.id), b.x_migrate::TEXT FROM m_biblio_monograph_part_legacy b GROUP BY 2</query>
-    </report>
-
-    <report>
-        <name>bibs_parts</name>
-        <report_title>Monograph Parts</report_title>
-        <tag>bibs</tag>
-        <iteration>1</iteration>
-        <heading>Count</heading>
-        <query>SELECT COUNT(b.id) FROM m_biblio_monograph_part b</query>
-    </report>
-
-    <report>
-        <name>bib_merges</name>
-        <report_title>Bibliographic Merge Count</report_title>
-        <tag>bibs</tag>
-        <iteration>0</iteration>
-        <heading>Records Merged.Incumbent Records Merged Into</heading>
-        <query>SELECT SUM(array_length(records,1)), COUNT(*) FROM groups</query>
-    </report>
-
-    <!-- ACTORS REPORTS -->
-
-    <report>
-        <name>usrsbyorg</name>
-        <report_title>Migrated Patrons by Home Org</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count.Library</heading>
-        <query>SELECT COUNT(au.id), aou.name FROM m_actor_usr_legacy au JOIN actor.org_unit aou ON aou.id = au.home_ou WHERE au.x_migrate = TRUE GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>nonmigusrsbyorg</name>
-        <report_title>Non-Migrated Patrons by Home Org</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count.Library</heading>
-        <query>SELECT COUNT(au.id), aou.name FROM m_actor_usr_legacy au JOIN actor.org_unit aou ON aou.id = au.home_ou WHERE au.x_migrate = FALSE GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>usrsbypgt</name>
-        <report_title>Migrated Patrons by Permission Group</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count.Permission Group</heading>
-        <query>SELECT COUNT(au.id), pgt.name FROM m_actor_usr_legacy au JOIN permission.grp_tree pgt ON pgt.id = au.profile WHERE au.x_migrate = TRUE GROUP BY 2 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>active_usrs</name>
-        <report_title>Patron by Active Status</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count of Users.Active</heading>
-        <query>SELECT COUNT(id), active::TEXT FROM m_actor_usr_legacy WHERE x_migrate = TRUE GROUP BY 2</query>
-    </report>
-
-    <report>
-        <name>active_usrs</name>
-        <report_title>Patron Cards</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Count of Users</heading>
-        <query>SELECT COUNT(id) FROM m_actor_usr</query>
-    </report>
-
-    <report>
-        <name>active_usr_barcodes</name>
-        <report_title>Patron Barcodes by Active Status</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count of Barcodes.Active.Migrated</heading>
-        <query>SELECT COUNT(id), active::TEXT, x_migrate::TEXT FROM m_actor_card_legacy GROUP BY 2, 3</query>
-    </report>
-
-    <report>
-        <name>active_usr_barcodes</name>
-        <report_title>Patron Barcodes by Active Status</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Count of Barcodes.Active</heading>
-        <query>SELECT COUNT(id), active::TEXT FROM m_actor_card GROUP BY 2</query>
-    </report>
-
-    <report>
-        <name>usr_barcode_patterns</name>
-        <report_title>Common Barcode Starting Patterns</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count of Barcodes (greater than 10).Left 60% of Characters</heading>
-        <query>SELECT COUNT(acard.id), LEFT(acard.barcode,(ROUND(LENGTH(acard.barcode)*.6))::INT) FROM m_actor_card_legacy acard WHERE acard.x_migrate = TRUE GROUP BY 2 HAVING COUNT(acard.id) > 10 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>usr_barcode_patterns</name>
-        <report_title>Common Barcode Starting Patterns</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Count of Barcodes (greater than 10).Left 60% of Characters</heading>
-        <query>SELECT COUNT(acard.id), LEFT(acard.barcode,(ROUND(LENGTH(acard.barcode)*.6))::INT) FROM m_actor_card acard GROUP BY 2 HAVING COUNT(acard.id) > 10 ORDER BY 2</query>
-    </report>
-   <report>
-        <name>usr_barcode_collisions</name>
-        <report_title>Patron Barcode Collisions</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Collision Count</heading>
-        <query>SELECT COUNT(acard.id) FROM m_actor_card_legacy acard WHERE barcode ~* '^x_' AND x_migrate = TRUE</query>
-    </report>
-
-    <report>
-        <name>usr_barcode_collisions</name>
-        <report_title>Patron Barcode Collisions</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Collision Count</heading>
-        <query>SELECT COUNT(acard.id) FROM m_actor_card acard WHERE barcode ~* '^x_'</query>
-    </report>
-
-    <report>
-        <name>usr_barcode_collision_shortlist</name>
-        <report_title>Patron Barcode Collisions (first 20)</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Collision List</heading>
-        <query>SELECT acard.barcode FROM m_actor_card_legacy acard WHERE acard.barcode ~* '^x_' AND acard.x_migrate = TRUE ORDER BY 1 LIMIT 20</query>
-        <note>This is a shortlist of patron barcode collisions that maxes out at 20.  If there are more collisions we will need to run a custom report.  In some cases we may flag individual accounts to not migrate.</note>
-    </report>
-
-    <report>
-        <name>usr_barcode_collision_shortlist</name>
-        <report_title>Patron Barcode Collisions (first 20)</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Collision List</heading>
-        <query>SELECT acard.barcode FROM m_actor_card acard WHERE acard.barcode ~* '^x_%' ORDER BY 1 LIMIT 20</query>
-        <note>This is a shortlist of patron barcode collisions that maxes out at 20.  If there are more collisions we will need to run a custom report.  In some cases we may flag individual accounts to not migrate.</note>
-    </report>
-
-    <report>
-        <name>usr_barcode_collision_patterns</name>
-        <report_title>Common Patron Barcode Collision Patterns</report_title> a.x_migrate
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Number of Barcodes Matching Pattern Greater than 10.Left 60% of Characters</heading>
-        <query>SELECT COUNT(acard.id), LEFT(acard.barcode,(ROUND(LENGTH(acard.barcode)*.6))::INT) FROM m_actor_card_legacy acard WHERE (acard.barcode ~* 'collision' OR acard.barcode ~* '^x_') AND acard.x_migrate = TRUE GROUP BY 2 HAVING COUNT(acard.id) > 10 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>usr_barcode_collision_patterns</name>
-        <report_title>Common Patron Barcode Collision Patterns</report_title> a.x_migrate
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Number of Barcodes Matching Pattern Greater than 10.Left 60% of Characters</heading>
-        <query>SELECT COUNT(acard.id), LEFT(acard.barcode,(ROUND(LENGTH(acard.barcode)*.6))::INT) FROM m_actor_card acard WHERE (acard.barcode ~* 'collision' OR acard.barcode ~* '^x_') GROUP BY 2 HAVING COUNT(acard.id) > 10 ORDER BY 2</query>
-    </report>
-
-    <report>
-        <name>usr_addressses_status</name>
-        <report_title>Patron Addresses</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count</heading>
-        <query>SELECT COUNT(aua.id) FROM m_actor_usr_address_legacy aua WHERE aua.x_migrate = TRUE</query>
-    </report>
-
-    <report>
-        <name>usr_addressses_status</name>
-        <report_title>Patron Addresses</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Count</heading>
-        <query>SELECT COUNT(aua.id) FROM m_actor_usr_address aua</query>
-    </report>
-
-    <report>
-        <name>usr_addresses_pending</name>
-        <report_title>Patron Addresses by Pending Status</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count of Addresses.Pending</heading>
-        <query>SELECT COUNT(aua.id), pending::TEXT FROM m_actor_usr_address_legacy aua WHERE aua.x_migrate = TRUE GROUP BY 2</query>
-    </report>
-
-    <report>
-        <name>usr_addresses_pending</name>
-        <report_title>Patron Addresses by Pending Status</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Count of Addresses.Pending</heading>
-        <query>SELECT COUNT(aua.id), pending::TEXT FROM m_actor_usr_address aua GROUP BY 2</query>
-    </report>
-
-    <report>
-        <name>usr_messages</name>
-        <report_title>Patron Messages</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count.Deleted.Migrated</heading>
-        <query>SELECT COUNT(aum.id), deleted::TEXT, x_migrate::TEXT FROM m_actor_usr_message_legacy aum GROUP BY 2, 3</query>
-    </report>
-
-    <report>
-        <name>usr_messages</name>
-        <report_title>Patron Messages</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Count.Deleted</heading>
-        <query>SELECT COUNT(aum.id), deleted::TEXT FROM m_actor_usr_message_legacy aum GROUP BY 2</query>
-    </report>
-
-    <report>
-        <name>usr_notes</name>
-        <report_title>Patron Notes</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count.Public.Migrated</heading>
-        <query>SELECT COUNT(aun.id), pub::TEXT, x_migrate::TEXT FROM m_actor_usr_note_legacy aun GROUP BY 2, 3</query>
-    </report>
-
-    <report>
-        <name>usr_notes</name>
-        <report_title>Patron Notes</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Count.Public</heading>
-        <query>SELECT COUNT(aun.id), pub::TEXT FROM m_actor_usr_note aun GROUP BY 2</query>
-    </report>
-
-    <report>
-         <name>usr_stat_cats</name>
-        <report_title>Patron Statistical Categories</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Stat Cat Count.Library.Statistical Category.Migrated</heading>
-        <query>SELECT COUNT(au_sc.id), aou.name, au_sc.name, au_sc.x_migrate::TEXT FROM m_actor_stat_cat_legacy au_sc JOIN actor.org_unit aou ON aou.id = au_sc.owner GROUP BY 2, 3, 4 ORDER BY 2, 3, 4</query>
-    </report>
-
-    <report>
-         <name>usr_stat_cats</name>
-        <report_title>Patron Statistical Categories</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Stat Cat Count.Library.Statistical Category</heading>
-        <query>SELECT COUNT(au_sc.id), aou.name, au_sc.name FROM m_actor_stat_cat au_sc JOIN actor.org_unit aou ON aou.id = au_sc.owner GROUP BY 2, 3 ORDER BY 2, 3</query>
-    </report>
-
-    <report>
-        <name>usr_stat_cat_entries</name>
-        <report_title>Patron Stat Cat User Entries</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Patron Stat Count.Library.Statistical Category.Migrated</heading>
-        <query>SELECT COUNT(map.id), aou.name, au_sc.name, map.x_migrate::TEXT FROM m_actor_stat_cat_entry_usr_map_legacy map JOIN m_actor_stat_cat_legacy au_sc ON au_sc.id = map.stat_cat JOIN actor.org_unit aou ON aou.id = au_sc.owner GROUP BY 2, 3, 4 ORDER BY 2,3, 4</query>
-    </report>
-
-    <report>
-        <name>usr_stat_cat_entries</name>
-        <report_title>Patron Stat Cat User Entries</report_title>
-        <tag>actors</tag>
-        <iteration>1</iteration>
-        <heading>Patron Stat Count.Library.Statistical Category</heading>
-        <query>SELECT COUNT(map.id), aou.name, au_sc.name FROM m_actor_stat_cat_entry_usr_map map JOIN m_actor_stat_cat au_sc ON au_sc.id = map.stat_cat JOIN actor.org_unit aou ON aou.id = au_sc.owner GROUP BY 2, 3 ORDER BY 2,3</query>
-    </report>
-
-    <report>
-        <name>usr_thresholds</name>
-        <report_title>Patron Thresholds</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Pateron Group.Org Unit.Penalty.Threshold</heading>
-        <query>SELECT pgt.name, aou.shortname, sp.name, p.threshold FROM permission_grp_penalty_threshold p 
-                JOIN actor.org_unit aou ON aou.id = p.org_unit JOIN permission.grp_tree pgt ON pgt.id = p.grp JOIN config.standing_penalty sp ON sp.id = p.penalty
-                ORDER BY 2, 1, 3</query>
-    </report>
-
-    <report>
-        <name>usr_settings</name>
-        <report_title>Patron Settings</report_title>
-        <tag>actors</tag>
-        <iteration>0</iteration>
-        <heading>Count.Setting.Value</heading>
-        <query>SELECT COUNT(*), name, 'User''s Phone' FROM m_actor_usr_setting WHERE name IN ('opac.default_phone') GROUP BY 2, 3 
-                       UNION ALL SELECT COUNT(*), name, value FROM m_actor_usr_setting WHERE name IN ('opac.hold_notify') GROUP BY 2, 3 
-                       UNION ALL SELECT COUNT(*), a.name, aou.shortname FROM m_actor_usr_setting a JOIN actor.org_unit aou ON aou.id = REPLACE(a.value,'"','')::INTEGER 
-                               WHERE a.name IN ('opac.default_pickup_location','opac.default_search_location') GROUP BY 2, 3 ORDER BY 2, 3;</query>
-    </report>
-
-    <!-- ACQUISITIONS REPORTS -->
-    <report>
-        <name>fund_count</name>
-        <iteration>0</iteration>
-        <tag>acq</tag>
-        <report_title>Migrated Funds</report_title>
-        <heading>Number of Funds.Migrated</heading>
-        <query>SELECT COUNT(id), x_migrate::TEXT FROM m_acq_fund_legacy GROUP BY 2;</query>
-    </report>
-
-    <report>                                                                        
-        <name>fund_count</name>
-        <iteration>1</iteration>
-        <tag>acq</tag>
-        <report_title>Migrated Funds</report_title>
-        <heading>Number of Funds</heading>
-        <query>SELECT COUNT(id) FROM m_acq_fund;</query>
-    </report>
-
-    <report>
-        <name>invoice_count</name>
-        <iteration>0</iteration>
-        <tag>acq</tag>
-        <report_title>Migrated Invoices</report_title>
-        <heading>Number of Invoices.Migrated</heading>
-        <query>SELECT COUNT(id), x_migrate::TEXT FROM m_acq_invoice_legacy GROUP BY 2;</query>
-    </report>
-
-    <report>
-        <name>invoice_count</name>
-        <iteration>1</iteration>
-        <tag>acq</tag>
-        <report_title>Migrated Invoices</report_title>
-        <heading>Number of Funds</heading>
-        <query>SELECT COUNT(id) FROM m_acq_invoice;</query>
-    </report>    
-
-    <!-- SERIALS REPORTS -->
-    <report>
-        <name>serials_mfhd_count</name>
-        <tag>serials</tag>
-        <iteration>0</iteration>
-        <report_title>Migrated Serial MFHDs</report_title>
-        <heading>Number of MFHDs</heading>
-        <query>SELECT COUNT(id) FROM m_serial_record_entry</query>
-    </report>
-
-    <!-- DEDUPE REPORTS -->
-
-    <asset>
-        <name>dedupe_explain</name>
-        <tag>dedupe</tag>
-        <file>dedupe_process.asciidoc</file> 
-    </asset>
-
-    <report>
-        <name>dedupe_bib_groups</name>
-        <tag>dedupe</tag>
-        <iteration>0</iteration>
-        <report_title>Scoring and Bib Record Groups</report_title>
-        <heading>Count.Bib Record Groups</heading>
-        <query>SELECT COUNT(id), 'Total Bibs Being Evaluated' FROM biblio.record_entry WHERE deleted IS FALSE AND id IN (SELECT eg::BIGINT FROM bib_id_map)
-          UNION ALL SELECT (COUNT(DISTINCT incoming_bib)), 'Incoming Bibs With Matches Found' FROM bib_matches
-          UNION ALL SELECT (COUNT(bre.id) - (SELECT COUNT(DISTINCT incoming_bib) FROM bib_matches)), 'Incoming Bibs With No Match' 
-                FROM biblio.record_entry bre WHERE bre.deleted IS FALSE AND bre.id IN (SELECT eg::BIGINT FROM bib_id_map)
-          UNION ALL SELECT COUNT(DISTINCT incoming_bib), 'Incoming Bibs Being Merged into Incumbent' FROM bib_matches WHERE incumbent_bib_score &gt;= incoming_bib_score
-          UNION ALL SELECT COUNT(id), 'Incumbent Bibs With Higher Scores to Incoming' FROM bib_matches WHERE incumbent_bib_score &gt; incoming_bib_score
-          UNION ALL SELECT COUNT(id), 'Incumbent Bibs With Equal Scores to Incoming' FROM bib_matches WHERE incumbent_bib_score = incoming_bib_score
-          UNION ALL SELECT COUNT(id), 'Incumbent Bibs  With Lower Scores to Incoming' FROM bib_matches WHERE incumbent_bib_score &lt; incoming_bib_score
-          ;</query>
-    </report>
-
-    <report>
-        <name>dedupe_format_count</name>
-        <tag>dedupe</tag>
-        <iteration>0</iteration>
-        <report_title>Count of Items Matching By Format</report_title>
-        <heading>Count.Format(s)</heading>
-        <query>SELECT COUNT(id), search_formats FROM bib_matches GROUP BY 2 ORDER BY 2;</query>
-    </report>
-    
-    <report>
-        <name>dedupe_score_ranges</name>
-        <tag>dedupe</tag>
-        <iteration>0</iteration>
-        <report_title>Count of Items Matching By Format</report_title>
-        <heading>Lowest Record Score.Largest Record Score.Record Set</heading>
-        <query>SELECT MIN(incumbent_bib_score), MAX(incumbent_bib_score), 'Incumbent Records' FROM bib_matches 
-            UNION ALL SELECT MIN(incoming_bib_score), MAX(incoming_bib_score), 'Incoming Records' FROM bib_matches ;
-        </query>
-    </report>
-    
-    
-    <report>
-        <name>dedupe_sample_set</name>
-        <tag>dedupe</tag>
-        <iteration>0</iteration>
-        <report_title>Sample of 20 Matching Dedupe Record Sets</report_title>
-        <heading>Bib Being Merged Into.Bib Being Merged</heading>
-        <query>SELECT incumbent_bib, incoming_bib FROM bib_matches WHERE incumbent_bib_score &gt;= incoming_bib_score LIMIT 20 ;
-        </query>
-    </report>
-
-    <!-- NOTICES REPORTS -->
-
-    <report>
-        <name>notices_overview</name>
-        <tag>notices</tag>
-        <iteration>0</iteration>
-        <report_title>Action Triggers Setup for Notices</report_title>
-        <heading>ID.Active.Owner.Name</heading>
-        <query>SELECT ed.id, ed.active::TEXT, aou.shortname, ed.name
-            FROM action_trigger.event_definition ed 
-            JOIN actor.org_unit aou ON aou.id = ed.owner 
-            WHERE ed.owner IN (SELECT DISTINCT home_ou FROM m_actor_usr)
-            OR ed.owner IN (SELECT DISTINCT parent_ou FROM actor.org_unit WHERE id in (SELECT DISTINCT home_ou FROM m_actor_usr));
-        </query>
-    </report>
-
-    <report>
-        <name>notices_count</name>
-        <tag>notices</tag>
-        <iteration>0</iteration>
-        <report_title>Count of Notices Run with State</report_title>
-        <heading>Count of Notices.State.ID.Owner.Name</heading>
-        <query>SELECT COUNT(ate.id), ate.state, ed.id, aou.shortname, ed.name 
-            FROM action_trigger.event_definition ed 
-            JOIN actor.org_unit aou ON aou.id = ed.owner 
-            JOIN action_trigger.event ate ON ate.event_def = ed.id 
-            WHERE ed.owner IN (SELECT DISTINCT home_ou FROM m_actor_usr)
-            OR ed.owner IN (SELECT DISTINCT parent_ou FROM actor.org_unit WHERE id in (SELECT DISTINCT home_ou FROM m_actor_usr))
-            GROUP BY 2,3,4;
-        </query>
-    </report>
-
-
-</reports_file>
-