LP#1582354 - Add owning_lib to available links.
authorChris Sharp <csharp@georgialibraries.org>
Thu, 29 Sep 2016 17:08:15 +0000 (13:08 -0400)
committerJason Etheridge <jason@EquinoxInitiative.org>
Tue, 29 Aug 2017 21:21:48 +0000 (17:21 -0400)
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/extend-reporter.sql

index 515f766..90d83f1 100644 (file)
@@ -9494,7 +9494,8 @@ SELECT  usr,
        <class id="erccpo" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::copy_count_per_org" oils_persist:tablename="extend_reporter.copy_count_per_org" reporter:label="Library Holdings Count with Deleted">
                <fields oils_persist:primary="bibid">
                        <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
-                       <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="id" />
+                       <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
+                       <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
                        <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
                        <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
                        <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
@@ -9504,6 +9505,7 @@ SELECT  usr,
                <links>
                        <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
                        <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
+                       <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
                </links>
                <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
                        <actions>
index ca94530..a524cbb 100644 (file)
@@ -58,6 +58,7 @@ CREATE OR REPLACE VIEW extend_reporter.global_bibs_by_holding_update AS
 CREATE OR REPLACE VIEW extend_reporter.copy_count_per_org AS
  SELECT acn.record AS bibid,
     ac.circ_lib,
+       acn.owning_lib,
     max(ac.edit_date) AS last_edit_time,
     min(ac.deleted::integer) AS has_only_deleted_copies,
     count(
@@ -74,6 +75,6 @@ CREATE OR REPLACE VIEW extend_reporter.copy_count_per_org AS
    FROM asset.call_number acn,
     asset.copy ac
   WHERE ac.call_number = acn.id
-  GROUP BY acn.record, ac.circ_lib;
+  GROUP BY acn.record, acn.owning_lib, ac.circ_lib;
 
 COMMIT;