]> git.evergreen-ils.org Git - Evergreen.git/blob - Evergreen/staff_client/chrome/content/evergreen/patron/patron_bill_wizard.xul
first cut and bill details
[Evergreen.git] / Evergreen / staff_client / chrome / content / evergreen / patron / patron_bill_wizard.xul
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
3 <!-- This DTD declaration needs to be fixed for Mozilla locales -->
4 <!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/patron.dtd">
5 <wizard id="patron_bill" title="Bill Patron Wizard"
6         orient="vertical" style="overflow: auto"
7         onload="patron_bill_init()" width="800" height="600"
8         onwizardfinish="patron_bill_finish()"
9         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
10
11         <!-- Overlays for this XUL file -->
12         <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
13         <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
14
15         <!-- OpenSRF -->
16         <script>var myPackageDir = "evergreen";</script>
17         <OpenSRF id="OpenSRF_js" />
18         <script src="patron_utils.js" />
19
20         <script>
21         <![CDATA[
22
23                 function patron_bill_init() {
24                         document.getElementById('patron_name').setAttribute('value',
25                                 patron_get_full_name(params.patron) + ' : ' + patron_get_barcode(params.patron) );
26                         document.getElementById('billing_location').setAttribute('value',
27                                 mw.G.user_ou.name() );
28                 }
29
30                 function patron_bill_finish() {
31                         try {
32                                 var grocery = new mg();
33                                         grocery.isnew('1');
34                                         grocery.billing_location( mw.G.user_ou.id() );
35                                         grocery.usr( params.patron.id() );
36                                         grocery.note( document.getElementById('bill_note').value );
37                                 var mg_id = user_request(
38                                         'open-ils.circ',
39                                         'open-ils.circ.money.grocery.create',
40                                         [ mw.G.auth_ses[0], grocery ]
41                                 )[0];
42                                 if (mg_id) {
43                                         var billing = new mb();
44                                                 billing.isnew('1');
45                                                 billing.note( document.getElementById('bill_note').value );
46                                                 billing.xact( mg_id );
47                                                 billing.amount( document.getElementById('bill_amount').value );
48                                                 billing.billing_type( document.getElementById('billing_type').value );
49                                         var mb_id = user_request(
50                                                 'open-ils.circ',
51                                                 'open-ils.circ.money.billing.create',
52                                                 [ mw.G.auth_ses[0], billing ]
53                                         )[0];
54                                         if (mb_id) {
55                                         } else {
56                                                 throw('mb_id = ' + mb_id);
57                                         }
58                                 } else {
59                                         throw('mg_id = ' + mg_id);
60                                 }
61                         } catch(E) {
62                                 handle_error(E);
63                         }
64                 }
65
66         ]]>
67         </script>
68
69
70         <wizardpage id="page1" description="Billing Patron" onpageadvanced="">
71                 <label id="patron_name"/>
72                 <grid>
73                         <columns> <column flex="0" /> <column flex="0" /> </columns>
74                         <rows id="page1_rows">
75                                 <row><label value="Location"/><textbox id="billing_location" disabled="true" /></row>
76                                 <row><label value="Transaction Type"/>
77                                         <menulist id="xact_type">
78                                                 <menupopup>
79                                                         <menuitem label="Grocery" value="grocery" selected="true"/>
80                                                 </menupopup>
81                                         </menulist>
82                                 </row>
83                                 <row><label value="Billing Type"/>
84                                         <menulist id="billing_type">
85                                                 <menupopup>
86                                                         <menuitem value="Miscellaneous" label="Miscellaneous" />
87                                                         <menuitem value="Overdue materials" label="Overdue materials" />
88                                                         <menuitem value="Fee for placing a hold" label="Fee for placing a hold" />
89                                                         <menuitem value="Fee for checking out a book" label="Fee for checking out a book" />
90                                                         <menuitem value="Fee for library card" label="Fee for library card" />
91                                                         <menuitem value="Miscellaneous charges" label="Miscellaneous charges" />
92                                                         <menuitem value="Lost materials" label="Lost materials" />
93                                                         <menuitem value="Damaged material" label="Damaged material" />
94                                                         <menuitem value="Overdue Reserves charge" label="Overdue Reserves charge" />
95                                                         <menuitem value="Recall overdue" label="Recall overdue" />
96                                                         <menuitem value="Fee for processing lost library materials" label="Fee for processing lost library materials" />
97                                                         <menuitem value="Fee for sending patron bills to collection agency" label="Fee for sending patron bills to collection agency" />
98                                                         <menuitem value="Fee for interlibrary loan" label="Fee for interlibrary loan" />
99                                                         <menuitem value="Fee for copies" label="Fee for copies" />
100                                                         <menuitem value="Money advanced to pay for telephone use" label="Money advanced to pay for telephone use" />
101                                                         <menuitem value="Deposit fee" label="Deposit fee" />
102                                                         <menuitem value="Fee for disk" label="Fee for disk" />
103                                                         <menuitem value="Fee for faxing" label="Fee for faxing" />
104                                                         <menuitem value="Fee for laminating" label="Fee for laminating" />
105                                                         <menuitem value="Fee for room cleaning" label="Fee for room cleaning" />
106                                                         <menuitem value="Deposit returned; fee refund" label="Deposit returned; fee refund" />
107                                                         <menuitem value="Sale items" label="Sale items" />
108                                                         <menuitem value="Fee for lost card" label="Fee for lost card" />
109                                                         <menuitem value="Long overdue items" label="Long overdue items" />
110                                                         <menuitem value="Lost/Replacement Cassette" label="Lost/Replacement Cassette" />
111                                                         <menuitem value="Returned Check" label="Returned Check" />
112                                                 </menupopup>
113                                         </menulist>
114                                 </row>
115                                 <row><label value="Amount"/><textbox id="bill_amount" /></row>
116                                 <row><label value="Note"/><textbox id="bill_note" multiline="true" rows="5" /></row>
117                         </rows>
118                 </grid>
119         </wizardpage>
120
121 </wizard>
122
123