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

Evergreen Git git at git.evergreen-ils.org
Tue Dec 20 19:47:50 EST 2011


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  447e0d800963a1e64845adecbc7a09e9fc1a96c4 (commit)
       via  4a2b6049eadf5e42982189bb0c03f485a6056ac2 (commit)
       via  3827196fc40c620ca17d5ac8c00b8a61d6cb5ada (commit)
      from  a7cf3cf191a6f36fe6cbd9df88f6faeb928d9b06 (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 447e0d800963a1e64845adecbc7a09e9fc1a96c4
Author: Dan Scott <dscott at laurentian.ca>
Date:   Tue Dec 20 16:19:08 2011 -0500

    Add "Last circulation date" field to new rcl view
    
    Some libraries will want the option of filtering out copies which have
    truly never circulated, so offering up the bare "last circulation date"
    field rather than coalescing it with "create date" will give report
    writers the ability to use an IS NOT NULL clause.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index fd47489..7e0b301 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -8733,19 +8733,21 @@ SELECT  usr,
 		</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 Date">
+	<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
                 ac.id,
-                coalesce(max(actac.xact_start), ac.create_date) as last_circ_or_create
+                COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
+                MAX(actac.xact_start) AS last_circ
             FROM asset.copy ac
                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
-            GROUP BY ac.id, ac.create_date
+            GROUP BY ac.id
 
             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
             --SELECT
             --    ac.id,
-            --    greatest(max(actac.xact_start), erlct.last_cko_ts, ac.create_date) as last_circ
+            --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
+            --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
             --FROM asset.copy ac
             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
@@ -8754,6 +8756,7 @@ SELECT  usr,
 		<fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
 			<field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
 			<field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
+			<field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
 		</fields>
 		<links>
 			<link field="id" reltype="has_a" key="id" map="" class="acp"/>

commit 4a2b6049eadf5e42982189bb0c03f485a6056ac2
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Sep 6 12:46:04 2011 -0400

    Last Circulation timestamp for reports
    
    Specifically intended for Weeding reports.
    
    Easily swapped out (if needed) to include legacy circ data,
    when available from a migration.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 6d35afe..fd47489 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -5221,6 +5221,7 @@ SELECT  usr,
 			<field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
+			<field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
@@ -5242,6 +5243,7 @@ SELECT  usr,
 			<link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
 			<link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
 			<link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
+			<link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
 			<link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
 			<link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
 			<link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
@@ -8731,6 +8733,38 @@ SELECT  usr,
 		</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 Date">
+		<oils_persist:source_definition>
+            SELECT
+                ac.id,
+                coalesce(max(actac.xact_start), ac.create_date) as last_circ_or_create
+            FROM asset.copy ac
+                 LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
+            GROUP BY ac.id, ac.create_date
+
+            -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
+            --SELECT
+            --    ac.id,
+            --    greatest(max(actac.xact_start), erlct.last_cko_ts, ac.create_date) as last_circ
+            --FROM asset.copy ac
+            --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
+            --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
+            --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
+		</oils_persist:source_definition>
+		<fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
+			<field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
+			<field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
+		</fields>
+		<links>
+			<link field="id" reltype="has_a" key="id" map="" class="acp"/>
+		</links>
+		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+			<actions>
+				<retrieve/>
+			</actions>
+		</permacrud>
+	</class>
+
 	<!-- ********************************************************************************************************************* -->
 	<!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
 	<!-- ********************************************************************************************************************* -->

commit 3827196fc40c620ca17d5ac8c00b8a61d6cb5ada
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Sep 6 11:38:18 2011 -0400

    Hold ratios by pickup library for reports
    
    Specifically intended for "point in time" reports.
    
    In our case, per-library purchase alerts.
    
    Uses Hold Copy Map table to get more accurate numbers for copy/volume/part holds.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 2c4772a..6d35afe 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -8680,6 +8680,57 @@ SELECT  usr,
 		</permacrud>
 	</class>
 
+	<class id="rhcrpbap" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_pickup" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Pickup Library">
+		<oils_persist:source_definition>
+            SELECT *,
+                CASE WHEN copy_count_at_pickup_library = 0 THEN 'Infinity'::FLOAT ELSE holds_at_pickup_library::FLOAT/copy_count_at_pickup_library END AS pickup_library_ratio,
+                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, 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
+                )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" reporter:datatype="org_unit"/>
+			<field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
+			<field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" 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" name="pickup_library_ratio" 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>
+
 	<!-- ********************************************************************************************************************* -->
 	<!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
 	<!-- ********************************************************************************************************************* -->

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

Summary of changes:
 Open-ILS/examples/fm_IDL.xml |   88 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 88 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list