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