xact details page cont.
authorBill Erickson <berick@esilibrary.com>
Wed, 28 May 2014 15:47:22 +0000 (11:47 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 28 May 2014 15:47:22 +0000 (11:47 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index 11a8c7c..a676a38 100644 (file)
@@ -1,6 +1,4 @@
-<h2>[% l('Details for Transaction #[_1]', '{{xact.id()}}') %]</h2>
-
-<h3>[% l('Summary') %]</h3>
+<h3>[% l('Transaction #[_1]', '{{xact.id()}}') %]</h3>
 
 <div class="row">
   <div class="col-md-2 strong-text">[% l('Billing Location') %]</div>
@@ -8,7 +6,10 @@
   <div class="col-md-2 strong-text">[% l('Total Billed') %]</div>
   <div class="col-md-2">{{xact.total_owed() | currency}}</div>
   <div class="col-md-2 strong-text">[% l('Title') %]</div>
-  <div class="col-md-2">{{xact.circulation().target_copy().call_number().record().simple_record().title()}}</div>
+  <div class="col-md-2">
+    <a ng-if="title_id" href="[% ctx.base_path %]/opac/record/{{title_id}}">{{title}}</a>
+    <span ng-if="!title_id">{{title}}</span>
+  </div>
 </div>
 <div class="row">
   <div class="col-md-2 strong-text">[% l('Type') %]</div>
   <div class="col-md-2 strong-text">[% l('Checked In') %]</div>
   <div class="col-md-2">{{xact.circulation().checkin_time() | date:'short'}}</div>
 </div>
-<div class="row">
-  <div class="col-md-2 strong-text">[% l('Barcode') %]</div>
-  <div class="col-md-2">
-    <a title="[% l('Item Details') %]" target="_self"
-      href='./cat/item/{{xact.circulation().target_copy().id()}}'>
-      {{xact.circulation().target_copy().barcode()}}
-    </a>
+
+<div ng-if="xact.circulation()">
+  <hr/>
+  <h3>[% l('Item Summary') %]</h3>
+  <div class="row">
+    <div class="col-md-2 strong-text">[% l('Barcode') %]</div>
+    <div class="col-md-2">
+      <a title="[% l('Item Details') %]" target="_self"
+        href='./cat/item/{{xact.circulation().target_copy().id()}}'>
+        {{xact.circulation().target_copy().barcode()}}
+      </a>
+    </div>
+    <div class="col-md-2 strong-text">[% l('Location') %]</div>
+    <div class="col-md-2">
+      {{xact.circulation().target_copy().location().name()}}
+    </div>
+    <div class="col-md-2 strong-text">[% l('Call Number') %]</div>
+    <div class="col-md-2">
+      {{xact.circulation().target_copy().call_number().label()}}
+    </div>
   </div>
-  <div class="col-md-2 strong-text">[% l('Call Number') %]</div>
-  <div class="col-md-2">
-    {{xact.circulation().target_copy().call_number().label()}}
+  <div class="row">
+    <div class="col-md-2 strong-text">[% l('Status') %]</div>
+    <div class="col-md-2">
+      {{xact.circulation().target_copy().status().name()}}
+    </div>
+    <div class="col-md-2 strong-text">[% l('Circulate') %]</div>
+    <div class="col-md-2">
+      {{xact.circulation().target_copy().circulate() == 't'}}
+    </div>
+    <div class="col-md-2 strong-text">[% l('Reference') %]</div>
+    <div class="col-md-2">
+      {{xact.circulation().target_copy().ref() == 't'}}
+    </div>
   </div>
-  <div class="col-md-2 strong-text">[% l('Location') %]</div>
-  <div class="col-md-2">
-    {{xact.circulation().target_copy().location().name()}}
+  <div class="row">
+    <div class="col-md-2 strong-text">[% l('Holdable') %]</div>
+    <div class="col-md-2">
+      {{xact.circulation().target_copy().holdable() == 't'}}
+    </div>
+    <div class="col-md-2 strong-text">[% l('OPAC Visible') %]</div>
+    <div class="col-md-2">
+      {{xact.circulation().target_copy().opac_visible() == 't'}}
+    </div>
+
+    <div class="col-md-2 strong-text">[% l('Created') %]</div>
+    <div class="col-md-2">
+      {{xact.circulation().target_copy().create_date() | date:'short'}}
+    </div>
+  </div>
+  <div class="row">
+    <div class="col-md-2 strong-text">[% l('Edited') %]</div>
+    <div class="col-md-2">
+      {{xact.circulation().target_copy().edit_date() | date:'short'}}
+    </div>
+    <div class="col-md-2 strong-text">[% l('Age Protect') %]</div>
+    <div class="col-md-2">
+      {{xact.circulation().target_copy().age_protect().name()}}
+    </div>
+    <div class="col-md-2 strong-text">[% l('Total Circulations') %]</div>
+    <div class="col-md-2">
+      TODO
+    </div>
   </div>
 </div>
 
 <!-- TODO item summary -->
 
 <!-- set a lower default page size (limit) to allow for more space -->
-<br/>
+<hr/>
 <eg-grid
   main-label="[% l('Bills') %]"
   idl-class="mb"
index d509a44..6e23b44 100644 (file)
@@ -117,7 +117,7 @@ function($q , egCore , patronSvc) {
                 flesh_fields : {
                     mobts : ['circulation','grocery'],
                     circ : ['target_copy'],
-                    acp : ['call_number','location'],
+                    acp : ['call_number','location','status','age_protect'],
                     acn : ['record'],
                     bre : ['simple_record']
                 },
@@ -565,6 +565,19 @@ function($scope,  $q , $routeParams , egCore , egGridDataProvider , patronSvc ,
     // -- retrieve our data
     billSvc.fetchXact(xact_id).then(function(xact) {
         $scope.xact = xact;
+
+        // set the title.  only needs to be done on initial page load
+        if (xact.circulation()) {
+            if (xact.circulation().target_copy().call_number().id() == -1) {
+                $scope.title = xact.circulation().target_copy().dummy_title();
+            } else  {
+                // TODO: shared bib service?
+                $scope.title = xact.circulation().target_copy()
+                    .call_number().record().simple_record().title();
+                $scope.title_id = xact.circulation().target_copy()
+                    .call_number().record().id();
+            }
+        }
     });
 
     billSvc.fetchBills(xact_id).then(function(bs) {