4 [% USE AuthorisedValues %]
7 [% USE ColumnsSettings %]
10 [% PROCESS 'accounts.inc' %]
11 [% INCLUDE 'doc-head-open.inc' %]
12 <title>Koha › Patrons › Make a payment for [% patron.firstname | html %] [% patron.surname | html %]</title>
13 [% INCLUDE 'doc-head-close.inc' %]
16 <body id="pat_pay" class="pat">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'patron-search.inc' %]
20 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Make a payment for [% patron.firstname | html %] [% patron.surname | html %]</div>
22 <div class="main container-fluid">
24 <div class="col-sm-10 col-sm-push-2">
27 [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
29 <!-- The manual invoice and credit buttons -->
30 <div class="statictabs">
32 <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]">Transactions</a></li>
33 <li class="active"><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Make a payment</a></li>
34 <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Create manual invoice</a></li>
35 <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Create manual credit</a></li>
37 <div class="tabs-container">
39 [% INCLUDE 'renew_results.inc' renew_results=renew_results %]
41 <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
42 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
43 <p><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></p>
47 <th class="NoSort"> </th>
48 <th class="NoSort">Actions</th>
51 <th class="title-string">Date</th>
55 <th class="NoSort">Payment note</th>
57 <th>Amount outstanding</th>
62 [% FOREACH line IN accounts %]
65 [% IF ( line.amountoutstanding > 0 ) %]
66 <input class="cb" type="checkbox" checked="checked" name="incl_par_[% line.accountlines_id | html %]" />
70 [% IF ( line.amountoutstanding > 0 ) %]
71 <button type="submit" class="btn btn-default btn-xs" name="pay_indiv_[% line.accountlines_id | html %]" value="Pay">Pay</button>
72 [% IF CAN_user_updatecharges_writeoff %]
73 <button type="submit" class="btn btn-default btn-xs" name="wo_indiv_[% line.accountlines_id | html %]" value="Write off">Write off</button>
76 <input type="hidden" name="itemnumber[% line.accountlines_id | html %]" value="[% line.itemnumber | html %]" />
77 <input type="hidden" name="description[% line.accountlines_id | html %]" value="[% line.description | html %]" />
78 <input type="hidden" name="debit_type_code[% line.accountlines_id | html %]" value="[% line.debit_type_code | html %]" />
79 <input type="hidden" name="amount[% line.accountlines_id | html %]" value="[% line.amount | html %]" />
80 <input type="hidden" name="accountlines_id[% line.accountlines_id | html %]" value="[% line.accountlines_id | html %]" />
81 <input type="hidden" name="amountoutstanding[% line.accountlines_id | html %]" value="[% line.amountoutstanding | html %]" />
82 <input type="hidden" name="borrowernumber[% line.accountlines_id | html %]" value="[% line.borrowernumber | html %]" />
85 [% PROCESS account_type_description account=line %]
88 [%- IF line.description %][% line.description | html %][% END %]
89 [% IF line.itemnumber %]([% line.item.biblio.title | html %])[% END %]
92 <span title="[% line.date | html %]">[% line.date | $KohaDates %]</span>
95 [% IF line.itemnumber %]
96 <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% line.itemnumber | uri %]&biblionumber=[% line.item.biblionumber | uri %]#item[% line.itemnumber | uri %]">[% line.item.barcode | html %]</a>
100 [% IF line.issue_id %]
101 [% line.checkout.date_due | $KohaDates as_due_date => 1 %]
105 [% IF line.issue_id %]
106 [% line.checkout.returndate | $KohaDates with_hours => 1 %]
110 <a href="#" class="add-note" data-accountlines_id="[% line.accountlines_id | html %]"><i class="fa fa-plus"></i> Add note</a>
111 <span class="payment_note" id="payment_note_[% line.accountlines_id | html %]" style="display:none"><input type="text" size="10" name="payment_note_[% line.accountlines_id | html %]" value="" /> <a href="#" class="cancel-note"><i class="fa fa-remove"></i></a></span>
113 <td class="debit" style="text-align: right;">[% line.amount | $Price %]</td>
114 <td class="debit" style="text-align: right;">[% line.amountoutstanding | $Price %]</td>
121 <td class="total" colspan="10">Total due:</td>
122 <td style="text-align: right;">[% total | $Price %]</td>
124 [% IF outstanding_credits.total_outstanding < 0 %]
126 <td class="total" colspan="10">Outstanding credits could be applied: </td>
127 <td class="credit" style="text-align: right;"><button type="submit" id="apply_credits" name="apply_credits" value="apply_credits" class="btn btn-default btn-sm">Apply <strong class="credit">[% outstanding_credits.total_outstanding | $Price %]</strong></button></td>
130 <td class="total" colspan="10">Total due if credit applied:</td>
131 <td style="text-align: right;">[% total + outstanding_credits.total_outstanding | $Price %]</td>
137 <fieldset class="action">
138 <input type="submit" id="paycollect" name="paycollect" value="Pay amount" class="submit" />
139 <input type="submit" id="payselected" name="payselected" value="Pay selected" class="submit" />
140 [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall" id="woall" value="Write off all" class="submit" />
141 <input type="submit" id="writeoff-selected" name="writeoff_selected" value="Write off selected" class="submit" />[% END %]
142 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
146 <p>[% patron.firstname | html %] [% patron.surname | html %] has no outstanding fines.</p>
151 </div> <!-- /.col-sm-10.col-sm-push-2 -->
153 <div class="col-sm-2 col-sm-pull-10">
155 [% INCLUDE 'circ-menu.inc' %]
157 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
158 </div> <!-- /.row -->
160 [% MACRO jsinclude BLOCK %]
161 [% INCLUDE 'str/members-menu.inc' %]
162 [% Asset.js("js/members-menu.js") | $raw %]
163 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
164 [% INCLUDE 'datatables.inc' %]
165 [% INCLUDE 'columns_settings.inc' %]
167 function enableCheckboxActions(){
168 // Enable/disable controls if checkboxes are checked
169 var checkedBoxes = $("input.cb:checked");
170 if ($(checkedBoxes).size()) {
171 $("#payselected, #writeoff-selected").prop("disabled",false);
173 $("#payselected, #writeoff-selected").prop("disabled",true);
176 $(document).ready(function(){
177 [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
178 window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&change_given=[% change_given | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
181 $('#pay-fines-form').preventDoubleFormSubmit();
182 $("#woall").click(function(event){
183 var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% total | $Price %]" );
184 var answer = confirm(msg);
186 event.preventDefault();
189 $('#CheckAll').click(function(e){
191 $("#finest").checkCheckboxes();
192 enableCheckboxActions();
195 $('#CheckNone').click(function(e){
197 $("#finest").unCheckCheckboxes();
198 enableCheckboxActions();
201 $(".cb").change(function(){
202 enableCheckboxActions();
204 enableCheckboxActions();
205 $(".add-note").on("click", function(e){
208 var accountlines_id = $(this).data("accountlines_id");
209 $("#payment_note_" + accountlines_id ).show().find("input").focus();
211 $(".cancel-note").on("click", function(e){
213 $(".payment_note").hide().find("input").val("");
214 $(".add-note").show();
217 var columns_settings = [% ColumnsSettings.GetColumns('members', 'pay', 'pay-fines-table', 'json') | $raw %];
218 KohaTable("finest", {
220 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
221 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
222 { "sType": "title-string", "aTargets" : [ "title-string" ] }
225 'sorting': [[ 3, "asc" ]],
227 }, columns_settings );
232 [% INCLUDE 'intranet-bottom.inc' %]