default print templates for historical bills and current bills
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 16 Jun 2006 01:48:35 +0000 (01:48 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 16 Jun 2006 01:48:35 +0000 (01:48 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4641 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Open-ILS/xul/staff_client/server/patron/bill_history.xul

index 5f315a1..f364160 100644 (file)
@@ -136,10 +136,16 @@ OpenILS.data.prototype = {
                                        'line_item' : '<li>%title%<br/>\r\nBarcode: %barcode%  Call Number: %call_number%\r\n',
                                        'footer' : '</ol><hr />%PINES_CODE% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
                                }, 
-                               'bills' : {
+                               'bills_historical' : {
                                        'type' : 'bills',
-                                       'header' : 'You have or had the following bills:<hr/><ol>',
-                                       'line_item' : '<li>test\r\n',
+                                       'header' : 'Welcome %PATRON_FIRSTNAME%, to %LIBRARY%!<br/>You had the following bills:<hr/><ol>',
+                                       'line_item' : '<dt><b>Bill #%id%</b></dt> <dd> <table> <tr valign="top"><td>Date:</td><td>%xact_start%</td></tr> <tr valign="top"><td>Type:</td><td>%xact_type%</td></tr> <tr valign="top"><td>Last Billing:</td><td>%last_billing_type%<br/>%last_billing_note%</td></tr> <tr valign="top"><td>Total Billed:</td><td>$%total_owed%</td></tr> <tr valign="top"><td>Last Payment:</td><td>%last_payment_type%<br/>%last_payment_note%</td></tr> <tr valign="top"><td>Total Paid:</td><td>$%total_paid%</td></tr> <tr valign="top"><td><b>Balance:</b></td><td><b>$%balance_owed%</b></td></tr> </table><br/>',
+                                       'footer' : '</ol><hr />%PINES_CODE% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
+                               }, 
+                               'bills_current' : {
+                                       'type' : 'bills',
+                                       'header' : 'Welcome %PATRON_FIRSTNAME%, to %LIBRARY%!<br/>You have the following bills:<hr/><ol>',
+                                       'line_item' : '<dt><b>Bill #%id%</b></dt> <dd> <table> <tr valign="top"><td>Date:</td><td>%xact_start%</td></tr> <tr valign="top"><td>Type:</td><td>%xact_type%</td></tr> <tr valign="top"><td>Last Billing:</td><td>%last_billing_type%<br/>%last_billing_note%</td></tr> <tr valign="top"><td>Total Billed:</td><td>$%total_owed%</td></tr> <tr valign="top"><td>Last Payment:</td><td>%last_payment_type%<br/>%last_payment_note%</td></tr> <tr valign="top"><td>Total Paid:</td><td>$%total_paid%</td></tr> <tr valign="top"><td><b>Balance:</b></td><td><b>$%balance_owed%</b></td></tr> </table><br/>',
                                        'footer' : '</ol><hr />%PINES_CODE% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
                                }, 
                                'offline_checkin' : {
index 4cac3e0..283bd02 100644 (file)
                }
 
                function print_bills() {
-                       dump(js2JSON(g.bill_list.dump()) + '\n');
                        try {
+                               var template = 'bills_historical'; if (g.cgi.param('current')) template = 'bills_current';
                                JSAN.use('patron.util');
                                var params = { 
                                        'patron' : patron.util.retrieve_au_via_id(ses(),g.patron_id), 
                                        'lib' : g.data.hash.aou[ g.data.list.au[0].ws_ou() ],
                                        'staff' : g.data.list.au[0],
-                                       'header' : g.data.print_list_templates.bills.header,
-                                       'line_item' : g.data.print_list_templates.bills.line_item,
-                                       'footer' : g.data.print_list_templates.bills.footer,
-                                       'type' : g.data.print_list_templates.bills.type,
+                                       'header' : g.data.print_list_templates[template].header,
+                                       'line_item' : g.data.print_list_templates[template].line_item,
+                                       'footer' : g.data.print_list_templates[template].footer,
+                                       'type' : g.data.print_list_templates[template].type,
                                        'list' : g.bill_list.dump(),
                                };
                                JSAN.use('util.print'); var print = new util.print();