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