From 1b87f873534abaa8d723c7d86a0cefc5bcf3bf99 Mon Sep 17 00:00:00 2001
From: Nick Duncan
Date: Tue, 1 Dec 2015 13:09:32 -0500
Subject: [PATCH] KMAIN 1917 Patron bills print selected items
Patron Bills Window Now Supports The Option To Print Selected Line Items
Signed-off-by: Nick Duncan
Conflicts:
Open-ILS/xul/staff_client/server/patron/bill2.js
---
Open-ILS/xul/staff_client/server/patron/bill2.js | 21 +++
Open-ILS/xul/staff_client/server/patron/bill2.xul | 2 +
.../staff_client/server/skin/print_list_templates | 187 ++++++++++++++++++++-
3 files changed, 209 insertions(+), 1 deletion(-)
diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js
index 91c0ad0c3a..cf34e198c2 100644
--- a/Open-ILS/xul/staff_client/server/patron/bill2.js
+++ b/Open-ILS/xul/staff_client/server/patron/bill2.js
@@ -129,6 +129,12 @@ function event_listeners() {
handle_copy_details,
false
);
+
+ window.bill_event_listeners.add($('printthis'),
+ 'command',
+ handle_printthis,
+ false
+ );
window.bill_event_listeners.add($('payment'),
'change',
@@ -580,6 +586,7 @@ function init_lists() {
$('refund').setAttribute('disabled', g.bill_list_selection.length == 0);
$('opac').setAttribute('disabled', g.bill_list_selection.length == 0);
$('copy_details').setAttribute('disabled', g.bill_list_selection.length == 0);
+ $('printthis').setAttribute('disabled', g.bill_list_selection.length == 0);
},
'on_click' : function(ev) {
var row = {}; var col = {}; var nobj = {};
@@ -760,6 +767,20 @@ function handle_void_all() {
}
}
+function handle_printthis()
+{
+ var Selected_Line_Item = g.bill_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' : 'items_due'
+ };
+
+ g.bill_list.print( params );
+}
+
function handle_opac() {
try {
var ids = [];
diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.xul b/Open-ILS/xul/staff_client/server/patron/bill2.xul
index ef781b13d5..05c4271c63 100644
--- a/Open-ILS/xul/staff_client/server/patron/bill2.xul
+++ b/Open-ILS/xul/staff_client/server/patron/bill2.xul
@@ -45,6 +45,7 @@
+
@@ -56,6 +57,7 @@
+
diff --git a/Open-ILS/xul/staff_client/server/skin/print_list_templates b/Open-ILS/xul/staff_client/server/skin/print_list_templates
index e9a56b8673..b887043df8 100644
--- a/Open-ILS/xul/staff_client/server/skin/print_list_templates
+++ b/Open-ILS/xul/staff_client/server/skin/print_list_templates
@@ -1 +1,186 @@
-{"item_status":{"type":"items","header":"The following items have been examined:
","line_item":"- %title%
\nBarcode: %barcode%
\nCall #: %call_number%
\nDue: %due_date_EN%
\n
\n","footer":"
%SHORTNAME% %TODAY_TRIM%
\n
\n","inherit":null,"context":"receipt"},"transit_list":{"type":"transits","header":"Transits:
","line_item":"- From: %transit_source% To: %transit_dest_lib%
\nWhen: %transit_source_send_time%
\nBarcode: %transit_item_barcode% Title: %transit_item_title%
\n","footer":"
%SHORTNAME% %TODAY_TRIM%
\n
\n","inherit":null,"context":"default"},"items_out":{"type":"items","header":"Welcome to %LIBRARY%!
\n%PATRON_FIRSTNAME% has the following items:
","line_item":"- %title%
\nBarcode: %barcode%
\nCall #: %call_number%
\nDue: %due_date_EN%
\n
\n\n","footer":"
%SHORTNAME% %TODAY_TRIM%
\n
\n","inherit":null,"context":"receipt"},"renew":{"type":"items","header":"Welcome to %LIBRARY%!
\n%PATRON_FIRSTNAME% has renewed the following items:
","line_item":"- %title%
\nBarcode: %barcode%
\nDue: %due_date_EN%
\n
\n","footer":"
%SHORTNAME% %TODAY_TRIM%
\n
\n","inherit":null,"context":"receipt"},"checkout":{"type":"items","header":"Welcome to %LIBRARY%!
\n%PATRON_FIRSTNAME% checked out the following items:
","line_item":"- %title%
\nBarcode: %barcode%
\nCall #: %call_number%
\n Due: %due_date_EN%
\n
\n","footer":"
%SHORTNAME% %TODAY_TRIM%
Materials may be returned to any KCLS library.\n\n
\n","inherit":null,"context":"receipt"},"offline_checkout":{"type":"offline_checkout","header":"Patron %patron_barcode%
\nYou checked out the following items:
","line_item":"- Barcode: %barcode%
\nDue: %due_date%\n","footer":"
%TODAY_TRIM%
\n
\n","inherit":null,"context":"offline"},"checkin":{"type":"items","header":" You have checked in the following items:
","line_item":"- %title%
\nBarcode: %barcode% \n
\n\n","footer":"
%SHORTNAME% %TODAY_TRIM%
\n
\n","inherit":null,"context":"receipt"},"bill_payment":{"type":"payment","header":"Welcome to %LIBRARY%, %PATRON_FIRSTNAME%!
A receipt of your transaction:
| Original Balance: | $%original_balance% |
| Payment Received: | $%payment_received% |
| Payment Applied: | $%payment_applied% |
| New Balance: | $%new_balance% |
Specific bills:
","line_item":"Invoice: %bill_id%
Status: %last_billing_type%
Title: %title%
Barcode: %barcode%
Received: $%payment%
","footer":"
%SHORTNAME% %TODAY_TRIM%
","inherit":null,"context":"receipt"},"bills_historical":{"type":"bills","header":"Welcome to %LIBRARY%!
You had the following bills:
\n\n","line_item":"Bill # %mbts_id% \n\n\n\n\n\n\n\n| Type: | %last_billing_type% |
\n\n| Billed/Paid | $%total_owed% / %total_paid% |
\n\n\n\n| Balance: | $%balance_owed% |
\n\n\n","footer":"\n\n\n
%SHORTNAME% %TODAY_TRIM%
\n
\n","inherit":null,"context":"receipt"},"bills_current":{"type":"bills","header":"Welcome to %LIBRARY%!
You have the following bills:
\n\n\n","line_item":"Bill #%mbts_id% \n\n\n\n\n\n\n\n| Type: | %last_billing_type% |
\n\n| Billed/Paid | $%total_owed% / %total_paid% |
\n\n\n\n| Balance: | $%balance_owed% |
\n","footer":"\n\n\n
%SHORTNAME% %TODAY_TRIM%
\n
","inherit":null,"context":"receipt"},"offline_checkin":{"type":"offline_checkin","header":"You checked in the following items:
","line_item":"- Barcode: %barcode%\n","footer":"
%TODAY_TRIM%
\n
\n","inherit":null,"context":"offline"},"offline_renew":{"type":"offline_renew","header":"You renewed the following items:
","line_item":"- Barcode: %barcode%\n","footer":"
%TODAY_TRIM%
\n
\n","inherit":null,"context":"offline"},"offline_inhouse_use":{"type":"offline_inhouse_use","header":"You marked the following in-house items used:
","line_item":"- Barcode: %barcode%\nUses: %count%","footer":"
%TODAY_TRIM%
\n
\n","inherit":null,"context":"receipt"},"in_house_use":{"type":"items","header":"You marked the following in-house items used:
","line_item":"- Barcode: %barcode%\r\nUses: %uses%\r\n
%alert_message%","footer":"
%TODAY_TRIM%
\r\n
\r\n"},"holds":{"type":"holds","header":"Welcome to %LIBRARY%!
\nYou have the following titles on hold:
","line_item":"- %title%\n","footer":"
%SHORTNAME% %TODAY_TRIM%
\nYou were helped by %STAFF_FIRSTNAME%
\n
\n","inherit":null,"context":"receipt"},"holds_on_bib":{"type":"holds","inherit":"holds"},"holds_for_patron":{"type":"holds","inherit":"holds"},"holds_shelf":{"type":"holds","inherit":null,"header":"%SHORTNAME% %TODAY_TRIM%
\n
\n\n\n\n| Patron | \nAction | \nType | \nTitle | \nAuthor | \nShelving Location | \nCall Number | \nBarcode | \n
","line_item":"\n| %patron_display_name% | \n%post_clear_shelf_action% | \n%hold_type% | \n%title% | \n%author% | \n%current_copy_location% | \n%callnumber% | \n%current_copy% | \n
","footer":"
\n","context":"default"},"holds_pull_list":{"type":"holds","inherit":"holds"},"hold_slip":{"type":"holds","header":"\n\n⌂\n\n\n\n%LIBRARY%\n\n
\n\n\n\n%PATRON_HOLD_LASTNAME_ABBR%\n
\n\n%PATRON_ALIAS_OR_FIRSTNAME_ABBR%\n\n\n
\n\n %TODAY_MMM%
\n\n Barcode: %item_barcode%\n\n\n\n Patron:%PATRON_ID%
\n
\n\n\n\n\n\n
\n\n\n","line_item":"\n
\n
\n
\n
\n
\n
\n
\n
\n\n%formatted_note%
\n
\n","footer":"
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\nSlip Date: %TODAY_TRIM%
\nPrinted by %STAFF_FIRSTNAME%
\n
","inherit":null,"context":"receipt"},"transit_slip":{"type":"transits","header":"This item needs to be routed to %route_to%:
\r\n%route_to_org_fullname%
\r\n%street1%
\r\n%street2%
\r\n%city_state_zip%
\r\n
\r\n","line_item":"Barcode: %item_barcode%
\r\nTitle: %item_title%
\r\nAuthor: %item_author%
\r\n
\r\n","footer":"Slip Date: %TODAY_TRIM%
\r\nPrinted by %STAFF_FIRSTNAME% at %SHORTNAME%
\r\n
\r\n"},"hold_transit_slip":{"type":"transits","header":"\n \n⇚\n\n\n\nRoute to : %route_to_org_fullname%
\n\n \n \n%PATRON_HOLD_LASTNAME_ABBR%\n
\n\n%PATRON_ALIAS_OR_FIRSTNAME_ABBR%\n\n\n
\n\n %TODAY_MMM%
\n\n Barcode: %item_barcode%\n\n\n\n Patron:%PATRON_ID%
\n
\n\n\n\n\n
\n
","line_item":"\n
%formatted_note%
\n","footer":"
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\nSlip Date: %TODAY_TRIM%
\nPrinted by %STAFF_FIRSTNAME%
\n
","inherit":null,"context":"receipt"},"holdings_maintenance":{"type":"items","header":"Title: %title%
\nAuthor: %author%
\nISBN: %isbn% Edition: %edition% PubDate: %pubdate%
\nTCN: %tcn_value% Record ID: %mvr_doc_id%
\nCreator: %creator% Create Date: %create_date%
\nEditor: %editor% Edit Date: %edit_date%
\n","line_item":"%prefix% %tree_location% %suffix% %parts% %acp_status%
\n","footer":"
%SHORTNAME% %TODAY_TRIM%
\n
\n","inherit":null,"context":"default"},"bills_main_view":{"type":"bills","header":"Welcome to %LIBRARY%!
You have the following bills:
","line_item":"- Bill #%id% %title%
-
| Date: | %xact_start% |
| Type: | %xact_type% |
| Last Billing: | %last_billing_type% %last_billing_note% |
| Total Billed: | $%total_owed% |
| Last Payment: | %last_payment_type% %last_payment_note% |
| Total Paid: | $%total_paid% |
| Balance: | $%balance_owed% |
","footer":"
%SHORTNAME% %TODAY_TRIM%
\n
\n","inherit":null,"context":"receipt"}}
\ No newline at end of file
+{
+ "item_status": {
+ "type": "items",
+ "header": "The following items have been examined:
",
+ "line_item": "- %title%
\nBarcode: %barcode%
\nCall #: %call_number%
\nDue: %due_date_EN%
\n
\n",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "transit_list": {
+ "type": "transits",
+ "header": "Transits:
",
+ "line_item": "- From: %transit_source% To: %transit_dest_lib%
\nWhen: %transit_source_send_time%
\nBarcode: %transit_item_barcode% Title: %transit_item_title%
\n",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "default"
+ },
+ "items_out": {
+ "type": "items",
+ "header": "Welcome to %LIBRARY%!
\n%PATRON_FIRSTNAME% has the following items:
",
+ "line_item": "- %title%
\nBarcode: %barcode%
\nCall #: %call_number%
\nDue: %due_date_EN%
\n
\n\n",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "renew": {
+ "type": "items",
+ "header": "Welcome to %LIBRARY%!
\n%PATRON_FIRSTNAME% has renewed the following items:
",
+ "line_item": "- %title%
\nBarcode: %barcode%
\nDue: %due_date_EN%
\n
\n",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "checkout": {
+ "type": "items",
+ "header": "Welcome to %LIBRARY%!
\n%PATRON_FIRSTNAME% checked out the following items:
",
+ "line_item": "- %title%
\nBarcode: %barcode%
\nCall #: %call_number%
\n Due: %due_date_EN%
\n
\n",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
Materials may be returned to any KCLS library.\n\n
\n",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "offline_checkout": {
+ "type": "offline_checkout",
+ "header": "Patron %patron_barcode%
\nYou checked out the following items:
",
+ "line_item": "- Barcode: %barcode%
\nDue: %due_date%\n",
+ "footer": "
%TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "offline"
+ },
+ "checkin": {
+ "type": "items",
+ "header": " You have checked in the following items:
",
+ "line_item": "- %title%
\nBarcode: %barcode% \n
\n\n",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "bill_payment": {
+ "type": "payment",
+ "header": "Welcome to %LIBRARY%, %PATRON_FIRSTNAME%!
A receipt of your transaction:
| Original Balance: | $%original_balance% |
| Payment Received: | $%payment_received% |
| Payment Applied: | $%payment_applied% |
| New Balance: | $%new_balance% |
Specific bills:
",
+ "line_item": "Invoice: %bill_id%
Status: %last_billing_type%
Title: %title%
Barcode: %barcode%
Received: $%payment%
",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "bills_historical": {
+ "type": "bills",
+ "header": "Welcome to %LIBRARY%!
You had the following bills:
\n\n",
+ "line_item": "Bill # %mbts_id% \n\n\n\n\n\n\n\n| Type: | %last_billing_type% |
\n\n| Billed/Paid | $%total_owed% / %total_paid% |
\n\n\n\n| Balance: | $%balance_owed% |
\n\n\n",
+ "footer": "\n\n\n
%SHORTNAME% %TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "items_due": {
+ "type": "items",
+ "header": "Welcome to %LIBRARY%!
\n%PATRON_FIRSTNAME% has the following items due for payment:
",
+ "line_item": "- %title%
\nBarcode: %barcode%
\nCall #: %call_number%
\nDue: %due_date_EN%
\nStatus: %last_billing_type%\nBilled/Paid: $%total_owed% / %total_paid%
\n",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "bills_current": {
+ "type": "bills",
+ "header": "Welcome to %LIBRARY%!
You have the following bills:
\n\n\n",
+ "line_item": "Bill #%mbts_id% \n\n\n\n\n\n\n\n| Type: | %last_billing_type% |
\n\n| Billed/Paid | $%total_owed% / %total_paid% |
\n\n\n\n| Balance: | $%balance_owed% |
\n",
+ "footer": "\n\n\n
%SHORTNAME% %TODAY_TRIM%
\n
",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "offline_checkin": {
+ "type": "offline_checkin",
+ "header": "You checked in the following items:
",
+ "line_item": "- Barcode: %barcode%\n",
+ "footer": "
%TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "offline"
+ },
+ "offline_renew": {
+ "type": "offline_renew",
+ "header": "You renewed the following items:
",
+ "line_item": "- Barcode: %barcode%\n",
+ "footer": "
%TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "offline"
+ },
+ "offline_inhouse_use": {
+ "type": "offline_inhouse_use",
+ "header": "You marked the following in-house items used:
",
+ "line_item": "- Barcode: %barcode%\nUses: %count%",
+ "footer": "
%TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "in_house_use": {
+ "type": "items",
+ "header": "You marked the following in-house items used:
",
+ "line_item": "- Barcode: %barcode%\r\nUses: %uses%\r\n
%alert_message%",
+ "footer": "
%TODAY_TRIM%
\r\n
\r\n"
+ },
+ "holds": {
+ "type": "holds",
+ "header": "Welcome to %LIBRARY%!
\nYou have the following titles on hold:
",
+ "line_item": "- %title%\n",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
\nYou were helped by %STAFF_FIRSTNAME%
\n
\n",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "holds_on_bib": {
+ "type": "holds",
+ "inherit": "holds"
+ },
+ "holds_for_patron": {
+ "type": "holds",
+ "inherit": "holds"
+ },
+ "holds_shelf": {
+ "type": "holds",
+ "inherit": null,
+ "header": "%SHORTNAME% %TODAY_TRIM%
\n
\n\n\n\n| Patron | \nAction | \nType | \nTitle | \nAuthor | \nShelving Location | \nCall Number | \nBarcode | \n
",
+ "line_item": "\n| %patron_display_name% | \n%post_clear_shelf_action% | \n%hold_type% | \n%title% | \n%author% | \n%current_copy_location% | \n%callnumber% | \n%current_copy% | \n
",
+ "footer": "
\n",
+ "context": "default"
+ },
+ "holds_pull_list": {
+ "type": "holds",
+ "inherit": "holds"
+ },
+ "hold_slip": {
+ "type": "holds",
+ "header": "\n\n⌂\n\n\n\n%LIBRARY%\n\n
\n\n\n\n%PATRON_HOLD_LASTNAME_ABBR%\n
\n\n%PATRON_ALIAS_OR_FIRSTNAME_ABBR%\n\n\n
\n\n %TODAY_MMM%
\n\n Barcode: %item_barcode%\n\n\n\n Patron:%PATRON_ID%
\n
\n\n\n\n\n\n
\n\n\n",
+ "line_item": "\n
\n
\n
\n
\n
\n
\n
\n
\n\n%formatted_note%
\n
\n",
+ "footer": "
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\nSlip Date: %TODAY_TRIM%
\nPrinted by %STAFF_FIRSTNAME%
\n
",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "transit_slip": {
+ "type": "transits",
+ "header": "This item needs to be routed to %route_to%:
\r\n%route_to_org_fullname%
\r\n%street1%
\r\n%street2%
\r\n%city_state_zip%
\r\n
\r\n",
+ "line_item": "Barcode: %item_barcode%
\r\nTitle: %item_title%
\r\nAuthor: %item_author%
\r\n
\r\n",
+ "footer": "Slip Date: %TODAY_TRIM%
\r\nPrinted by %STAFF_FIRSTNAME% at %SHORTNAME%
\r\n
\r\n"
+ },
+ "hold_transit_slip": {
+ "type": "transits",
+ "header": "\n \n⇚\n\n\n\nRoute to : %route_to_org_fullname%
\n\n \n \n%PATRON_HOLD_LASTNAME_ABBR%\n
\n\n%PATRON_ALIAS_OR_FIRSTNAME_ABBR%\n\n\n
\n\n %TODAY_MMM%
\n\n Barcode: %item_barcode%\n\n\n\n Patron:%PATRON_ID%
\n
\n\n\n\n\n
\n
",
+ "line_item": "\n
%formatted_note%
\n",
+ "footer": "
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\nSlip Date: %TODAY_TRIM%
\nPrinted by %STAFF_FIRSTNAME%
\n
",
+ "inherit": null,
+ "context": "receipt"
+ },
+ "holdings_maintenance": {
+ "type": "items",
+ "header": "Title: %title%
\nAuthor: %author%
\nISBN: %isbn% Edition: %edition% PubDate: %pubdate%
\nTCN: %tcn_value% Record ID: %mvr_doc_id%
\nCreator: %creator% Create Date: %create_date%
\nEditor: %editor% Edit Date: %edit_date%
\n",
+ "line_item": "%prefix% %tree_location% %suffix% %parts% %acp_status%
\n",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "default"
+ },
+ "bills_main_view": {
+ "type": "bills",
+ "header": "Welcome to %LIBRARY%!
You have the following bills:
",
+ "line_item": "- Bill #%id% %title%
-
| Date: | %xact_start% |
| Type: | %xact_type% |
| Last Billing: | %last_billing_type% %last_billing_note% |
| Total Billed: | $%total_owed% |
| Last Payment: | %last_payment_type% %last_payment_note% |
| Total Paid: | $%total_paid% |
| Balance: | $%balance_owed% |
",
+ "footer": "
%SHORTNAME% %TODAY_TRIM%
\n
\n",
+ "inherit": null,
+ "context": "receipt"
+ }
+}
\ No newline at end of file
--
2.11.0