From a4c36a7f0e258614cc659c9ee5b5e96829955dcd Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 7 Nov 2017 13:41:55 -0500 Subject: [PATCH] LP#1708488: adjust how patron financial summary is exposed to checkout receipts 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: You owe the library ${{patron_money.balance_owed}} 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 Signed-off-by: Terra McCanna --- .../staff/share/print_templates/t_checkout.tt2 | 7 ++++++- .../js/ui/default/staff/admin/workstation/app.js | 13 +++++++------ .../web/js/ui/default/staff/circ/patron/checkout.js | 3 ++- 3 files changed, 15 insertions(+), 8 deletions(-) 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 9c3c6b978d..6b445b9de7 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,13 +1,18 @@
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 f7a7148e20..11510f4258 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 @@ -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, 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 e3ad2f7281..83a6a6fecd 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 @@ -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', -- 2.43.2