renew item
authorBill Erickson <berick@esilibrary.com>
Mon, 30 Jun 2014 15:08:09 +0000 (11:08 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 30 Jun 2014 15:08:09 +0000 (11:08 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2
Open-ILS/src/templates/staff/circ/renew/t_renew.tt2
Open-ILS/web/js/ui/default/staff/circ/renew/app.js
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 6559ce7..41401f1 100644 (file)
@@ -30,7 +30,7 @@
     path="acp.alert_message"></eg-grid-field>
 
   <eg-grid-field label="[% l('Balance Owed') %]"     
-    path='circ.billable_transaction.summary.balance_owed'></eg-grid-field>
+    path='mbts.balance_owed'></eg-grid-field>
 
   <eg-grid-field label="[% l('Barcode') %]" path="acp_barcode">
     <!-- FIXME: ng-if / ng-disabled not working since the contents 
index ea8efe5..2d0dbe2 100644 (file)
@@ -46,7 +46,7 @@
   main-label="[% l('Items Checked In') %]"
   items-provider="gridDataProvider"
   grid-controls="gridControls"
-  persist-key="circ.checkin">
+  persist-key="circ.renew">
 
   <eg-grid-action 
     handler="fetchLastCircPatron"
@@ -69,7 +69,7 @@
     path="acp.alert_message"></eg-grid-field>
 
   <eg-grid-field label="[% l('Balance Owed') %]"     
-    path='circ.billable_transaction.summary.balance_owed'></eg-grid-field>
+    path='mbts.balance_owed'></eg-grid-field>
 
   <eg-grid-field label="[% l('Barcode') %]" path="acp_barcode">
     <!-- FIXME: ng-if / ng-disabled not working since the contents 
     path='circ.id'></eg-grid-field>
 
   <eg-grid-field label="[% l('Call Number') %]" 
-    path="acn.label" hidden></eg-grid-field>
+    path="acn.label"></eg-grid-field>
 
   <eg-grid-field label="[% l('Due Date') %]"    
-    path='circ.due_date' dateformat='short' hidden></eg-grid-field>
-
-  <eg-grid-field label="[% l('Checkin Date') %]"    
-    path='circ.checkin_time' dateformat='short'></eg-grid-field>
+    path='circ.due_date' dateformat='short'></eg-grid-field>
 
   <eg-grid-field label="[% l('Family Name') %]"    
     path='au.family_name'></eg-grid-field>
 
-  <eg-grid-field label="[% l('Finish') %]"    
-    path='circ.stop_fines_time'></eg-grid-field>
-
   <eg-grid-field label="[% l('Location') %]" 
     path='acp.location.name'> </eg-grid-field>
 
   <eg-grid-field label="[% l('Remaining Renewals') %]" 
     path='circ.renewal_remaining'></eg-grid-field>
 
-  <eg-grid-field label="[% l('Start') %]" 
-    path='circ.xact_start'></eg-grid-field>
-
   <eg-grid-field label="[% l('Title') %]" path="title">
     <a target="_self" href="[% ctx.base_path %]/opac/record/{{record.doc_id()}}">
       {{item.title}}
index 5a960bd..54d7a63 100644 (file)
@@ -38,7 +38,7 @@ function($scope , egCore , egGridDataProvider , egCirc) {
     $scope.renewals = [];
 
     var today = new Date();
-    $scope.renewalsArgs = {due_date : today};
+    $scope.renewalArgs = {due_date : today};
 
     $scope.gridDataProvider = egGridDataProvider.instance({
         get : function(offset, count) {
index e3f1be3..ca5b311 100644 (file)
@@ -217,6 +217,7 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
         if (!payload) return;
 
         data.circ = payload.circ;
+        data.parent_circ = payload.parent_circ;
         data.hold = payload.hold;
         data.record = payload.record;
         data.acp = payload.copy;
@@ -230,9 +231,14 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
         data.isbn = final_resp.evt.isbn;
         data.route_to = final_resp.evt.route_to;
 
+        // for checkin, the mbts lives on the main circ
         if (payload.circ && payload.circ.billable_transaction())
             data.mbts = payload.circ.billable_transaction().summary();
 
+        // on renewals, the mbts lives on the parent circ
+        if (payload.parent_circ && payload.parent_circ.billable_transaction())
+            data.mbts = payload.parent_circ.billable_transaction().summary();
+
         if (!data.route_to) {
             if (data.transit) {
                 data.route_to = data.transit.dest().shortname();
@@ -477,6 +483,14 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
             transit.dest(egCore.org.get(transit.dest()));
         }
 
+        // TODO: renewal responses should include the patron
+        if (!payload.patron && payload.circ) {
+            promises.push(
+                egCore.pcrud.retrieve('au', payload.circ.usr())
+                .then(function(user) {payload.patron = user})
+            );
+        }
+
         // extract precat values
         evt.title = payload.record ? payload.record.title() : 
             (payload.copy ? payload.copy.dummy_title() : null);