LP#1708488: adjust how patron financial summary is exposed to checkout receipts
authorGalen Charlton <gmc@equinoxinitiative.org>
Tue, 7 Nov 2017 18:41:55 +0000 (13:41 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 9 Nov 2017 16:23:31 +0000 (11:23 -0500)
This patch builds on the previous patch by grabbing the patron's
financial summary from the patron stats values. The "patron_money"
template value is no longer associated with a particular loan, meaning
that you can do things like this:

<span ng-if="patron_money.balance_owed">You owe the library ${{patron_money.balance_owed}}</span>

The additional values include

* 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

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Terra McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates/staff/share/print_templates/t_checkout.tt2
Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js

index 9c3c6b9..6b445b9 100644 (file)
@@ -1,13 +1,18 @@
 <!--
 Template for printing checkout receipts; fields available include:
 
+* patron_money - summary of the patron's current financial obligations:
+
+  * 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
+
 * circulations - list of loans made during this session. Each
   includes:
 
   * title
   * copy_barcode
   * due_date
-  * patron_money.balance_owed - must be grabbed from a specific circulation, e.g. circulations[0].patron_money.balance_owed
 
 -->
 <div>
index f7a7148..11510f4 100644 (file)
@@ -469,15 +469,16 @@ function($scope , $q , egCore , ngToast) {
                 },
                 copy : seed_copy,
                 title : seed_record.title,
-                author : seed_record.author,
-                patron_money : {
-                    balance_owed : "$5.00",
-                    total_owed : "$10.10",
-                    total_paid : "$5.10"
-                }
+                author : seed_record.author
             },
         ],
 
+        patron_money : {
+            balance_owed : 5.01,
+            total_owed : 10.12,
+            total_paid : 5.11
+        },
+
         in_house_uses : [
             {
                 num_uses : 3,
index e3ad2f7..83a6a6f 100644 (file)
@@ -264,7 +264,6 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
             if (co.circ) {
                 print_data.circulations.push({
                     circ : egCore.idl.toHash(co.circ),
-                    patron_money : egCore.idl.toHash(co.evt[0].payload.patron_money),
                     copy : egCore.idl.toHash(co.acp),
                     call_number : egCore.idl.toHash(co.acn),
                     title : co.title,
@@ -273,6 +272,8 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
             };
         });
 
+        print_data.patron_money = patronSvc.patron_stats.fines;
+
         return egCore.print.print({
             context : 'default', 
             template : 'checkout',