From f979f69c594cb5a6f4c4b618aabbe2f48ccfed0c Mon Sep 17 00:00:00 2001
From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Tue, 5 Jan 2010 22:38:58 +0000
Subject: [PATCH] %balance_owed% macro for checkout receipts

git-svn-id: svn://svn.open-ils.org/ILS/trunk@15261 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/xul/staff_client/server/circ/checkout.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js
index dbacc7553c..3b1b98337c 100644
--- a/Open-ILS/xul/staff_client/server/circ/checkout.js
+++ b/Open-ILS/xul/staff_client/server/circ/checkout.js
@@ -6,6 +6,7 @@ circ.checkout = function (params) {
     JSAN.use('util.error'); this.error = new util.error();
     JSAN.use('util.network'); this.network = new util.network();
     JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'});
+    JSAN.use('util.money');
     JSAN.use('util.barcode');
 };
 
@@ -297,6 +298,9 @@ circ.checkout.prototype = {
                 'patron' : obj.patron, 
                 'lib' : obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ],
                 'staff' : obj.data.list.au[0],
+                'data' : {
+                    'balance_owed' : util.money.sanitize( obj.most_recent_balance_owed ),
+                },
                 'template' : 'checkout',
                 'callback' : function() {
                     setTimeout(
@@ -404,7 +408,11 @@ circ.checkout.prototype = {
                         if (checkout.payload.copy.dummy_author()) {
                             checkout.payload.record.author( checkout.payload.copy.dummy_author() );
                         }
-            
+           
+                        if (checkout.payload.patron_money) {
+                            obj.most_recent_balance_owed = checkout.payload.patron_money.balance_owed();
+                        }
+ 
                         obj.list.append(
                             {
                                 'row' : {
-- 
2.11.0