5 [% USE AuthorisedValues %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha › Patrons › Collect fine payment for [% patron.firstname | html %] [% patron.surname | html %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
13 <body id="pat_paycollect" class="pat">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'patron-search.inc' %]
16 <div id="breadcrumbs">
17 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
18 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> ›
19 <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]">Pay fines for [% patron.firstname | html %] [% patron.surname | html %]</a> ›
20 [% IF ( pay_individual ) %]Pay an individual fine
21 [% ELSIF ( writeoff_individual ) %]Write off an individual fine
23 [% IF ( selected_accts ) %]
24 [% IF type == 'writeoff' %]Write off an amount toward selected fines
25 [% ELSE %]Pay an amount toward selected fines
27 [% ELSE %]Pay an amount toward all fines
32 <div id="doc3" class="yui-t2">
37 [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
40 <!-- The manual invoice and credit buttons -->
41 <div class="statictabs">
44 <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]">Account</a>
47 <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Pay fines</a>
50 <a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Create manual invoice</a>
53 <a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Create manual credit</a>
56 <div class="tabs-container">
57 [% IF ( error_over ) %]
58 <div id="error_message" class="dialog alert">
59 You must pay a value less than or equal to [% total_due | format('%.2f') %].
63 [% IF ( pay_individual ) %]
64 <form name="payindivfine" id="payindivfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
65 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
66 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
67 <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual | html %]" />
68 <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber | html %]" />
69 <input type="hidden" name="description" id="description" value="[% description | html %]" />
70 <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype | html %]" />
71 <input type="hidden" name="amount" id="amount" value="[% amount | html %]" />
72 <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
73 <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id | html %]" />
74 <input type="hidden" name="title" id="title" value="[% title | html %]" />
76 <fieldset class="rows">
77 <legend>Pay an individual fine</legend>
78 <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note | html %]" />
84 <th>Amount outstanding</th>
87 <td colspan="3">Total amount payable:</td><td>[% amountoutstanding | format('%.2f') %]</td>
91 [% individual_description | html %]
93 <td>[% accounttype | html %]</td>
94 <td class="debit">[% amount | format('%.2f') %]</td>
95 <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
102 <label for="paid">Collect from patron: </label>
103 <!-- default to paying all -->
104 <input name="paid" id="paid" value="[% amountoutstanding | html %]" type="text" />
106 [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
107 [% IF payment_types %]
109 <label for="payment_type">Payment type: </label>
110 <select name="payment_type" id="payment_type">
111 <option value=""></option>
112 [% FOREACH pt IN payment_types %]
113 <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option>
121 <div class="action"><input type="submit" name="submitbutton" value="Confirm" />
122 <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a></div>
124 [% ELSIF ( writeoff_individual ) %]
125 <form name="woindivfine" id="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" >
126 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
127 <fieldset class="rows">
128 <legend>Write off an individual fine</legend>
129 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
130 <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual | html %]" />
131 <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber | html %]" />
132 <input type="hidden" name="description" id="description" value="[% description | html %]" />
133 <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype | html %]" />
134 <input type="hidden" name="amount" id="amount" value="[% amount | html %]" />
135 <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id | html %]" />
136 <input type="hidden" name="title" id="title" value="[% title | html %]" />
137 <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note | html %]" />
138 <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
139 <input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" />
143 <th>Account type</th>
145 <th>Amount outstanding</th>
147 <tfoot><td colspan="3">Total amount outstanding:</td><td>[% amountoutstanding | format('%.2f') %]</td></tfoot>
149 <td>[% description | html %] [% title | html %]</td>
150 <td>[% accounttype | html %]</td>
151 <td class="debit">[% amount | format('%.2f') %]</td>
152 <td class="debit">[% amountoutstanding | format('%.2f') %]</td>
158 <label for="paid">Writeoff amount: </label>
159 <!-- default to writing off all -->
160 <input name="amountwrittenoff" id="amountwrittenoff" value="[% amountoutstanding | $Price on_editing => 1 | html %]" type="text" />
165 <input type="submit" value="Write off this charge" />
166 <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
171 <form name="payfine" id="payfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
172 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
173 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
174 <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts | html %]" />
175 <input type="hidden" name="total" id="total" value="[% total | html %]" />
176 <input type="hidden" name="type" value="[% type | html %]" />
178 <fieldset class="rows">
179 [% IF ( selected_accts ) %]
180 [% IF type == 'writeoff' %]
181 <legend>Write off an amount toward selected fines</legend>
183 <legend>Pay an amount toward selected fines</legend>
186 <legend>Pay an amount toward all fines</legend>
191 <span class="label">Total amount outstanding: </span>
192 <span class="debit">[% total | format('%.2f') %]</span>
195 [% IF type == 'writeoff' %]
196 <label for="paid">Writeoff amount: </label>
198 <label for="paid">Collect from patron: </label>
200 <!-- default to paying all -->
201 <input name="paid" id="paid" value="[% total | format('%.2f') %]" type="text" />
203 [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
204 [% IF payment_types %]
206 <label for="payment_type">Payment type: </label>
207 <select name="payment_type" id="payment_type">
208 <option value=""></option>
209 [% FOREACH pt IN payment_types %]
210 <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option>
216 <label for="selected_accts_notes">Note: </label>
217 <textarea name="selected_accts_notes" id="selected_accts_notes">[% selected_accts_notes | html %]</textarea>
222 <input type="submit" name="submitbutton" value="Confirm" />
223 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
232 [% INCLUDE 'circ-menu.inc' %]
236 [% MACRO jsinclude BLOCK %]
237 [% INCLUDE 'str/members-menu.inc' %]
238 [% Asset.js("js/members-menu.js") | $raw %]
239 <script type= "text/javascript">
240 $(document).ready(function() {
241 $('#payindivfine, #payfine').preventDoubleFormSubmit();
242 $("#paid").on("change",function(){
248 $('#woindivfine').on('submit', function(e){
249 if ( prevent_default ) {
252 let amount_outstanding = parseFloat( $('#amountoutstanding').attr('value') );
253 let amount_writeoff = parseFloat( $('#amountwrittenoff').attr('value') );
254 if ( amount_writeoff > amount_outstanding ) {
255 alert(_("You are attemping to writeoff more than the value of the fee."));
256 $('#woindivfine').beenSubmitted = false;
259 $('#woindivfine').preventDoubleFormSubmit();
260 $('#woindivfine').submit();
265 function moneyFormat(textObj) {
266 var newValue = textObj.value;
272 for(i=0; i < newValue.length; i++) {
273 aChar = newValue.substring(i, i+1);
274 if (aChar >= "0" && aChar <= "9") {
276 decAmount = "" + decAmount + aChar;
279 dolAmount = "" + dolAmount + aChar;
291 if (dolAmount == "") {
295 if (dolAmount.length > 1) {
296 while(dolAmount.length > 1 && dolAmount.substring(0,1) == "0") {
297 dolAmount = dolAmount.substring(1,dolAmount.length);
300 if (decAmount.length > 2) {
301 decAmount = decAmount.substring(0,2);
304 if (decAmount.length == 1) {
305 decAmount = decAmount + "0";
307 if (decAmount.length == 0) {
308 decAmount = decAmount + "00";
311 textObj.value = dolAmount + "." + decAmount;
316 [% INCLUDE 'intranet-bottom.inc' %]