Add two fields to the new FlattenerGrid-based hold pull list
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 27 Jun 2012 22:38:19 +0000 (18:38 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 3 Oct 2012 18:34:23 +0000 (14:34 -0400)
Namely (current) copy status and (number of) potential copies.

I believe this implementation has a negligible impact on the efficiency
of the hold pull list query overall.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/templates/circ/hold_pull_list.tt2

index f7ef3fa..5b9725a 100644 (file)
@@ -5048,7 +5048,8 @@ SELECT  usr,
                        TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
                                AS call_number_label,
                        siss.label AS issuance_label,
-                       (ahr.usr <> ahr.requestor) AS is_staff_hold
+                       (ahr.usr <> ahr.requestor) AS is_staff_hold,
+                       ahcm_1.copy_count AS potential_copies
                FROM action.hold_request ahr
                JOIN asset.copy acp ON (acp.id = ahr.current_copy)
                JOIN asset.call_number acn ON (acp.call_number = acn.id)
@@ -5071,6 +5072,11 @@ SELECT  usr,
                                        )
                                )
                        )
+               JOIN (
+                       SELECT COUNT(target_copy) AS copy_count, hold
+                       FROM action.hold_copy_map
+                       GROUP BY 2
+               ) ahcm_1 ON (ahcm_1.hold = ahr.id)
                LEFT JOIN serial.issuance siss
                        ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
                LEFT JOIN asset.copy_location_order acplo
@@ -5128,6 +5134,7 @@ SELECT  usr,
                        <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
                        <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
                        <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
+                       <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
                </fields>
                <links>
                        <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
index b468136..91a2fdc 100644 (file)
@@ -89,6 +89,7 @@
                 <th field="title" fpath="current_copy.call_number.record.simple_record.title" ffilter="true">Title</th>
                 <th field="barcode" fpath="current_copy.barcode" ffilter="true"></th>
                 <th field="parts" fpath="current_copy.parts.label" fsort="false">Parts</th>
+                <th field="copy_status" fpath="current_copy.status.name">Copy Status</th>
                 <th field="notes" fpath="notes.body" fsort="false" _visible="false">Hold Notes</th>
                 <th field="patron_barcode" fpath="usr.card.barcode" _visible="false" ffilter="true">Patron Barcode</th>
                 <th field="pickup_lib_name" fpath="pickup_lib.name" _visible="false" ffilter="true">Pickup Library</th>