Add Billing in other interfaces
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 12 Jul 2006 22:35:23 +0000 (22:35 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 12 Jul 2006 22:35:23 +0000 (22:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4964 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/circ/circ_brief.xul
Open-ILS/xul/staff_client/server/patron/items.js
Open-ILS/xul/staff_client/server/patron/items.xul
Open-ILS/xul/staff_client/server/patron/items_overlay.xul

index 2be20c2..0c3892a 100644 (file)
@@ -44,7 +44,7 @@
                                g.error.sdump('D_TRACE','my_init() for circ_circ_brief.xul');
 
                                g.cgi = new CGI();
-                               var circ_id = g.cgi.param('circ_id');
+                               g.circ_id = g.cgi.param('circ_id');
 
                                JSAN.use('util.network'); g.network = new util.network();
                                JSAN.use('util.date');
@@ -53,7 +53,7 @@
                                g.network.request(
                                        api.FM_CIRC_RETRIEVE_VIA_ID.app,
                                        api.FM_CIRC_RETRIEVE_VIA_ID.method,
-                                       [ ses(), circ_id ],
+                                       [ ses(), g.circ_id ],
                                        function (req) {
                                                try {
                                                var r_circ = req.getResultObject();
@@ -73,6 +73,7 @@
                                                } catch(E) {
                                                        g.error.standard_unexpected_error_alert('Failure rendering circ.',E);
                                                }
+                                               g.patron_id = r_circ.usr(); $('add_billing').disabled = false;
                                                g.network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ ses(), r_circ.usr() ], function(preq) {
                                                        var r_au = preq.getResultObject();
                                                        $('barcode').value = r_au.card().barcode();
 
                function $(id) { return document.getElementById(id); }
 
+               g.add_billing = function() {
+                       JSAN.use('util.window');
+                       var win = new util.window();
+                       var w = win.open(
+                               urls.XUL_PATRON_BILL_WIZARD
+                                       + '?patron_id=' + window.escape(g.patron_id)
+                                       + '&xact_id=' + window.escape( g.circ_id ),
+                               'billwizard',
+                               'chrome,resizable,modal'
+                       );
+               }
+
        ]]>
        </script>
 
        <groupbox flex="1" style="overflow: auto;">
                <hbox>
                        <label id="patron_name" class="patronNameLarge"/>
-                       <spacer flex="1"/>
                        <textbox id="barcode" class="plain" readonly="true" onclick="this.select()"/>
+                       <spacer flex="1"/>
+                       <button id="add_billing" disabled="true" label="Add Billing" oncommand="g.add_billing();"/>
                </hbox>
                <grid flex="1">
                        <columns>
index d04e5b8..50a3bab 100644 (file)
@@ -308,6 +308,24 @@ patron.items.prototype = {
                                                        }
                                                }
                                        ],
+                                       'cmd_add_billing' : [
+                                               ['command'],
+                                               function() {
+                                                       JSAN.use('util.window');
+                                                       var win = new util.window();
+                                                       for (var i = 0; i < obj.retrieve_ids.length; i++) {
+                                                               var circ_id = obj.retrieve_ids[i].circ_id;
+                                                               var w = win.open(
+                                                                       urls.XUL_PATRON_BILL_WIZARD
+                                                                               + '?patron_id=' + window.escape(obj.patron_id)
+                                                                               + '&xact_id=' + window.escape( circ_id ),
+                                                                       'billwizard',
+                                                                       'chrome,resizable,modal'
+                                                               );
+                                                       }
+                                                       obj.retrieve();
+                                               }
+                                       ],
                                }
                        }
                );
index 10f02e5..b82687c 100644 (file)
@@ -72,6 +72,7 @@
                <command id="cmd_items_mark_lost" />
                <command id="cmd_show_catalog" />
                <command id="cmd_show_catalog2" />
+               <command id="cmd_add_billing" />
        </commandset>
 
        <popupset id="items_popupset"/>
index 0c36d46..5b267e1 100644 (file)
@@ -17,6 +17,7 @@
                <menuitem label="Mark Claimed Returned" command="cmd_items_claimed_returned" />
                <menuitem label="Renew" command="cmd_items_renew" />
                <menuitem label="Check In" command="cmd_items_checkin" />
+               <menuitem label="Add Billing" command="cmd_add_billing" />
        </popup>
        <popup id="items_actions2" position="at_pointer"> 
                <menuitem label="Show in Catalog" command="cmd_show_catalog2" />
@@ -58,6 +59,7 @@
                                <menuitem label="Mark Claimed Returned" command="cmd_items_claimed_returned" />
                                <menuitem label="Renew" command="cmd_items_renew" />
                                <menuitem label="Check In" command="cmd_items_checkin" />
+                               <menuitem label="Add Billing" command="cmd_add_billing" />
                        </menupopup>
                </menu>
        </menubar>