From 7908f3c3eca891bd4d6319447f3a94c71ee7be49 Mon Sep 17 00:00:00 2001
From: Bill Erickson <berickxx@gmail.com>
Date: Mon, 27 Aug 2018 22:00:52 -0400
Subject: [PATCH] LP#1776020 Add pref names to bills and items-out receipt
 templates

Add support (with inline docs) for pref_.* name fields in Bills
Current/Historical/Payment templates and the patron Items Out template.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
---
 .../staff/share/print_templates/t_bill_payment.tt2        |  1 +
 .../staff/share/print_templates/t_bills_current.tt2       |  1 +
 .../staff/share/print_templates/t_bills_historical.tt2    |  1 +
 .../templates/staff/share/print_templates/t_items_out.tt2 |  1 +
 Open-ILS/web/js/ui/default/staff/circ/patron/bills.js     | 15 +++++++++++++++
 Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js |  5 +++++
 6 files changed, 24 insertions(+)

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 d0189c9347..0147d50ad8 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,7 @@ includes:
   * second_given_name
   * family_name
   * suffix
+  * pref_ versions of all name fields (e.g. pref_family_name);
   * card.barcode
   * expire_date
   * alias - aka Holds Alias
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 786b8689f3..c2b287fbb9 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
@@ -17,6 +17,7 @@ to this template includes:
     patron.alias - The patron's alias
     patron.has_email - Whether or not the patron has an email address
     patron.has_phone - Whether or not the patron has a phone number
+    pref_ versions of all name fields (e.g. pref_family_name);
 * transasctions - a list of transactions, each of which
   contains:
     xact.summary - information about the transaction
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 ed789a585f..d1caaf23ae 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
@@ -17,6 +17,7 @@ to this template includes:
     patron.alias - The patron's alias
     patron.has_email - Whether or not the patron has an email address
     patron.has_phone - Whether or not the patron has a phone number
+    pref_ versions of all name fields (e.g. pref_family_name);
 * transasctions - a list of transactions, each of which contains:
   xact.id - Bill unique id
   xact.copy_barcode - Copy barcode
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 225fbb4ac1..2092ad950f 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
@@ -8,6 +8,7 @@ Fields include:
   * second_given_name
   * family_name
   * suffix
+  * pref_ versions of all name fields (e.g. pref_family_name);
   * card.barcode
   * money_summary.balance_owed - current balance
   * money_summary.total_paid - payments made on outstanding fines/fees
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 8f4157fc12..ceda5c82d4 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
@@ -442,6 +442,11 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
             second_given_name : cusr.second_given_name(),
             family_name : cusr.family_name(),
             suffix : cusr.suffix(),
+            pref_prefix : cusr.pref_prefix(),
+            pref_first_given_name : cusr.pref_first_given_name(),
+            pref_second_given_name : cusr.pref_second_given_name(),
+            pref_family_name : cusr.pref_family_name(),
+            pref_suffix : cusr.pref_suffix(),
             card : { barcode : cusr.card().barcode() },
             expire_date : cusr.expire_date(),
             alias : cusr.alias(),
@@ -574,6 +579,11 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
                             second_given_name : cusr.second_given_name(),
                             family_name : cusr.family_name(),
                             suffix : cusr.suffix(),
+                            pref_prefix : cusr.pref_prefix(),
+                            pref_first_given_name : cusr.pref_first_given_name(),
+                            pref_second_given_name : cusr.pref_second_given_name(),
+                            pref_family_name : cusr.pref_family_name(),
+                            pref_suffix : cusr.pref_suffix(),
                             card : { barcode : cusr.card().barcode() },
                             expire_date : cusr.expire_date(),
                             alias : cusr.alias(),
@@ -1064,6 +1074,11 @@ function($scope,  $q , egCore , patronSvc , billSvc , egPromptDialog , $location
                             egCore.org.get(egCore.auth.user().ws_ou())),
                         patron : {
                             prefix : cusr.prefix(),
+                            pref_prefix : cusr.pref_prefix(),
+                            pref_first_given_name : cusr.pref_first_given_name(),
+                            pref_second_given_name : cusr.pref_second_given_name(),
+                            pref_family_name : cusr.pref_family_name(),
+                            pref_suffix : cusr.pref_suffix(),
                             first_given_name : cusr.first_given_name(),
                             second_given_name : cusr.second_given_name(),
                             family_name : cusr.family_name(),
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 c836690e0c..105c9f5a42 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
@@ -380,6 +380,11 @@ function($scope , $q , $routeParams , $timeout , egCore , egUser , patronSvc ,
             second_given_name : cusr.second_given_name(),
             family_name : cusr.family_name(),
             suffix : cusr.suffix(),
+            pref_prefix : cusr.pref_prefix(),
+            pref_first_given_name : cusr.pref_first_given_name(),
+            pref_second_given_name : cusr.pref_second_given_name(),
+            pref_family_name : cusr.pref_family_name(),
+            pref_suffix : cusr.pref_suffix(),
             card : { barcode : cusr.card().barcode() },
             money_summary : patronSvc.patron_stats.fines,
             expire_date : cusr.expire_date(),
-- 
2.11.0