LP#1588450 asset.copy.cost Field Missing from Client Interfaces
authorMichele Morgan <mmorgan@noblenet.org>
Thu, 2 Jun 2016 16:44:02 +0000 (12:44 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 9 Aug 2016 17:11:52 +0000 (13:11 -0400)
This patch adds the asset.copy.cost cost field, with the label 'Acquisition
Cost' to the following:

XUL client:

- Item status list view column picker
- Item status alternate view
- Copy editor

Web client:

- Item status alternate view
- Copy editor label change

Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>

Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2
Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/cat/copy_editor.js
Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js
Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Open-ILS/xul/staff_client/server/locale/en-US/common.properties

index 7d1a676..c21c9cd 100644 (file)
   </div>
 
   <div class="flex-row">
-    <div class="flex-cell">[% l('ISBN') %]</div>
-    <div class="flex-cell well">
-      {{copy.call_number().record().simple_record().isbn()}}
-    </div>
+       <div class="flex-cell">[% l('Acquisition Cost') %]</div>
+    <div class="flex-cell well">{{copy.cost()}}</div>
 
     <div class="flex-cell">[% l('Copy Location') %]</div>
     <div
   </div>
 
   <div class="flex-row">
-    <div class="flex-cell">[% l('Date Created') %]</div>
-    <div class="flex-cell well">{{copy.create_date() | date:'short'}}</div>
+    <div class="flex-cell">[% l('ISBN') %]</div>
+    <div class="flex-cell well">
+      {{copy.call_number().record().simple_record().isbn()}}
+    </div>
 
     <div class="flex-cell">[% l('Loan Duration') %]</div>
     <div class="flex-cell well">{{circ.duration()}}</div>
@@ -80,9 +80,8 @@
   </div>
 
   <div class="flex-row">
-    <div class="flex-cell">[% l('Date Active') %]</div>
-    <div class="flex-cell well">{{copy.active_date() | date:'short'}}</div>
-
+    <div class="flex-cell">[% l('Date Created') %]</div>
+    <div class="flex-cell well">{{copy.create_date() | date:'short'}}</div>
     <div class="flex-cell">[% l('Fine Level') %]</div>
     <div class="flex-cell well">{{circ.duration_rule().name()}}</div>
 
@@ -94,8 +93,8 @@
   </div>
 
   <div class="flex-row">
-    <div class="flex-cell">[% l('Status Changed') %]</div>
-    <div class="flex-cell well">{{copy.status_changed_time() | date:'short'}}</div>
+    <div class="flex-cell">[% l('Date Active') %]</div>
+    <div class="flex-cell well">{{copy.active_date() | date:'short'}}</div>
 
     <div class="flex-cell">[% l('Reference') %]</div>
     <div class="flex-cell well">{{copy.ref()}}</div>
   </div>
 
   <div class="flex-row">
-    <div class="flex-cell">[% l('Copy ID') %]</div>
-    <div class="flex-cell well">{{copy.id()}}</div>
+    <div class="flex-cell">[% l('Status Changed') %]</div>
+    <div class="flex-cell well">{{copy.status_changed_time() | date:'short'}}</div>
 
     <div class="flex-cell">[% l('OPAC Visible') %]</div>
     <div class="flex-cell well">{{copy.opac_visible()}}</div>
   </div>
 
   <div class="flex-row">
-    <div class="flex-cell">[% l('TCN') %]</div>
-    <div class="flex-cell well">{{copy.call_number().record().tcn_value()}}</div>
+    <div class="flex-cell">[% l('Copy ID') %]</div>
+    <div class="flex-cell well">{{copy.id()}}</div>
 
     <div class="flex-cell">[% l('Holdable') %]</div>
     <div class="flex-cell well">{{copy.opac_visible()}}</div>
   </div>
 
   <div class="flex-row">
-    <div class="flex-cell">[% l('Floating') %]</div>
-    <div class="flex-cell well">{{copy.floating().name()}}</div>
+    <div class="flex-cell">[% l('TCN') %]</div>
+    <div class="flex-cell well">{{copy.call_number().record().tcn_value()}}</div>
 
     <div class="flex-cell">[% l('Circulate') %]</div>
     <div class="flex-cell well">{{copy.circulate()}}</div>
   </div>
 
   <div class="flex-row">
-    <!-- empty -->
-    <div class="flex-cell"></div>
-    <div class="flex-cell"></div>
+    <div class="flex-cell">[% l('Floating') %]</div>
+    <div class="flex-cell well">{{copy.floating().name()}}</div>
 
     <div class="flex-cell">[% l('Circ Modifier') %]</div>
     <div class="flex-cell well">{{copy.circ_modifier().name()}}</div>
index 09e87d2..38dde8f 100644 (file)
                     <b>[% l('Loan Duration') %]</b>
                 </div>
                 <div class="col-md-6">
-                    <b>[% l('Cost') %]</b>
+                    <b>[% l('Acquisition Cost') %]</b>
                 </div>
             </div>
 
index df0a1d7..44b328b 100644 (file)
                 <div class="col-xs-6">
                     <label>
                         <input type="checkbox" ng-change="saveDefaults()" ng-model="defaults.attributes.cost"/>
-                        [% l('Cost') %]
+                        [% l('Acquisition Cost') %]
                     </label>
                 </div>
             </div>
index a820074..bbdf8ac 100644 (file)
 <!ENTITY staff.circ.alternate_copy_summary.Circ_Library.label "Circ Library">
 <!ENTITY staff.circ.alternate_copy_summary.Patron_Name.label "Patron">
 <!ENTITY staff.circ.alternate_copy_summary.Price.label "Price">
+<!ENTITY staff.circ.alternate_copy_summary.Cost.label "Acquisition Cost">
 <!ENTITY staff.circ.alternate_copy_summary.Previous_Circ_Group.label "Previous Circ Group">
 <!ENTITY staff.circ.alternate_copy_summary.Pub_Date.label "Pub Date">
 <!ENTITY staff.circ.alternate_copy_summary.Publisher.label "Publisher">
index 0bd3fa6..f4537a2 100644 (file)
@@ -66,6 +66,7 @@ function my_init() {
                remote xul for new copies */
             fake_item.deposit(0);
             fake_item.price(0);
+            fake_item.cost(0);
             fake_item.deposit_amount(0);
             fake_item.fine_level(2); // Normal
             fake_item.loan_duration(2); // Normal
@@ -1151,6 +1152,13 @@ g.panes_and_field_names = {
             input: 'c = function(v){ g.apply("ref",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( [ [ $("catStrings").getString("staff.cat.copy_editor.field.reference.yes_or_true"), get_db_true() ], [ $("catStrings").getString("staff.cat.copy_editor.field.reference.no_or_false"), get_db_false() ] ] ); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
         }
     ],
+               [
+        $('catStrings').getString('staff.cat.copy_editor.field.cost.label'),
+        {
+            render: 'if (fm.cost() == null) { $("catStrings").getString("staff.cat.copy_editor.field.unset_or_null"); } else { util.money.sanitize( fm.cost() ); }',
+            input: 'c = function(v){ g.apply("cost",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+        }
+    ],
     [
         $('catStrings').getString('staff.cat.copy_editor.field.mint_condition.label'),
         { 
index 2e82c0a..74b7ae3 100644 (file)
@@ -174,6 +174,9 @@ function load_item() {
         set("renewal_type", '');
         set("opac_visible", '');
         set("price", '');
+        set_tooltip("price", '');
+        set("cost", '');
+        set_tooltip("cost", '');
         set("ref", '');
         set("copy_status", '');
         set_tooltip("copy_status", '');
@@ -245,6 +248,9 @@ function load_item() {
                 ));
             set("opac_visible", get_localized_bool( details.copy.opac_visible() )); 
             set("price", details.copy.price()); 
+            set_tooltip("price" , "Replacement Amount charged to Patron");
+            set("cost", details.copy.cost());
+            set_tooltip("cost" , "Acquisition Amount paid by Library");
             set("ref", get_localized_bool( details.copy.ref() )); 
             var copy_status = typeof details.copy.status() == 'object' ? details.copy.status() : data.hash.ccs[ details.copy.status() ];
                 set("copy_status", copy_status.name() );
index fd4aba1..3c4ba95 100644 (file)
                                 <textbox name="due_date" readonly="true" context="clipboard"/>
                             </row>
                             <row>
-                                <label value="&staff.circ.alternate_copy_summary.ISBN.label;" />
-                                <textbox name="isbn" readonly="true" context="clipboard"/>
+                                <label value="&staff.circ.alternate_copy_summary.Cost.label;" />
+                                <textbox name="cost" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Copy_Location.label;" />
                                 <textbox name="location" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Total_Circs.label;" />
                                 <textbox name="xact_start" readonly="true" context="clipboard"/>
                             </row>
                             <row>
-                                <label value="&staff.circ.alternate_copy_summary.Date_Created.label;" />
-                                <textbox name="copy_create_date" readonly="true" context="clipboard"/>
+                                <label value="&staff.circ.alternate_copy_summary.ISBN.label;" />
+                                <textbox name="isbn" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Loan_Duration.label;" />
                                 <textbox name="loan_duration" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Total_Circs___Current_Year.label;" />
                                 <textbox name="checkout_workstation" readonly="true" context="clipboard"/>
                             </row>
                             <row>
-                                <label value="&staff.circ.alternate_copy_summary.Date_Active.label;" />
-                                <textbox name="copy_active_date" readonly="true" context="clipboard"/>
+                                <label value="&staff.circ.alternate_copy_summary.Date_Created.label;" />
+                                <textbox name="copy_create_date" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Fine_Level.label;" />
                                 <textbox name="fine_level" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Total_Circs___Prev_Year.label;" />
                                 <textbox name="duration_rule" readonly="true" context="clipboard"/>
                             </row>
                             <row>
-                                <label value="&staff.circ.alternate_copy_summary.Status_Changed_Time.label;" />
-                                <textbox name="status_changed_time" readonly="true" context="clipboard"/>
+                                <label value="&staff.circ.alternate_copy_summary.Date_Active.label;" />
+                                <textbox name="copy_active_date" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Reference.label;" />
                                 <textbox name="ref" readonly="true" context="clipboard"/>
                                 <!--
                                 <textbox name="recurring_fine_rule" readonly="true" context="clipboard"/>
                             </row>
                             <row>
-                                <label value="&staff.circ.alternate_copy_summary.Copy_ID.label;" />
-                                <textbox name="copy_id" readonly="true" context="clipboard"/>
+                                <label value="&staff.circ.alternate_copy_summary.Status_Changed_Time.label;" />
+                                <textbox name="status_changed_time" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.OPAC_Visible.label;" />
                                 <textbox name="opac_visible" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Remaining_Renewals.label;" />
                                 <textbox name="max_fine_rule" readonly="true" context="clipboard"/>
                             </row>
                             <row>
-                                <label value="&staff.circ.alternate_copy_summary.TCN.label;" />
-                                <textbox name="tcn" readonly="true" context="clipboard"/>
+                                <label value="&staff.circ.alternate_copy_summary.Copy_ID.label;" />
+                                <textbox name="copy_id" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Holdable.label;" />
                                 <textbox name="holdable" readonly="true" context="clipboard"/>
                                 <spacer /><spacer />
                                 <textbox name="checkin_time" readonly="true" context="clipboard"/>
                             </row>
                             <row>
-                                <label value="&staff.circ.alternate_copy_summary.Floating.label;" />
-                                <textbox name="floating" readonly="true" context="clipboard"/>
+                                <label value="&staff.circ.alternate_copy_summary.TCN.label;" />
+                                <textbox name="tcn" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Circulate.label;" />
                                 <textbox name="circulate" readonly="true" context="clipboard"/>
                                 <!--
                                 <textbox name="checkin_scan_time" readonly="true" context="clipboard"/>
                             </row>
                             <row>
-                                <spacer /><spacer />
+                                <label value="&staff.circ.alternate_copy_summary.Floating.label;" />
+                                <textbox name="floating" readonly="true" context="clipboard"/>
                                 <label value="&staff.circ.alternate_copy_summary.Circ_Modifier.label;" />
                                 <textbox name="circ_modifier" readonly="true" context="clipboard"/>
                                 <spacer /><spacer />
index b725e7c..3f473e8 100644 (file)
@@ -1033,6 +1033,22 @@ circ.util.columns = function(modify,params) {
             },
             'sort_type' : 'money'
         },
+               {
+            'fm_class' : 'acp',
+            'id' : 'cost',
+            'label' : document.getElementById('commonStrings').getString('staff.acp_label_cost'),
+            'flex' : 1,
+            'primary' : false,
+            'hidden' : true,
+            'editable' : false, 'render' : function(my) {
+                if (my.acp.cost() == null) {
+                    return document.getElementById('circStrings').getString('staff.circ.utils.unset');
+                } else {
+                    return util.money.sanitize(my.acp.cost());
+                }
+            },
+            'sort_type' : 'money'
+        },
         {
             'fm_class' : 'acp',
             'id' : 'circ_as_type',
index d694f2e..c321954 100644 (file)
@@ -202,6 +202,7 @@ staff.cat.copy_editor.field.deposit.yes_or_true=Yes
 staff.cat.copy_editor.field.deposit.no_or_false=No
 staff.cat.copy_editor.field.deposit_amount.label=Deposit Amount
 staff.cat.copy_editor.field.price.label=Price
+staff.cat.copy_editor.field.cost.label=Acquisition Cost
 staff.cat.copy_editor.field.opac_visible.label=OPAC Visible?
 staff.cat.copy_editor.field.opac_visible.yes_or_true=Yes
 staff.cat.copy_editor.field.opac_visible.no_or_false=No
index e30c5aa..4717683 100644 (file)
@@ -46,6 +46,7 @@ staff.acp_label_id=Copy ID
 staff.acp_label_loan_duration=Loan Duration
 staff.acp_label_location=Location
 staff.acp_label_price=Price
+staff.acp_label_cost=Acquisition Cost
 staff.acp_label_status=Status
 staff.ahr_current_copy_label=Current Copy
 staff.ahr_current_copy_location_label=Current Copy Location