]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/patron/bill_wizard.xul
upcase some constants
[Evergreen.git] / Open-ILS / xul / staff_client / server / patron / bill_wizard.xul
1 <?xml version="1.0"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Patron Display -->
4
5 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
6 <!-- STYLESHEETS -->
7 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
8 <?xml-stylesheet href="/xul/server/skin/evergreen.css" type="text/css"?>
9 <?xml-stylesheet href="/xul/server/skin/patron_display.css" type="text/css"?>
10
11 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
12 <!-- LOCALIZATION -->
13 <!DOCTYPE window SYSTEM "chrome://evergreen/locale/lang.dtd">
14
15 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
16 <!-- OVERLAYS -->
17 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
18
19 <window id="patron_bill" title="Bill Patron Wizard"
20         orient="vertical" style="overflow: auto"
21         onload="patron_bill_init()"
22         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
23
24         <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
25         <!-- BEHAVIOR -->
26         <script type="text/javascript">var myPackageDir = 'evergreen'; var IAMXUL = true; var g = {};</script>
27         <scripts id="openils_util_scripts"/>
28
29         <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
30
31         <script>
32         <![CDATA[
33
34                 function patron_bill_init() {
35                         try {
36                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
37                                 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
38                                 JSAN.errorLevel = "die"; // none, warn, or die
39                                 JSAN.addRepository('/xul/server/');
40                                 JSAN.use('util.error'); g.error = new util.error();
41                                 g.error.sdump('D_TRACE','my_init() for patron_display.xul');
42                                 g.OpenILS = {}; JSAN.use('OpenILS.data'); g.OpenILS.data = new OpenILS.data();
43                                 g.OpenILS.data.init({'via':'stash'});
44
45                                 g.cgi = new CGI();
46                                 g.session = g.cgi.param('session');
47                                 g.patron_id = g.cgi.param('patron_id');
48
49                                 JSAN.use('patron.util'); 
50                                 g.au_obj = patron.util.retrieve_au_via_id( g.session, g.patron_id );
51                                 
52                                 document.getElementById('patron_name').setAttribute('value',
53                                         g.au_obj.family_name() + ', ' + g.au_obj.first_given_name() + ' : ' + g.au_obj.card().barcode() );
54                                 document.getElementById('billing_location').setAttribute('value',
55                                         g.OpenILS.data.hash.aou[ g.OpenILS.data.list.au[0].home_ou() ].name() );
56
57                                 document.getElementById('bill_amount').focus();
58
59                         } catch(E) {
60                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
61                                         "system administrator or software developer the following:\n" 
62                                         + 'patron/bill_wizard.xul\n' + E + '\n';
63                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
64                                 alert(err_msg);
65                         }
66
67                 }
68
69                 function patron_bill_finish() {
70                         try {
71                                 var grocery = new mg();
72                                         grocery.isnew('1');
73                                         grocery.billing_location( g.OpenILS.data.list.au[0].home_ou() );
74                                         grocery.usr( g.au_obj.id() );
75                                         grocery.note( document.getElementById('bill_note').value );
76                                 JSAN.use('util.network'); var net = new util.network();
77                                 var mg_id = net.request(
78                                         api.FM_MG_CREATE.app,
79                                         api.FM_MG_CREATE.method,
80                                         [ g.session, grocery ]
81                                 );
82                                 if (mg_id) {
83                                         var billing = new mb();
84                                                 billing.isnew('1');
85                                                 billing.note( document.getElementById('bill_note').value );
86                                                 billing.xact( mg_id );
87                                                 billing.amount( document.getElementById('bill_amount').value );
88                                                 billing.billing_type( document.getElementById('billing_type').value );
89                                         var mb_id = net.request(
90                                                 api.FM_MB_CREATE.app,
91                                                 api.FM_MB_CREATE.method,
92                                                 [ g.session, billing ]
93                                         );
94                                         if (mb_id) {
95                                         } else {
96                                                 throw('mb_id = ' + mb_id);
97                                         }
98                                 } else {
99                                         throw('mg_id = ' + mg_id);
100                                 }
101                         } catch(E) {
102                                 g.error.sdump('D_ERROR',js2JSON(E));
103                                 alert(js2JSON(E));
104                         }
105                 }
106
107         ]]>
108         </script>
109
110
111         <groupbox>
112                 <caption label="Bill Patron"/>
113                 <label id="patron_name"/>
114                 <grid>
115                         <columns> <column flex="0" /> <column flex="0" /> </columns>
116                         <rows id="page1_rows">
117                                 <row><label value="Location"/><textbox id="billing_location" disabled="true" /></row>
118                                 <row><label value="Transaction Type"/>
119                                         <menulist id="xact_type">
120                                                 <menupopup>
121                                                         <menuitem label="Grocery" value="grocery" selected="true"/>
122                                                 </menupopup>
123                                         </menulist>
124                                 </row>
125                                 <row><label value="Billing Type"/>
126                                         <menulist id="billing_type">
127                                                 <menupopup>
128                                                         <menuitem value="Miscellaneous" label="Miscellaneous" />
129                                                         <menuitem value="Overdue materials" label="Overdue materials" />
130                                                         <menuitem value="Fee for placing a hold" label="Fee for placing a hold" />
131                                                         <menuitem value="Fee for checking out a book" label="Fee for checking out a book" />
132                                                         <menuitem value="Fee for library card" label="Fee for library card" />
133                                                         <menuitem value="Miscellaneous charges" label="Miscellaneous charges" />
134                                                         <menuitem value="Lost materials" label="Lost materials" />
135                                                         <menuitem value="Damaged material" label="Damaged material" />
136                                                         <menuitem value="Overdue Reserves charge" label="Overdue Reserves charge" />
137                                                         <menuitem value="Recall overdue" label="Recall overdue" />
138                                                         <menuitem value="Fee for processing lost library materials" label="Fee for processing lost library materials" />
139                                                         <menuitem value="Fee for sending patron bills to collection agency" label="Fee for sending patron bills to collection agency" />
140                                                         <menuitem value="Fee for interlibrary loan" label="Fee for interlibrary loan" />
141                                                         <menuitem value="Fee for copies" label="Fee for copies" />
142                                                         <menuitem value="Money advanced to pay for telephone use" label="Money advanced to pay for telephone use" />
143                                                         <menuitem value="Deposit fee" label="Deposit fee" />
144                                                         <menuitem value="Fee for disk" label="Fee for disk" />
145                                                         <menuitem value="Fee for faxing" label="Fee for faxing" />
146                                                         <menuitem value="Fee for laminating" label="Fee for laminating" />
147                                                         <menuitem value="Fee for room cleaning" label="Fee for room cleaning" />
148                                                         <menuitem value="Deposit returned; fee refund" label="Deposit returned; fee refund" />
149                                                         <menuitem value="Sale items" label="Sale items" />
150                                                         <menuitem value="Fee for lost card" label="Fee for lost card" />
151                                                         <menuitem value="Long overdue items" label="Long overdue items" />
152                                                         <menuitem value="Lost/Replacement Cassette" label="Lost/Replacement Cassette" />
153                                                         <menuitem value="Returned Check" label="Returned Check" />
154                                                 </menupopup>
155                                         </menulist>
156                                 </row>
157                                 <row><label value="Amount"/><textbox id="bill_amount" /></row>
158                                 <row><label value="Note"/><textbox id="bill_note" multiline="true" rows="5" /></row>
159                         </rows>
160                 </grid>
161                 <hbox>
162                         <spacer flex="1"/>
163                         <button label="Cancel" oncommand="window.close()" accesskey="C"/>
164                         <button label="Submit this Bill" oncommand="patron_bill_finish(); window.close();" accesskey="S"/>
165                 </hbox>
166         </groupbox>
167
168 </window>
169
170