2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Patron Display -->
5 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
7 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
8 <?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
9 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
10 <?xml-stylesheet href="/xul/server/skin/patron_display.css" type="text/css"?>
12 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
14 <!DOCTYPE window PUBLIC "" ""[
15 <!--#include virtual="/opac/locale/en-US/lang.dtd"-->
18 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
20 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
21 <?xul-overlay href="/xul/server/patron/bill_summary_overlay.xul"?>
23 <window id="patron_bill" title="Bill Patron Wizard"
24 orient="vertical" style="overflow: auto"
25 onload="patron_bill_init()" width="700" height="550"
26 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
28 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
30 <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};</script>
31 <scripts id="openils_util_scripts"/>
33 <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
38 function $(id) { return document.getElementById(id); }
40 function retrieve_mbts() {
41 g.network.simple_request('FM_MBTS_RETRIEVE',[ses(),g.mbts_id],
44 g.mbts = req.getResultObject();
45 $('mbts_id').value = g.mbts.id();
46 $('mbts_xact_type').value = g.mbts.xact_type();
47 $('mbts_xact_start').value = g.mbts.xact_start().toString().substr(0,19);
48 $('mbts_xact_finish').value = g.mbts.xact_finish() ? g.mbts.xact_finish().toString().substr(0,19) : '';
49 $('mbts_total_owed').value = g.mbts.total_owed() ? util.money.sanitize( g.mbts.total_owed() ) : '';
50 $('mbts_total_paid').value = g.mbts.total_paid() ? util.money.sanitize( g.mbts.total_paid() ) : '';
51 $('mbts_balance_owed').value = g.mbts.balance_owed() ? util.money.sanitize( g.mbts.balance_owed() ) : '';
52 $('xact_type').value = g.mbts.xact_type(); $('xact_type').disabled = true;
54 g.error.sdump('D_ERROR',E);
60 function retrieve_circ() {
61 JSAN.use('util.widgets');
62 g.network.simple_request('FM_CIRC_RETRIEVE_VIA_ID', [ ses(), g.mbts_id ],
64 var r_circ = req.getResultObject();
65 if (instanceOf(r_circ,circ)) {
67 $('title_label').hidden = false;
68 $('checked_out_label').hidden = false;
69 $('due_label').hidden = false;
70 $('checked_in_label').hidden = false;
71 $('checked_out').value = r_circ.xact_start() ? r_circ.xact_start().toString().substr(0,10) : '';
72 $('checked_in').value = r_circ.checkin_time() ? r_circ.checkin_time().toString().substr(0,10) : '';
73 $('due').value = r_circ.due_date() ? r_circ.due_date().toString().substr(0,10) : '';
75 g.network.simple_request(
76 'MODS_SLIM_RECORD_RETRIEVE_VIA_COPY',
77 [ r_circ.target_copy() ],
79 var r_mvr = rreq.getResultObject();
80 if (instanceOf(r_mvr,mvr)) {
81 util.widgets.remove_children('title');
82 $('title').appendChild( document.createTextNode( r_mvr.title() ) );
84 g.network.simple_request(
86 [ r_circ.target_copy() ],
88 var r_acp = rrreq.getResultObject();
89 if (instanceOf(r_acp,acp)) {
90 util.widgets.remove_children('title');
91 $('title').appendChild( document.createTextNode( r_acp.dummy_title() ) );
104 function retrieve_patron() {
105 g.patron_id = g.cgi.param('patron_id');
108 JSAN.use('patron.util');
109 g.au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), g.patron_id );
111 $('patron_name').setAttribute('value', g.au_obj.family_name() + ', ' + g.au_obj.first_given_name() + ' : ' + g.au_obj.card().barcode() );
116 function patron_bill_init() {
118 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
119 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
120 JSAN.errorLevel = "die"; // none, warn, or die
121 JSAN.addRepository('/xul/server/');
122 JSAN.use('util.error'); g.error = new util.error();
123 g.error.sdump('D_TRACE','my_init() for patron_display.xul');
124 g.OpenILS = {}; JSAN.use('OpenILS.data'); g.OpenILS.data = new OpenILS.data();
125 g.OpenILS.data.init({'via':'stash'});
126 JSAN.use('util.network'); g.network = new util.network();
127 JSAN.use('util.date');
128 JSAN.use('util.money');
134 $('billing_location').setAttribute('value', g.OpenILS.data.hash.aou[ g.OpenILS.data.list.au[0].ws_ou() ].name() );
136 $('bill_amount').focus();
138 if (g.cgi.param('xact_id')) {
139 g.mbts_id = g.cgi.param('xact_id');
140 $('summary').hidden = false;
146 var err_msg = "!! This software has encountered an error. Please tell your friendly " +
147 "system administrator or software developer the following:\n"
148 + 'patron/bill_wizard.xul\n' + E + '\n';
149 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
155 function patron_bill_finish() {
157 var xact_id = g.cgi.param('xact_id');
159 var grocery = new mg();
161 grocery.billing_location( g.OpenILS.data.list.au[0].ws_ou() );
162 grocery.usr( g.au_obj.id() );
163 grocery.note( $('bill_note').value );
164 xact_id = g.network.request(
165 api.FM_MG_CREATE.app,
166 api.FM_MG_CREATE.method,
171 var billing = new mb();
173 billing.note( $('bill_note').value );
174 billing.xact( xact_id );
175 billing.amount( $('bill_amount').value );
176 billing.billing_type( $('billing_type').value );
177 var mb_id = g.network.request(
178 api.FM_MB_CREATE.app,
179 api.FM_MB_CREATE.method,
184 throw('mb_id = ' + mb_id);
187 throw('xact_id = ' + xact_id);
190 g.error.sdump('D_ERROR',js2JSON(E));
200 <label id="patron_name" class="patronNameLarge"/>
202 <groupbox orient="vertical" flex="1" id="summary" hidden="true"/>
205 <caption label="Create Bill"/>
207 <columns> <column flex="0" /> <column flex="0" /> </columns>
208 <rows id="page1_rows">
209 <row><label value="Location"/><textbox id="billing_location" disabled="true" /></row>
210 <row><label value="Transaction Type"/>
211 <menulist id="xact_type">
213 <menuitem label="Grocery" value="grocery" selected="true"/>
214 <menuitem label="Circulation" value="circulation" disabled="true"/>
218 <row><label value="Billing Type"/>
219 <menulist id="billing_type">
221 <menuitem value="Miscellaneous" label="Miscellaneous" />
222 <menuitem value="Overdue materials" label="Overdue materials" />
223 <menuitem value="Fee for placing a hold" label="Fee for placing a hold" />
224 <menuitem value="Fee for checking out a book" label="Fee for checking out a book" />
225 <menuitem value="Fee for library card" label="Fee for library card" />
226 <menuitem value="Miscellaneous charges" label="Miscellaneous charges" />
227 <menuitem value="Lost materials" label="Lost materials" />
228 <menuitem value="Damaged material" label="Damaged material" />
229 <menuitem value="Overdue Reserves charge" label="Overdue Reserves charge" />
230 <menuitem value="Recall overdue" label="Recall overdue" />
231 <menuitem value="Fee for processing lost library materials" label="Fee for processing lost library materials" />
232 <menuitem value="Fee for sending patron bills to collection agency" label="Fee for sending patron bills to collection agency" />
233 <menuitem value="Fee for interlibrary loan" label="Fee for interlibrary loan" />
234 <menuitem value="Fee for copies" label="Fee for copies" />
235 <menuitem value="Money advanced to pay for telephone use" label="Money advanced to pay for telephone use" />
236 <menuitem value="Deposit fee" label="Deposit fee" />
237 <menuitem value="Fee for disk" label="Fee for disk" />
238 <menuitem value="Fee for faxing" label="Fee for faxing" />
239 <menuitem value="Fee for laminating" label="Fee for laminating" />
240 <menuitem value="Fee for room cleaning" label="Fee for room cleaning" />
241 <menuitem value="Deposit returned; fee refund" label="Deposit returned; fee refund" />
242 <menuitem value="Sale items" label="Sale items" />
243 <menuitem value="Fee for lost card" label="Fee for lost card" />
244 <menuitem value="Long overdue items" label="Long overdue items" />
245 <menuitem value="Lost/Replacement Cassette" label="Lost/Replacement Cassette" />
246 <menuitem value="Returned Check" label="Returned Check" />
250 <row><label value="Amount"/><textbox id="bill_amount" /></row>
251 <row><label value="Note"/><textbox id="bill_note" multiline="true" rows="5" /></row>
257 <button label="Cancel" oncommand="window.close()" accesskey="C"/>
258 <button label="Submit this Bill" oncommand="patron_bill_finish(); window.close();" accesskey="S"/>