[open-ils-commits] [GIT] Evergreen ILS branch master updated. 870569b06ff9b40e62ccdd65c7378920c67f1347

Evergreen Git git at git.evergreen-ils.org
Fri Feb 16 08:36:20 EST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  870569b06ff9b40e62ccdd65c7378920c67f1347 (commit)
      from  b35f0c0b92ca94a0fc151144d38ecaa40707ff70 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 870569b06ff9b40e62ccdd65c7378920c67f1347
Author: Jason Boyer <jboyer at library.in.gov>
Date:   Mon Jan 29 17:02:01 2018 -0500

    LP1737540: Add Patron Information to Receipts
    
    Adds the following fields to a patron object on print_data:
    first_given_name
    second_given_name
    family_name
    suffix
    barcode
    money_summary.balance_owed
    money_summary.total_paid
    money_summary.total_owed
    expire_date
    alias
    has_email
    has_phone
    
    On the following receipts: Checkout, Items Out, and Bill Payment.
    
    (money_summary left out on bill payment because it will always be out of date.)
    
    Signed-off-by: Jason Boyer <jboyer at library.in.gov>
    Signed-off-by: Jason Stephenson <jason at sigio.com>

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 57e50fe..d0189c9 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
@@ -2,6 +2,18 @@
 Template for bill payment receipts. Data specific to this template
 includes:
 
+* patron - has several fields from the patron object, including a financial summary
+
+  * first_given_name
+  * second_given_name
+  * family_name
+  * suffix
+  * card.barcode
+  * expire_date
+  * alias - aka Holds Alias
+  * has_email - boolean value to show/hide elements on the receipt
+  * has_phone - same as has_email
+
 * current_location.name - name of workstation location
 * payment_type
 * payment_total - total paid
diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_checkout.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_checkout.tt2
index 6b445b9..9ba5c31 100644
--- a/Open-ILS/src/templates/staff/share/print_templates/t_checkout.tt2
+++ b/Open-ILS/src/templates/staff/share/print_templates/t_checkout.tt2
@@ -1,18 +1,28 @@
 <!--
 Template for printing checkout receipts; fields available include:
 
-* patron_money - summary of the patron's current financial obligations:
+* patron - has several fields from the patron object, including a financial summary
 
-  * patron_money.balance_owed - current balance
-  * patron_money.total_paid - payments made on outstanding fines/fees
-  * patron_money.total_owed - total of outstanding fines/fees
+  * first_given_name
+  * second_given_name
+  * family_name
+  * suffix
+  * card.barcode
+  * money_summary.balance_owed - current balance
+  * money_summary.total_paid - payments made on outstanding fines/fees
+  * money_summary.total_owed - total of outstanding fines/fees
+  * expire_date
+  * alias - aka Holds Alias
+  * has_email - boolean value to show/hide elements on the receipt
+  * has_phone - same as has_email
 
 * circulations - list of loans made during this session. Each
   includes:
 
   * title
-  * copy_barcode
-  * due_date
+  * author
+  * copy.barcode
+  * circ.due_date
 
 -->
 <div>
diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2
index 9d49e15..225fbb4 100644
--- a/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2
+++ b/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2
@@ -2,11 +2,28 @@
 Template for printing a list of items that a patron has checked out.
 Fields include:
 
+* patron - has several fields from the patron object, including a financial summary
+
+  * first_given_name
+  * second_given_name
+  * family_name
+  * suffix
+  * card.barcode
+  * money_summary.balance_owed - current balance
+  * money_summary.total_paid - payments made on outstanding fines/fees
+  * money_summary.total_owed - total of outstanding fines/fees
+  * expire_date
+  * alias - aka Holds Alias
+  * has_email - boolean value to show/hide elements on the receipt
+  * has_phone - same as has_email
+
 * circulations - list of current loans, including
 
+  * title
+  * author
+  * call_number.label
   * copy.barcode
   * circ.due_date
-  * title
 
 -->
 <div>
