2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Patron Display -->
5 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
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"?>
11 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
13 <!DOCTYPE window SYSTEM "chrome://evergreen/locale/lang.dtd">
15 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
17 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
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">
24 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
26 <script type="text/javascript">var myPackageDir = 'evergreen'; var IAMXUL = true; var g = {};</script>
27 <scripts id="openils_util_scripts"/>
29 <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
34 function patron_bill_init() {
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'});
46 g.session = g.cgi.param('session');
47 g.patron_id = g.cgi.param('patron_id');
49 JSAN.use('patron.util');
50 g.au_obj = patron.util.retrieve_au_via_id( g.session, g.patron_id );
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() );
58 var err_msg = "!! This software has encountered an error. Please tell your friendly " +
59 "system administrator or software developer the following:\n"
60 + 'patron/bill_wizard.xul\n' + E + '\n';
61 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
67 function patron_bill_finish() {
69 var grocery = new mg();
71 grocery.billing_location( g.OpenILS.data.list.au[0].home_ou() );
72 grocery.usr( g.au_obj.id() );
73 grocery.note( document.getElementById('bill_note').value );
74 JSAN.use('util.network'); var net = new util.network();
75 var mg_id = net.request(
77 api.fm_mg_create.method,
78 [ g.session, grocery ]
81 var billing = new mb();
83 billing.note( document.getElementById('bill_note').value );
84 billing.xact( mg_id );
85 billing.amount( document.getElementById('bill_amount').value );
86 billing.billing_type( document.getElementById('billing_type').value );
87 var mb_id = net.request(
89 api.fm_mb_create.method,
90 [ g.session, billing ]
94 throw('mb_id = ' + mb_id);
97 throw('mg_id = ' + mg_id);
100 g.error.sdump('D_ERROR',js2JSON(E));
110 <caption label="Bill Patron"/>
111 <label id="patron_name"/>
113 <columns> <column flex="0" /> <column flex="0" /> </columns>
114 <rows id="page1_rows">
115 <row><label value="Location"/><textbox id="billing_location" disabled="true" /></row>
116 <row><label value="Transaction Type"/>
117 <menulist id="xact_type">
119 <menuitem label="Grocery" value="grocery" selected="true"/>
123 <row><label value="Billing Type"/>
124 <menulist id="billing_type">
126 <menuitem value="Miscellaneous" label="Miscellaneous" />
127 <menuitem value="Overdue materials" label="Overdue materials" />
128 <menuitem value="Fee for placing a hold" label="Fee for placing a hold" />
129 <menuitem value="Fee for checking out a book" label="Fee for checking out a book" />
130 <menuitem value="Fee for library card" label="Fee for library card" />
131 <menuitem value="Miscellaneous charges" label="Miscellaneous charges" />
132 <menuitem value="Lost materials" label="Lost materials" />
133 <menuitem value="Damaged material" label="Damaged material" />
134 <menuitem value="Overdue Reserves charge" label="Overdue Reserves charge" />
135 <menuitem value="Recall overdue" label="Recall overdue" />
136 <menuitem value="Fee for processing lost library materials" label="Fee for processing lost library materials" />
137 <menuitem value="Fee for sending patron bills to collection agency" label="Fee for sending patron bills to collection agency" />
138 <menuitem value="Fee for interlibrary loan" label="Fee for interlibrary loan" />
139 <menuitem value="Fee for copies" label="Fee for copies" />
140 <menuitem value="Money advanced to pay for telephone use" label="Money advanced to pay for telephone use" />
141 <menuitem value="Deposit fee" label="Deposit fee" />
142 <menuitem value="Fee for disk" label="Fee for disk" />
143 <menuitem value="Fee for faxing" label="Fee for faxing" />
144 <menuitem value="Fee for laminating" label="Fee for laminating" />
145 <menuitem value="Fee for room cleaning" label="Fee for room cleaning" />
146 <menuitem value="Deposit returned; fee refund" label="Deposit returned; fee refund" />
147 <menuitem value="Sale items" label="Sale items" />
148 <menuitem value="Fee for lost card" label="Fee for lost card" />
149 <menuitem value="Long overdue items" label="Long overdue items" />
150 <menuitem value="Lost/Replacement Cassette" label="Lost/Replacement Cassette" />
151 <menuitem value="Returned Check" label="Returned Check" />
155 <row><label value="Amount"/><textbox id="bill_amount" /></row>
156 <row><label value="Note"/><textbox id="bill_note" multiline="true" rows="5" /></row>
161 <button label="Cancel" oncommand="window.close()" accesskey="C"/>
162 <button label="Submit this Bill" oncommand="patron_bill_finish(); window.close();" accesskey="S"/>