LP#1708487 Add Title and Barcode to Bill Print Templates
authorKyle Huckins <khuckins@catalyte.io>
Mon, 30 Oct 2017 15:55:24 +0000 (15:55 +0000)
committerKathy Lussier <klussier@masslnc.org>
Fri, 17 Nov 2017 17:18:54 +0000 (12:18 -0500)
- Add additional documentation to Bills, Current; Bills, Payment; and Bills,
Historical print templates.
- Convert xacts to objects containing all required information for print
templates

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>

 Changes to be committed:
modified:   Open-ILS/src/templates/staff/share/print_templates/t_bill_payment.tt2
modified:   Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2
modified:   Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2
modified:   Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/src/templates/staff/share/print_templates/t_bill_payment.tt2
Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2
Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index 2f2cfec..57e50fe 100644 (file)
@@ -8,6 +8,9 @@ includes:
 * new_balance - balance after the payments were applied
 * payments - list of specific payments
 
+Individual payments within payments contain:
+* payment.xact.copy_barcode - Copy barcode
+* payment.xact.title - Copy title
 -->
 Welcome to {{current_location.name}}!<br/>
 A receipt of your  transaction:<hr/>
index d75850f..a229d80 100644 (file)
@@ -6,7 +6,8 @@ to this template includes:
   contains:
 
   summary - information about the transaction
-
+  title - Copy title
+  copy_barcode - Copy barcode
 -->
 Welcome to {{current_location.name}}!<br/>
 You have the following bills:
index 57efdc5..5a75e3b 100644 (file)
@@ -6,6 +6,8 @@ to this template includes:
   contains:
 
   summary - information about the transaction
+  title - Copy title
+  copy_barcode - Copy barcode
 
 -->
 Welcome to {{current_location.name}}!<br/>
index 8f06491..ce240f9 100644 (file)
@@ -464,7 +464,14 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
         var xacts = [];
         egCore.pcrud.search('mbt', 
             {id : ids},
-            {flesh : 1, flesh_fields : {'mbt' : ['summary']}},
+            {flesh : 5, flesh_fields : {
+                'mbt' : ['summary', 'circulation'],
+                'circ' : ['target_copy'],
+                'acp' : ['call_number'],
+                'acn' : ['record'],
+                'bre' : ['simple_record']
+                }
+            },
             {authoritative : true}
         ).then(
             function() {
@@ -480,7 +487,21 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
             }, 
             null, 
             function(xact) {
-                xacts.push(egCore.idl.toHash(xact));
+                newXact = {
+                    billing_total : xact.billing_total(),
+                    billings : xact.billings(),
+                    grocery : xact.grocery(),
+                    id : xact.id(),
+                    payment_total : xact.payment_total(),
+                    payments : xact.payments(),
+                    summary : egCore.idl.toHash(xact.summary()),
+                    unrecovered : xact.unrecovered(),
+                    xact_finish : xact.xact_finish(),
+                    xact_start : xact.xact_start(),
+                    copy_barcode : xact.circulation().target_copy().barcode(),
+                    title : xact.circulation().target_copy().call_number().record().simple_record().title()
+                }
+                xacts.push(newXact);
             }
         );
     }
@@ -908,7 +929,14 @@ function($scope,  $q , egCore , patronSvc , billSvc , egPromptDialog , $location
         var xacts = [];
         egCore.pcrud.search('mbt', 
             {id : ids},
-            {flesh : 1, flesh_fields : {'mbt' : ['summary']}},
+            {flesh : 5, flesh_fields : {
+                'mbt' : ['summary', 'circulation'],
+                'circ' : ['target_copy'],
+                'acp' : ['call_number'],
+                'acn' : ['record'],
+                'bre' : ['simple_record']
+                }
+            },
             {authoritative : true}
         ).then(
             function() {
@@ -924,12 +952,24 @@ function($scope,  $q , egCore , patronSvc , billSvc , egPromptDialog , $location
             }, 
             null, 
             function(xact) {
-                xacts.push(egCore.idl.toHash(xact));
+                newXact = {
+                    billing_total : xact.billing_total(),
+                    billings : xact.billings(),
+                    grocery : xact.grocery(),
+                    id : xact.id(),
+                    payment_total : xact.payment_total(),
+                    payments : xact.payments(),
+                    summary : egCore.idl.toHash(xact.summary()),
+                    unrecovered : xact.unrecovered(),
+                    xact_finish : xact.xact_finish(),
+                    xact_start : xact.xact_start(),
+                    copy_barcode : xact.circulation().target_copy().barcode(),
+                    title : xact.circulation().target_copy().call_number().record().simple_record().title()
+                }
+                xacts.push(newXact);
             }
         );
     }
-
-
 }])
 
 .controller('BillPaymentHistoryCtrl',