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