CAT-58 Bill Interface Print Additions
authorKyle Huckins <khuckins@catalystdevworks.com>
Mon, 25 Apr 2016 16:25:24 +0000 (09:25 -0700)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Add locale settings for Printing selected item.
Add context menu to Bill/Payment History interface.
Add Print Selected Item to Bill/Payment History Context menu.
Change Payment History Interface Print button to print all
items in list.

Signed-off-by: Kyle Huckins <khuckins@catalystdevworks.com>
modified:   Open-ILS/web/opac/locale/en-US/lang.dtd
modified:   Open-ILS/xul/staff_client/server/patron/bill2.xul
modified:   Open-ILS/xul/staff_client/server/patron/bill_history.js
modified:   Open-ILS/xul/staff_client/server/patron/bill_history.xul

Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/patron/bill2.xul
Open-ILS/xul/staff_client/server/patron/bill_history.js
Open-ILS/xul/staff_client/server/patron/bill_history.xul

index db947c1..eb61849 100644 (file)
 <!ENTITY staff.patron.bill_history.bills.end_date.accesskey "">
 <!ENTITY staff.patron.bill_history.bills.retrieve.label "Retrieve Transactions">
 <!ENTITY staff.patron.bill_history.bills.retrieve.accesskey "R">
-
+<!ENTITY staff.patron.bill_interface.print_selected.label "Print Selected Items">
 <!ENTITY staff.patron.bill_interface.caption.label "Current Bills">
 <!ENTITY staff.patron.bill_interface.total_owed "Total Owed:">
 <!ENTITY staff.patron.bill_interface.total_checked "Total Checked:">
index 05c4271..fb74041 100644 (file)
@@ -45,7 +45,7 @@
         <command id="refund" label="&staff.patron.bill_interface.refund.label;" accesskey="&staff.patron.bill_interface.refund.accesskey;" disabled="true"/>
         <command id="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="&staff.patron.bill_interface.add_billing.accesskey;" disabled="true"/>
         <command id="details" label="&staff.patron.bill_interface.full_details.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;" disabled="true"/>
-        <command id="printthis" label="Print This Item" accesskey="&staff.patron.bill_interface.full_details.accesskey;" disabled="true"/>
+        <command id="printthis" label="&staff.patron.bill_interface.print_selected.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;" disabled="true"/>
     </commandset>
 
     <popupset>
index 6b52edb..2a2604a 100644 (file)
@@ -379,11 +379,13 @@ function gen_handle_copy_details(which_list) {
     };
 }
 
-function print_bills() {
+function print_bills(selected) {
     try {
+        if(selected == true) var list = g.bill_list.dump_selected_with_keys(0);
         var template = 'bills_historical';
         JSAN.use('patron.util');
         var params = { 
+            'list' : list,
             'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id,null), 
             'template' : template
         };
@@ -393,11 +395,11 @@ function print_bills() {
     }
 }
 
-function print_bills_from_history() {
+function print_bills_from_history(selected) {
     try {
-
+        if(selected == true) var list = g.payments_list.dump_selected_with_keys(0);
         var params = {
-            'list': g.payments_list.dump_selected_with_keys(0),
+            'list': list,
             'patron' : patron.util.retrieve_fleshed_au_via_id(ses(), g.patron_id),
             'printer_context' : 'receipt',
             'template' : 'bill_payment_basic'
index aac5b35..4a505b9 100644 (file)
                                 </toolbar>
                             </toolbox>
                         </hbox>
-                        <tree id="bill_tree" flex="1" enableColumnDrag="true" seltype="multiple"/>
+                        <tree id="bill_tree" flex="1" enableColumnDrag="true" seltype="multiple" context="bill_history_actions"/>
                         <hbox>
                             <hbox id="bill_list_actions" />
                             <spacer flex="1"/>
                             <button id="opac" label="&staff.patron.bill_history.show_in_catalog.label;" accesskey="&staff.patron.bill_history.show_in_catalog.accesskey;" hidden="true" oncommand="alert('Not Yet Implemented');"/>
-                            <button id="print" label="&staff.patron.bill_history.print.label;" accesskey="&staff.patron.bill_history.print.accesskey;" hidden="false" oncommand="print_bills();"/>
+                            <button id="print" label="&staff.patron.bill_history.print.label;" accesskey="&staff.patron.bill_history.print.accesskey;" hidden="false" oncommand="print_bills(false);"/>
                             <button id="add" label="&staff.patron.bill_history.add_billing.label;" disabled="true"/>
                             <button id="copy_details" disabled="true" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" />
                             <button id="details" label="&staff.patron.bill_history.full_details.label;" disabled="true" accesskey="&staff.patron.bill_history.full_details.accesskey;"/>
                                 </toolbar>
                             </toolbox>
                         </hbox>
-                        <tree id="payments_tree" flex="1" enableColumnDrag="true" seltype="multiple"/>
+                        <tree id="payments_tree" flex="1" enableColumnDrag="true" seltype="multiple" context="payment_history_actions"/>
                         <hbox>
                             <hbox id="payments_list_actions" />
                             <spacer flex="1"/>
-                            <button id="print_selected" label="&staff.patron.bill_history.print.label;" accesskey="&staff.patron.bill_history.print.accesskey;" hidden="false" oncommand="print_bills_from_history();"/>
+                            <button id="print_selected" label="&staff.patron.bill_history.print.label;" accesskey="&staff.patron.bill_history.print.accesskey;" hidden="false" oncommand="print_bills_from_history(false);"/>
                             <button id="copy_details_from_payments" disabled="true" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" />
                             <button id="payments_details" label="&staff.patron.bill_history.full_details.label;" disabled="true" accesskey="&staff.patron.bill_history.full_details.accesskey;"/>
                         </hbox>
             </tabbox>
         </groupbox>
     </vbox>
+    <popupset id="payment_history_popupset">
+        <menupopup id="payment_history_actions" position="at_pointer">
+            <menuitem label="&staff.patron.bill_interface.print_selected.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;" oncommand="print_bills_from_history(true);"/>
+        </menupopup>
+    </popupset>
+    <popupset id="bill_history_popupset">
+        <menupopup id="bill_history_actions" position="at_pointer">
+            <menuitem label="&staff.patron.bill_interface.print_selected.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;" oncommand="print_bills(true);"/>
+        </menupopup>
+    </popupset>
 
 </window>