From: Kyle Huckins <khuckins@catalyte.io>
Date: Mon, 30 Oct 2017 15:55:24 +0000 (+0000)
Subject: LP#1708487 Add Title and Barcode to Bill Print Templates
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=421cdd7ad299a3950dda56523dd61a280c8bd243;p=evergreen%2Fjoelewis.git

LP#1708487 Add Title and Barcode to Bill Print Templates

- 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>
---

diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_bill_payment.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_bill_payment.tt2
index 2f2cfecfa2..57e50fe40e 100644
--- a/Open-ILS/src/templates/staff/share/print_templates/t_bill_payment.tt2
+++ b/Open-ILS/src/templates/staff/share/print_templates/t_bill_payment.tt2
@@ -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/>
diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2
index d75850f00e..a229d80ba9 100644
--- a/Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2
+++ b/Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2
@@ -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:
diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2
index 57efdc58a3..5a75e3b3e8 100644
--- a/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2
+++ b/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2
@@ -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/>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
index 8f06491ad8..ce240f919b 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
@@ -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',