diff --git a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
index 71e9117..20973ff 100644
--- a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+++ b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
@@ -349,12 +349,23 @@ function($scope , $q , egCore , ngToast) {
     // alongside the templates.
     // NOTE: A lot of this data can be shared across templates.
     var seed_user = {
+        prefix : 'Mr',
         first_given_name : 'Slow',
         second_given_name : 'Joe',
         family_name : 'Jones',
+        suffix : 'III',
         card : {
             barcode : '30393830393'
-        }
+        },
+        money_summary : {
+            balance_owed : 4, // This is currently how these values are returned to the client
+            total_billed : '5.00',
+            total_paid : '1.00'
+        },
+        expire_date : '2020-12-31',
+        alias : 'the dude',
+        has_email : true,
+        has_phone : false
     }
     var seed_addr = {
         street1 : '123 Apple Rd',
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 97c2d93..ea21a3c 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
@@ -350,6 +350,8 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
 
     function printReceipt(type, payment_ids, payments_made, note) {
         var payment_blobs = [];
+        var cusr = patronSvc.current;
+
         angular.forEach(payments_made, function(payment) {
             var xact_id = payment[0];
 
@@ -377,7 +379,21 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
             payments : payment_blobs,
             current_location : egCore.idl.toHash(
                 egCore.org.get(egCore.auth.user().ws_ou()))
-        }
+        };
+
+        // Not a good idea to use patron_stats.fines for this; it's out of date
+        print_data.patron = {
+            prefix : cusr.prefix(),
+            first_given_name : cusr.first_given_name(),
+            second_given_name : cusr.second_given_name(),
+            family_name : cusr.family_name(),
+            suffix : cusr.suffix(),
+            card : { barcode : cusr.card().barcode() },
+            expire_date : cusr.expire_date(),
+            alias : cusr.alias(),
+            has_email : Boolean(patronSvc.current.email() && patronSvc.current.email().match(/.*@.*/).length),
+            has_phone : Boolean(cusr.day_phone() || cusr.evening_phone() || cusr.other_phone())
+        };
 
         print_data.new_balance = (
             print_data.previous_balance * 100 - 
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
index 83a6a6f..10a97e4 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
@@ -256,7 +256,8 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
     }
 
     $scope.print_receipt = function() {
-        var print_data = {circulations : []}
+        var print_data = {circulations : []};
+        var cusr = patronSvc.current;
 
         if ($scope.checkouts.length == 0) return $q.when();
 
@@ -272,7 +273,21 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
             };
         });
 
+        // This is repeated in patron.* so everyting is in one place but left here so existing templates don't break.
         print_data.patron_money = patronSvc.patron_stats.fines;
+        print_data.patron = {
+            prefix : cusr.prefix(),
+            first_given_name : cusr.first_given_name(),
+            second_given_name : cusr.second_given_name(),
+            family_name : cusr.family_name(),
+            suffix : cusr.suffix(),
+            card : { barcode : cusr.card().barcode() },
+            money_summary : patronSvc.patron_stats.fines,
+            expire_date : cusr.expire_date(),
+            alias : cusr.alias(),
+            has_email : Boolean($scope.has_email_address()),
+            has_phone : Boolean(cusr.day_phone() || cusr.evening_phone() || cusr.other_phone())
+        };
 
         return egCore.print.print({
             context : 'default', 
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
index 777900a..ac189f9 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
@@ -345,7 +345,8 @@ function($scope,  $q,  $routeParams,  $timeout,  egCore , egUser,  patronSvc , $
 
     $scope.print_receipt = function(items) {
         if (items.length == 0) return $q.when();
-        var print_data = {circulations : []}
+        var print_data = {circulations : []};
+        var cusr = patronSvc.current;
 
         angular.forEach(patronSvc.items_out, function(circ) {
             print_data.circulations.push({
@@ -357,6 +358,20 @@ function($scope,  $q,  $routeParams,  $timeout,  egCore , egUser,  patronSvc , $
             })
         });
 
+        print_data.patron = {
+            prefix : cusr.prefix(),
+            first_given_name : cusr.first_given_name(),
+            second_given_name : cusr.second_given_name(),
+            family_name : cusr.family_name(),
+            suffix : cusr.suffix(),
+            card : { barcode : cusr.card().barcode() },
+            money_summary : patronSvc.patron_stats.fines,
+            expire_date : cusr.expire_date(),
+            alias : cusr.alias(),
+            has_email : Boolean(patronSvc.current.email() && patronSvc.current.email().match(/.*@.*/).length),
+            has_phone : Boolean(cusr.day_phone() || cusr.evening_phone() || cusr.other_phone())
+        };
+
         return egCore.print.print({
             context : 'default', 
             template : 'items_out', 

-----------------------------------------------------------------------

Summary of changes:
 .../staff/share/print_templates/t_bill_payment.tt2 |   12 ++++++++++
 .../staff/share/print_templates/t_checkout.tt2     |   22 ++++++++++++++-----
 .../staff/share/print_templates/t_items_out.tt2    |   19 ++++++++++++++++-
 .../js/ui/default/staff/admin/workstation/app.js   |   13 ++++++++++-
 .../web/js/ui/default/staff/circ/patron/bills.js   |   18 +++++++++++++++-
 .../js/ui/default/staff/circ/patron/checkout.js    |   17 ++++++++++++++-
 .../js/ui/default/staff/circ/patron/items_out.js   |   17 ++++++++++++++-
 7 files changed, 107 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list