ba182153fb9b0baa21541a770fd16563d4b57534
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / paycollect.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Patrons &rsaquo; Collect Fine Payment for  [% borrower.firstname %] [% borrower.surname %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type= "text/javascript">
5 //<![CDATA[
6 function moneyFormat(textObj) {
7     var newValue = textObj.value;
8     var decAmount = "";
9     var dolAmount = "";
10     var decFlag   = false;
11     var aChar     = "";
12
13     for(i=0; i < newValue.length; i++) {
14         aChar = newValue.substring(i, i+1);
15         if (aChar >= "0" && aChar <= "9") {
16             if(decFlag) {
17                 decAmount = "" + decAmount + aChar;
18             }
19             else {
20                 dolAmount = "" + dolAmount + aChar;
21             }
22         }
23         if (aChar == ".") {
24             if (decFlag) {
25                 dolAmount = "";
26                 break;
27             }
28             decFlag = true;
29         }
30     }
31
32     if (dolAmount == "") {
33         dolAmount = "0";
34     }
35 // Strip leading 0s
36     if (dolAmount.length > 1) {
37         while(dolAmount.length > 1 && dolAmount.substring(0,1) == "0") {
38             dolAmount = dolAmount.substring(1,dolAmount.length);
39         }
40     }
41     if (decAmount.length > 2) {
42         decAmount = decAmount.substring(0,2);
43     }
44 // Pad right side
45     if (decAmount.length == 1) {
46        decAmount = decAmount + "0";
47     }
48     if (decAmount.length == 0) {
49        decAmount = decAmount + "00";
50     }
51
52     textObj.value = dolAmount + "." + decAmount;
53 }
54 //]]>
55 </script>
56 </head>
57 <body>
58 [% INCLUDE 'header.inc' %]
59 [% INCLUDE 'patron-search.inc' %]
60 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Pay Fines for [% borrower.firstname %] [% borrower.surname %]</div>
61
62 <div id="doc3" class="yui-t2">
63
64 <div id="bd">
65 <div id="yui-main">
66 <div class="yui-b">
67 [% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %]
68
69
70 <!-- The manual invoice and credit buttons -->
71 <div class="toptabs">
72 <ul class="ui-tabs-nav">
73     <li>
74     <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a>
75     </li>
76     <li class="ui-tabs-selected">
77     <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a>
78     </li>
79     <li>
80     <a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrower.borrowernumber %]" >Create Manual Invoice</a>
81     </li>
82     <li>
83     <a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create Manual Credit</a>
84     </li>
85 </ul>
86 <div class="tabs-container">
87 [% IF ( error ) %]
88     <div id="error_message" class="dialog alert">
89     [% error %]
90     </div>
91 [% END %]
92
93 [% IF ( pay_individual ) %]
94     <form name="payindivfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl">
95     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
96     <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" />
97     <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" />
98     <input type="hidden" name="description" id="description" value="[% description %]" />
99     <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" />
100     <input type="hidden" name="notify_id" id="notify_id" value="[% notify_id %]" />
101     <input type="hidden" name="notify_level" id="notify_level" value="[% notify_level %]" />
102     <input type="hidden" name="amount" id="amount" value="[% amount %]" />
103     <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" />
104     <input type="hidden" name="accountno" id="accountno" value="[% accountno %]" />
105     <input type="hidden" name="title" id="title" value="[% title %]" />
106     <table>
107     <tr>
108         <th>Description</th>
109         <th>Account Type</th>
110         <th>Notify id</th>
111         <th>Level</th>
112         <th>Amount</th>
113         <th>Amount Outstanding</th>
114     </tr>
115     <tr>
116         <td>
117             [% description %] [% title  %]
118         </td>
119         <td>[% accounttype %]</td>
120         <td>[% notify_id %]</td>
121         <td>[% notify_level %]</td>
122         <td class="debit">[% amount | format('%.2f') %]</td>
123         <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
124     </tr>
125     <tr>
126         <td>Total Amount Payable : </td>
127         <td>[% amountoutstanding | format('%.2f') %]</td>
128         <td colspan="4"></td>
129     </tr>
130     <tr><td colspan="6"> </td></tr>
131     <tr>
132         <td>Collect From Patron: </td>
133         <td>
134             <!-- default to paying all -->
135         <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" onchange="moneyFormat(document.payindivfine.paid)"/>
136         </td>
137     </tr>
138     <tr><td colspan="6"></td></tr>
139     <tr>
140         <td colspan="6">
141         <input type="submit" name="submitbutton" value="Confirm" />
142         <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
143         </td>
144     </tr>
145
146     </table>
147     </form>
148 [% ELSIF ( writeoff_individual ) %]
149     <form name="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" >
150     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
151     <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" />
152     <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" />
153     <input type="hidden" name="description" id="description" value="[% description %]" />
154     <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" />
155     <input type="hidden" name="notify_id" id="notify_id" value="[% notify_id %]" />
156     <input type="hidden" name="notify_level" id="notify_level" value="[% notify_level %]" />
157     <input type="hidden" name="amount" id="amount" value="[% amount %]" />
158     <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" />
159     <input type="hidden" name="accountno" id="accountno" value="[% accountno %]" />
160     <input type="hidden" name="title" id="title" value="[% title %]" />
161     <table>
162     <tr>
163         <th>Description</th>
164         <th>Account Type</th>
165         <th>Notify id</th>
166         <th>Level</th>
167         <th>Amount</th>
168         <th>Amount Outstanding</th>
169     </tr>
170     <tr>
171         <td>[% description %] [% title %]</td>
172         <td>[% accounttype %]</td>
173         <td>[% notify_id %]</td>
174         <td>[% notify_level %]</td>
175         <td class="debit">[% amount | format('%.2f') %]</td>
176         <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
177     </tr>
178     <tr><td colspan="6"> </td></tr>
179     <tr><td colspan="6"><strong>Writeoff This Charge?</strong></td></tr>
180     <tr><td> </td></tr>
181     <tr>
182         <td colspan="6">
183         <input type="submit" name="confirm_writeoff" id="confirm_writeoff" value="Confirm" />
184         <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
185         </td>
186     </tr>
187
188     </table>
189     </form>
190 [% ELSE %]
191
192     <form name="payfine" onsubmit="return validatePayment(this);" method="post" action="/cgi-bin/koha/members/paycollect.pl">
193     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
194     <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts %]" />
195     <input type="hidden" name="total" id="total" value="[% total %]" />
196
197     <table>
198     <tr>
199         <td>Total Amount Outstanding : </td>
200         <td class="debit">[% total | format('%.2f') %]</td>
201     </tr>
202     <tr><td colspan="2"> </td></tr>
203     <tr>
204         <td>Collect From Patron: </td>
205         <td>
206         <!-- default to paying all -->
207         <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="moneyFormat(document.payfine.paid)"/>
208         </td>
209     </tr>
210     <tr><td></td></tr>
211     <tr>
212         <td colspan="2">
213         <input type="submit" name="submitbutton" value="Confirm" />
214         <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
215         </td>
216     </tr>
217     </table>
218     </form>
219 [% END %]
220 </div></div>
221 </div>
222 </div>
223
224 <div class="yui-b">
225 [% INCLUDE 'circ-menu.tt' %]
226 </div>
227 </div>
228 [% INCLUDE 'intranet-bottom.inc' %]
229