renewal receipt
authorBill Erickson <berick@esilibrary.com>
Mon, 30 Jun 2014 19:23:08 +0000 (15:23 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 30 Jun 2014 19:23:08 +0000 (15:23 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/circ/renew/t_renew.tt2
Open-ILS/src/templates/staff/share/print_templates/t_renew.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/circ/renew/app.js
Open-ILS/web/js/ui/default/staff/services/ui.js

index b0c5c78..ee38361 100644 (file)
 
 <div class="flex-row pad-vert">
   <div class="flex-cell"></div>
+  <div class="pad-horiz">
+    <button class="btn btn-default" 
+      ng-click="print_receipt()">[% l('Print Receipt') %]</button>
+  </div>
   <div class="checkbox">
     <label>
       <input ng-model="trim_list" type="checkbox"/>
diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_renew.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_renew.tt2
new file mode 100644 (file)
index 0000000..8e96445
--- /dev/null
@@ -0,0 +1,17 @@
+<div>
+  <div>[% l('Welcome to [_1]', '{{current_location.name}}') %]</div>
+  <div>[% l('You renewed the following items:') %]</div>
+  <hr/>
+  <ol>
+    <li ng-repeat="renewal in circulations">
+      <div>{{renewal.title}}</div>
+      <div>[% l('Barcode: [_1] Due: [_2]', 
+        '{{renewal.copy.barcode}}',
+        '{{renewal.circ.due_date | date:"short"}}') %]</div>
+    </li>
+  </ol>
+  <hr/>
+  <div>{{current_location.shortname}} {{today | date:'short'}}</div>
+  <div>[% l('You were helped by [_1]', '{{staff.first_given_name}}') %]</div>
+<br/>
+
index 88194b7..47a3184 100644 (file)
@@ -193,10 +193,15 @@ function($scope , $window , $location , egCore , egGridDataProvider , egCirc) {
 
         if ($scope.renewals.length == 0) return $q.when();
 
-        angular.forEach($srenewalpe.renewals, function(co) {
-            var circ = egCore.idl.toHash(renewal.payload.circ);
-            circ.title = renewal.payload.record.title;
-            print_data.circulations.push(circ);
+        angular.forEach($scope.renewals, function(renewal) {
+            if (renewal.circ) {
+                print_data.circulations.push({
+                    circ : egCore.idl.toHash(renewal.circ),
+                    copy : egCore.idl.toHash(renewal.acp),
+                    title : egCore.idl.toHash(renewal.title),
+                    author : egCore.idl.toHash(renewal.author)
+                });
+            }
         });
 
         return egCore.print.print({
index 6770fdc..d2e83ac 100644 (file)
@@ -239,7 +239,6 @@ function($modal, $interpolate) {
             }
 
             $scope.orgChanged = function(org) {
-                console.log('here with ' + org);
                 $scope.selected = egOrg.get(org.id);
             }
         }]