4 [% USE AuthorisedValues %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Patrons › Collect fine payment for [% patron.firstname %] [% patron.surname %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 <body id="pat_paycollect" class="pat">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'patron-search.inc' %]
15 <div id="breadcrumbs">
16 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
17 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> ›
18 <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Pay fines for [% patron.firstname %] [% patron.surname %]</a> ›
19 [% IF ( pay_individual ) %]Pay an individual fine
20 [% ELSIF ( writeoff_individual ) %]Write off an individual fine
22 [% IF ( selected_accts ) %]
23 [% IF type == 'writeoff' %]Write off an amount toward selected fines
24 [% ELSE %]Pay an amount toward selected fines
26 [% ELSE %]Pay an amount toward all fines
31 <div id="doc3" class="yui-t2">
36 [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
39 <!-- The manual invoice and credit buttons -->
40 <div class="statictabs">
43 <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Account</a>
46 <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]" >Pay fines</a>
49 <a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual invoice</a>
52 <a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual credit</a>
55 <div class="tabs-container">
56 [% IF ( error_over ) %]
57 <div id="error_message" class="dialog alert">
58 You must pay a value less than or equal to [% total_due | format('%.2f') %].
62 [% IF ( pay_individual ) %]
63 <form name="payindivfine" id="payindivfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
64 <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
65 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
66 <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" />
67 <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" />
68 <input type="hidden" name="description" id="description" value="[% description %]" />
69 <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" />
70 <input type="hidden" name="amount" id="amount" value="[% amount %]" />
71 <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" />
72 <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" />
73 <input type="hidden" name="title" id="title" value="[% title %]" />
75 <fieldset class="rows">
76 <legend>Pay an individual fine</legend>
77 <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note %]" />
83 <th>Amount outstanding</th>
86 <td colspan="3">Total amount payable:</td><td>[% amountoutstanding | format('%.2f') %]</td>
90 [% individual_description %]
92 <td>[% accounttype %]</td>
93 <td class="debit">[% amount | format('%.2f') %]</td>
94 <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
101 <label for="paid">Collect from patron: </label>
102 <!-- default to paying all -->
103 <input name="paid" id="paid" value="[% amountoutstanding %]" />
105 [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
106 [% IF payment_types %]
108 <label for="payment_type">Payment type: </label>
109 <select name="payment_type" id="payment_type">
110 <option value=""></option>
111 [% FOREACH pt IN payment_types %]
112 <option value="[% pt.authorised_value %]">[% pt.lib %]</option>
120 <div class="action"><input type="submit" name="submitbutton" value="Confirm" />
121 <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></div>
123 [% ELSIF ( writeoff_individual ) %]
124 <form name="woindivfine" id="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" >
125 <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
126 <fieldset class="rows">
127 <legend>Write off an individual fine</legend>
128 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
129 <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" />
130 <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" />
131 <input type="hidden" name="description" id="description" value="[% description %]" />
132 <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" />
133 <input type="hidden" name="amount" id="amount" value="[% amount %]" />
134 <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" />
135 <input type="hidden" name="title" id="title" value="[% title %]" />
136 <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note %]" />
137 <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" />
138 <input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" />
142 <th>Account type</th>
144 <th>Amount outstanding</th>
146 <tfoot><td colspan="3">Total amount outstanding:</td><td>[% amountoutstanding | format('%.2f') %]</td></tfoot>
148 <td>[% description %] [% title %]</td>
149 <td>[% accounttype %]</td>
150 <td class="debit">[% amount | format('%.2f') %]</td>
151 <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
157 <label for="paid">Writeoff amount: </label>
158 <!-- default to writing off all -->
159 <input name="amountwrittenoff" id="amountwrittenoff" value="[% amountoutstanding | $Price on_editing => 1 %]" />
164 <input type="submit" value="Write off this charge" />
165 <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a>
170 <form name="payfine" id="payfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
171 <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
172 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
173 <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts %]" />
174 <input type="hidden" name="total" id="total" value="[% total %]" />
175 <input type="hidden" name="type" value="[% type %]" />
177 <fieldset class="rows">
178 [% IF ( selected_accts ) %]
179 [% IF type == 'writeoff' %]
180 <legend>Write off an amount toward selected fines</legend>
182 <legend>Pay an amount toward selected fines</legend>
185 <legend>Pay an amount toward all fines</legend>
190 <span class="label">Total amount outstanding: </span>
191 <span class="debit">[% total | format('%.2f') %]</span>
194 [% IF type == 'writeoff' %]
195 <label for="paid">Writeoff amount: </label>
197 <label for="paid">Collect from patron: </label>
199 <!-- default to paying all -->
200 <input name="paid" id="paid" value="[% total | format('%.2f') %]" />
202 [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
203 [% IF payment_types %]
205 <label for="payment_type">Payment type: </label>
206 <select name="payment_type" id="payment_type">
207 <option value=""></option>
208 [% FOREACH pt IN payment_types %]
209 <option value="[% pt.authorised_value %]">[% pt.lib %]</option>
215 <label for="selected_accts_notes">Note: </label>
216 <textarea name="selected_accts_notes" id="selected_accts_notes">[% selected_accts_notes %]</textarea>
221 <input type="submit" name="submitbutton" value="Confirm" />
222 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a>
231 [% INCLUDE 'circ-menu.inc' %]
235 [% MACRO jsinclude BLOCK %]
236 [% INCLUDE 'str/members-menu.inc' %]
237 [% Asset.js("js/members-menu.js") %]
238 <script type= "text/javascript">
239 $(document).ready(function() {
240 $('#payindivfine, #payfine').preventDoubleFormSubmit();
241 $("#paid").on("change",function(){
247 $('#woindivfine').on('submit', function(e){
248 if ( prevent_default ) {
251 let amount_outstanding = parseFloat( $('#amountoutstanding').attr('value') );
252 let amount_writeoff = parseFloat( $('#amountwrittenoff').attr('value') );
253 if ( amount_writeoff > amount_outstanding ) {
254 alert(_("You are attemping to writeoff more than the value of the fee."));
255 $('#woindivfine').beenSubmitted = false;
258 $('#woindivfine').preventDoubleFormSubmit();
259 $('#woindivfine').submit();
264 function moneyFormat(textObj) {
265 var newValue = textObj.value;
271 for(i=0; i < newValue.length; i++) {
272 aChar = newValue.substring(i, i+1);
273 if (aChar >= "0" && aChar <= "9") {
275 decAmount = "" + decAmount + aChar;
278 dolAmount = "" + dolAmount + aChar;
290 if (dolAmount == "") {
294 if (dolAmount.length > 1) {
295 while(dolAmount.length > 1 && dolAmount.substring(0,1) == "0") {
296 dolAmount = dolAmount.substring(1,dolAmount.length);
299 if (decAmount.length > 2) {
300 decAmount = decAmount.substring(0,2);
303 if (decAmount.length == 1) {
304 decAmount = decAmount + "0";
306 if (decAmount.length == 0) {
307 decAmount = decAmount + "00";
310 textObj.value = dolAmount + "." + decAmount;
315 [% INCLUDE 'intranet-bottom.inc' %]