lp1661685 webstaff: add money.grocery to pcrud
authorJason Etheridge <jason@equinoxinitiative.org>
Wed, 28 Jun 2017 18:40:02 +0000 (14:40 -0400)
committerJason Etheridge <jason@equinoxinitiative.org>
Mon, 3 Jul 2017 17:54:47 +0000 (13:54 -0400)
and add a single column called Location to the Bills interface which shows
either the circ.circ_lib or the grocery.billing_location for a given xact

and the specific columns for both xact types

Signed-off-by: Jason Etheridge <jason@equinoxinitiative.org>
Signed-off-by: Andrea Neiman <abneiman@equinoxinitiative.org>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2

index 00734a8..b5e383d 100644 (file)
@@ -6500,7 +6500,7 @@ SELECT  usr,
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                </links>
        </class>
-       <class id="mg" controller="open-ils.cstore" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
+    <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
                <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
                        <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
                        <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
@@ -6523,6 +6523,11 @@ SELECT  usr,
                        <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
                        <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
                </links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
+            </actions>
+        </permacrud>
        </class>
        <class id="cbs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::bib_source" oils_persist:tablename="config.bib_source" reporter:label="Bib Source">
                <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
index db1d85c..68511ad 100644 (file)
   </eg-grid-field>
 
   <eg-grid-field path="circulation.target_copy.circ_modifier" 
-    label="[% l('Circulation Modifier') %]" name="circ_modifier">
+    label="[% l('Circulation Modifier') %]" name="circ_modifier" hidden>
   </eg-grid-field>
 
   <eg-grid-field path="circulation.target_copy.circ_lib.shortname"
-    label="[% l('Circulation Library') %]" name="circ_lib">
+    label="[% l('Circulation Library') %]" name="circ_lib" hidden>
+  </eg-grid-field>
+
+  <eg-grid-field label="[% l('Location') %]" name="xact_location">
+    {{item['grocery.billing_location.shortname']||item['circulation.circ_lib.shortname']}}
   </eg-grid-field>
 
   <!-- virtual field -->
     name="payment_pending"></eg-grid-field>
 
   <!-- import all circ fields, hidden by default -->
+  <eg-grid-field path='grocery.*' hidden> </eg-grid-field>
+  <eg-grid-field label="[% l('Billing Location') %]"
+    path='grocery.billing_location.shortname' required hidden> </eg-grid-field>
   <eg-grid-field path='circulation.*' hidden> </eg-grid-field>
+  <eg-grid-field label="[% l('Checkout / Renewal Library') %]"
+    path='circulation.circ_lib.shortname' required hidden> </eg-grid-field>
 
   <eg-grid-field path='circulation.target_copy.*' hidden> </eg-grid-field>