[open-ils-commits] [GIT] Evergreen ILS branch master updated. f2ca2d7f9c79561a04f6ac1ae61bc6537f0acc65

Evergreen Git git at git.evergreen-ils.org
Wed Mar 2 15:07:18 EST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  f2ca2d7f9c79561a04f6ac1ae61bc6537f0acc65 (commit)
       via  3ac253a06bdc1db6d39efe53b07a69c9a74d5442 (commit)
       via  4c9f565570b8b8b3f3b8ad7d31a878afa498638c (commit)
      from  315beb4572e9c13a928f59f6fe4f23cc4e4d13b3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f2ca2d7f9c79561a04f6ac1ae61bc6537f0acc65
Author: Josh Stompro <stomproj at larl.org>
Date:   Wed Dec 16 11:31:40 2015 -0600

    LP#1516022: new reporting source for hold/copy ratios
    
    Fixed the link field name so it matches the new field name for the
    Pickup Library, pickup_lib_or_desc.
    
    Signed-off-by: Josh Stompro <stomproj at larl.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 4a56269..a51113f 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -10621,7 +10621,7 @@ SELECT  usr,
 		</fields>
 		<links>
 			<link field="id" reltype="has_a" key="id" map="" class="bre"/>
-			<link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
+			<link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
 		</links>
 		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
 			<actions>

commit 3ac253a06bdc1db6d39efe53b07a69c9a74d5442
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Fri Nov 13 14:19:17 2015 +0000

    LP#1516022: add release note
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Josh Stompro <stomproj at larl.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/docs/RELEASE_NOTES_NEXT/Administration/new_hold_copy_ratio_reporting_source.adoc b/docs/RELEASE_NOTES_NEXT/Administration/new_hold_copy_ratio_reporting_source.adoc
new file mode 100644
index 0000000..8ab77e1
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Administration/new_hold_copy_ratio_reporting_source.adoc
@@ -0,0 +1,20 @@
+New Reporting Source for Hold/Copy Ratios
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+A new reporting source is added, "Hold/Copy Ratio per Bib
+and Pickup Library (and Descendants)", that, for each bib
+that has a hold request on it or any of its components,
+calculates the following:
+
+ * active holds at each OU (including the OU's descendants)
+ * holdable copies at each OU (and its descendants)
+ * the ratio of the above two counts
+ * counts and ratio across the entire consortium
+
+This source differs from the "Hold/Copy Ratio per Bib
+and Pickup Library" source by including all descendants
+of the organization unit one is filtering on.
+
+One use case is allowing a multi-branch system within an
+Evergreen consortium that doesn't do full resource sharing
+to readily calculate whether additional copies should be
+purchased for that system.

commit 4c9f565570b8b8b3f3b8ad7d31a878afa498638c
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Mon Oct 19 20:41:12 2015 +0000

    LP#1516022: new reporting source for hold/copy ratios
    
    This patch adds a new reporting source, "Hold/Copy Ratio per Bib
    and Pickup Library (and Descendants)", that, for each bib
    that has a hold request on it or any of its components,
    calculates the following:
    
     - active holds at each OU (including the OU's descendants)
     - holdable copies at each OU (and its descendants)
     - the ratio of the above two counts
     - counts and ratio across the entire consortium
    
    This work was sponsored by the Pennsylvania Integrated Library
    System (PaILS).
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Josh Stompro <stomproj at larl.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 8e8df0e..4a56269 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -10574,6 +10574,62 @@ SELECT  usr,
 		</permacrud>
 	</class>
 
+	<class id="rhcrpbapd" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_pickup_desc" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Pickup Library (and Descendants) ">
+		<oils_persist:source_definition>
+            WITH counts_at_ou AS (
+                SELECT bib_record, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library, 
+                    COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
+                FROM action.hold_request ahr
+                JOIN reporter.hold_request_record rhrr USING (id)
+                LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
+                LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
+                WHERE ahr.cancel_time IS NULL
+                AND ahr.fulfillment_time IS NULL
+                GROUP BY bib_record, pickup_lib
+            )
+            SELECT *,
+                CASE WHEN copy_count_at_or_below = 0 THEN 'Infinity'::FLOAT ELSE holds_at_or_below::FLOAT/copy_count_at_or_below END AS hold_copy_ratio_at_or_below_ou,
+                CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
+            FROM
+                (SELECT bib_record AS id, aou.id AS pickup_lib_or_desc, SUM(holds_at_pickup_library) AS holds_at_or_below, SUM(copy_count_at_pickup_library) AS copy_count_at_or_below
+                FROM actor.org_unit aou
+                JOIN counts_at_ou cao ON (cao.pickup_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))) 
+                GROUP BY bib_record, pickup_lib_or_desc
+                )x
+                JOIN
+                (SELECT bib_record AS id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
+                    FROM
+                        action.hold_request ahr
+                        JOIN reporter.hold_request_record rhrr USING (id)
+                        LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
+                    WHERE
+                        ahr.cancel_time IS NULL
+                        AND ahr.fulfillment_time IS NULL
+                    GROUP BY bib_record
+                )y
+                USING (id)
+		</oils_persist:source_definition>
+		<fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
+			<field reporter:label="Record ID" name="id" reporter:datatype="link"/>
+			<field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
+			<field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
+			<field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
+			<field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
+			<field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
+			<field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
+			<field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
+		</fields>
+		<links>
+			<link field="id" reltype="has_a" key="id" map="" class="bre"/>
+			<link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
+		</links>
+		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+			<actions>
+				<retrieve/>
+			</actions>
+		</permacrud>
+	</class>
+
 	<class id="rlc" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::last_circ_date" oils_persist:readonly="true" reporter:label="Last Circulation or Creation Date">
 		<oils_persist:source_definition>
             SELECT

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |   56 ++++++++++++++++++++
 .../new_hold_copy_ratio_reporting_source.adoc      |   20 +++++++
 2 files changed, 76 insertions(+), 0 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/Administration/new_hold_copy_ratio_reporting_source.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list