first cut and bill details
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Nov 2005 17:04:13 +0000 (17:04 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Nov 2005 17:04:13 +0000 (17:04 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2074 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/patron/patron_bill_details.xul [new file with mode: 0644]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_billings.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_bills.js
Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js

diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bill_details.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bill_details.xul
new file mode 100644 (file)
index 0000000..5923460
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+
+<!-- Stylesheets -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
+
+<!DOCTYPE window SYSTEM "chrome://evergreen/locale/patron.dtd">
+<window id="patron_bill_details" 
+       onload="try { my_init(); } catch(E) { alert(E); }"
+       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+       <!-- Overlays for this XUL file -->
+       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
+       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
+
+       <!-- OpenSRF -->
+       <script>var myPackageDir = "evergreen";</script>
+       <OpenSRF id="OpenSRF_js" />
+       <script src="patron_utils.js" />
+
+       <script>
+       <![CDATA[
+
+               function my_init() {
+                       try {
+
+                               var mb_list = user_request(
+                                       'open-ils.circ',
+                                       'open-ils.circ.money.billing.retrieve.all',
+                                       [ mw.G.auth_ses[0], params.mbts.id() ]
+                               )[0];
+
+                               var rows = document.getElementById('g_rows');
+                               for (var i = 0; i < mb_list.length; i++) {
+
+                                       var row = document.createElement('row');
+                                       rows.appendChild(row);
+
+                                               var c1 = document.createElement('label');
+                                               row.appendChild(c1);
+                                               c1.setAttribute('value', yesno( mb_list[0].voided() ));
+
+                                               var c2 = document.createElement('label');
+                                               row.appendChild(c2);
+                                               c2.setAttribute('value', formatted_date( mb_list[0].billing_ts(),'%F' ));
+
+                                               var c3 = document.createElement('label');
+                                               row.appendChild(c3);
+                                               c3.setAttribute('value', mb_list[0].billing_type());
+
+                                               var c4 = document.createElement('label');
+                                               row.appendChild(c4);
+                                               c4.setAttribute('value', mb_list[0].amount());
+
+                                               var c5 = document.createElement('label');
+                                               row.appendChild(c5);
+                                               c5.setAttribute('value', mb_list[0].note());
+                               }
+
+                       } catch(E) {
+                               handle_error(E);
+                       }
+               }
+
+       ]]>
+       </script>
+
+       <vbox flex="1" class="my_overflow">
+               <groupbox orient="vertical" flex="1">
+                       <caption label="Full Details"/>
+                       <grid>
+                               <columns> <column /> <column /> <column /> <column /> </columns>
+                               <rows id="g_rows">
+                                       <row><label value="Voided" /><label value="When"/><label value="Type" /><label value="Amount" /><label value="Note"/></row>
+                               </rows>
+                       </grid>
+               </groupbox>
+       </vbox>
+
+</window>
+
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_billings.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_billings.xul
deleted file mode 100644 (file)
index 88f26b8..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/patron.dtd">
-<window id="fm_view_win" 
-       onload="try { my_init(); } catch(E) { alert(E); }"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>
-       <![CDATA[
-
-               function my_init() {
-               }
-
-       ]]>
-       </script>
-
-       <vbox flex="1" class="my_overflow">
-               <groupbox orient="vertical" flex="1">
-                       <caption label="Specific Billings"/>
-               </groupbox>
-       </vbox>
-
-</window>
-
index fe285e4..ccdb4dc 100644 (file)
@@ -384,7 +384,18 @@ function patron_bills_add_patron_bills(p, bills) {
                        var btn = p.w.document.createElement('button');
                                vbox.appendChild( btn );
                                btn.setAttribute( 'label', 'Full Details' );
-                               btn.setAttribute( 'bill_id', mbts.id() );
+                               btn.setAttribute( 'name', 'full_details' );
+                               btn.setAttribute( 'mbts_id', mbts.id() );       
+                               btn.addEventListener(
+                                       'command',
+                                       function(ev) {
+                                               spawn_patron_bill_details(
+                                                       p.w.document, 'new_window', '', { 'mbts' : mbts }
+                                               );
+                                       },
+                                       false
+                               );
+
                return vbox;
        }
 
index e1cb8c1..4303c8d 100644 (file)
@@ -155,6 +155,11 @@ function spawn_patron_bill_wizard(d,placement,place,passthru_params,clone) {
        return spawn_interface(d,placement,place,chrome,getString('bills_wizard_label'),passthru_params,clone);
 }
 
+function spawn_patron_bill_details(d,placement,place,passthru_params,clone) {
+       var chrome = 'chrome://evergreen/content/patron/patron_bill_details.xul';
+       return spawn_interface(d,placement,place,chrome,getString('bill_details_label'),passthru_params,clone);
+}
+
 function spawn_copy_browser(d,placement,place,passthru_params,clone) {
        var chrome = 'chrome://evergreen/content/cat/browse_list.xul';
        return spawn_interface(d,placement,place,chrome,getString('copy_browser_interface_label'),passthru_params,clone);