[open-ils-commits] r8193 - in trunk/Open-ILS/xul/staff_client:
chrome/content/OpenILS server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Dec 10 16:44:34 EST 2007
Author: phasefx
Date: 2007-12-10 16:24:11 -0500 (Mon, 10 Dec 2007)
New Revision: 8193
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
trunk/Open-ILS/xul/staff_client/server/patron/bills.js
trunk/Open-ILS/xul/staff_client/server/patron/bills.xul
trunk/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul
Log:
print bills with titles from main billing interface
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2007-12-10 21:20:29 UTC (rev 8192)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2007-12-10 21:24:11 UTC (rev 8193)
@@ -304,7 +304,13 @@
'header' : 'Welcome 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 />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
- },
+ },
+ 'bills_main_view' : {
+ 'type' : 'bills',
+ 'header' : 'Welcome to %LIBRARY%!<br/>You have the following bills:<hr/><ol>',
+ 'line_item' : '<dt><b>Bill #%id%</b> %title%</dt> <dd> <table width="100%"> <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 />%SHORTNAME% %TODAY_TRIM%<br/>\r\n<br/>\r\n',
+ },
'offline_checkin' : {
'type' : 'offline_checkin',
'header' : 'You checked in the following items:<hr/><ol>',
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bills.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bills.js 2007-12-10 21:20:29 UTC (rev 8192)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bills.js 2007-12-10 21:24:11 UTC (rev 8193)
@@ -224,8 +224,17 @@
}
}
],
+ 'cmd_print_bills' : [
+ ['command'],
+ function() {
+ try {
+ obj.print_bills();
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('bills -> cmd_print_bills',E);
+ }
-
+ }
+ ],
'cmd_change_to_credit' : [
['command'],
function() {
@@ -667,6 +676,44 @@
}
},
+ 'print_bills' : function() {
+ var obj = this;
+ try {
+ JSAN.use('util.functional'); JSAN.use('patron.util');
+ var columns = patron.util.mbts_columns({});
+ var template = 'bills_main_view';
+ var params = {
+ 'patron' : patron.util.retrieve_au_via_id(ses(),obj.patron_id),
+ 'lib' : obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ],
+ 'staff' : obj.data.list.au[0],
+ 'header' : obj.data.print_list_templates[template].header,
+ 'line_item' : obj.data.print_list_templates[template].line_item,
+ 'footer' : obj.data.print_list_templates[template].footer,
+ 'type' : obj.data.print_list_templates[template].type,
+ 'list' : util.functional.map_list(
+ obj.bills,
+ function(o) {
+ var id = o.transaction.id();
+ var hash = {
+ 'title' : typeof obj.bill_map[ id ].title != 'undefined' ? obj.bill_map[ id ].title : '',
+ 'barcode' : typeof obj.bill_map[ id ].barcode != 'undefined' ? obj.bill_map[ id ].barcode : '',
+ };
+ for (var i = 0; i < columns.length; i++) {
+ var v = columns[i].render( { 'mbts' : o.transaction } );
+ hash[ columns[i].id ] = v == null ? '' : v;
+ }
+ return hash;
+ }
+ )
+ };
+ JSAN.use('util.print'); var print = new util.print();
+ print.tree_list( params );
+
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('bills -> print_bills',E);
+ }
+ },
+
'xact_dates_box' : function ( mobts ) {
var obj = this;
try {
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bills.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bills.xul 2007-12-10 21:20:29 UTC (rev 8192)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bills.xul 2007-12-10 21:24:11 UTC (rev 8193)
@@ -76,6 +76,7 @@
<command id="cmd_change_to_credit" />
<command id="cmd_uncheck_all" />
<command id="cmd_check_all" />
+ <command id="cmd_print_bills" />
<command id="cmd_alternate_view" />
</commandset>
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul 2007-12-10 21:20:29 UTC (rev 8192)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul 2007-12-10 21:24:11 UTC (rev 8193)
@@ -23,6 +23,7 @@
<button command="cmd_uncheck_all" label="Uncheck All"/>
<button command="cmd_check_all" label="Check All"/>
<spacer flex="1"/>
+ <button command="cmd_print_bills" label="Print Bills" />
<button command="cmd_alternate_view" label="Alternate View" accesskey="V"/>
</hbox>
</box>
More information about the open-ils-commits
mailing list