From db50d66d8145273fe39dcddcf5cbde308115324c Mon Sep 17 00:00:00 2001 From: Nick Duncan Date: Wed, 30 Dec 2015 13:07:38 -0500 Subject: [PATCH] KMAIN-1917 Patron payments print selected items You can now print selected line items from the Payments window Signed-off-by: Nick Duncan --- .../xul/staff_client/server/patron/bill_history.js | 29 ++++++++++++++++++++++ .../staff_client/server/patron/bill_history.xul | 1 + .../staff_client/server/skin/print_list_templates | 9 +++++++ 3 files changed, 39 insertions(+) diff --git a/Open-ILS/xul/staff_client/server/patron/bill_history.js b/Open-ILS/xul/staff_client/server/patron/bill_history.js index d897f6f780..5eaa96ff2a 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_history.js +++ b/Open-ILS/xul/staff_client/server/patron/bill_history.js @@ -200,6 +200,7 @@ function init_payments_list() { ); payments_tally_selected(); $('payments_details').disabled = g.payments_list_selection.length == 0; + $('print_selected').disabled = g.payments_list_selection.length == 0; $('copy_details_from_payments').disabled = g.payments_list_selection.length == 0; }, 'retrieve_row' : function(params) { @@ -256,6 +257,12 @@ function my_init() { gen_handle_details('payments'), false ); + + window.bill_history_event_listeners.add($('print_selected'), + 'command', + gen_handle_details('payments'), + false + ); window.bill_history_event_listeners.add($('copy_details'), 'command', @@ -392,6 +399,28 @@ function print_bills() { } } +function print_bills_from_history() +{ + try + { + var Selected_Line_Item = g.payments_list.dump_selected_with_keys(0); + + var params = + { + 'list': Selected_Line_Item, + 'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id), + 'printer_context' : 'receipt', + 'template' : 'bill_payment_basic' + }; + + g.payments_list.print(params); + } + catch(E) + { + alert("Caught Exception! Details: " + E.toSource()); + } +} + function payment_history_init() { try { if (payment_history_fetched) { return; } else { payment_history_fetched = true; } diff --git a/Open-ILS/xul/staff_client/server/patron/bill_history.xul b/Open-ILS/xul/staff_client/server/patron/bill_history.xul index 9671de1bba..aac5b35c88 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_history.xul +++ b/Open-ILS/xul/staff_client/server/patron/bill_history.xul @@ -134,6 +134,7 @@ +