4 [% USE AuthorisedValues %]
7 [% USE TablesSettings %]
10 [% PROCESS 'accounts.inc' %]
11 [% INCLUDE 'doc-head-open.inc' %]
12 <title>Make a payment for [% INCLUDE 'patron-title.inc' no_html = 1 %] › Patrons › Koha</title>
13 [% INCLUDE 'doc-head-close.inc' %]
16 <body id="pat_pay" class="pat">
17 [% WRAPPER 'header.inc' %]
18 [% INCLUDE 'patron-search-header.inc' %]
21 [% WRAPPER 'sub-header.inc' %]
22 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
25 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
28 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
31 <a href="#" aria-current="page">
32 Make a payment for [% INCLUDE 'patron-title.inc' %]
39 <div class="main container-fluid">
41 <div class="col-sm-10 col-sm-push-2">
44 [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
46 <h1>Make a payment</h1>
48 <!-- The manual invoice and credit buttons -->
49 <div class="statictabs">
51 <li class="transactions"><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]">Transactions</a></li>
52 <li class="active makepayment"><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Make a payment</a></li>
53 [% IF CAN_user_updatecharges_manual_invoice %]
54 <li class="manualinvoice"><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Create manual invoice</a></li>
56 [% IF CAN_user_updatecharges_manual_credit %]
57 <li class="manualcredit"><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber | uri %]" >Create manual credit</a></li>
60 <div class="tabs-container">
62 [% INCLUDE 'renew_results.inc' renew_results=renew_results %]
64 <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
65 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
66 <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>
70 <th class="NoSort"> </th>
71 <th class="NoSort noExport">Actions</th>
78 <th>Checkout date</th>
79 <th class="checked_out_from">Checked out from</th>
80 <th class="NoSort">Payment note</th>
82 <th>Amount outstanding</th>
87 [% FOREACH line IN accounts %]
90 [% IF ( line.amountoutstanding > 0 ) %]
91 <input class="cb" type="checkbox" checked="checked" name="incl_par_[% line.accountlines_id | html %]" />
95 [% IF ( line.amountoutstanding > 0 ) %]
96 <button type="submit" class="btn btn-default btn-xs" name="pay_indiv_[% line.accountlines_id | html %]" value="Pay">Pay</button>
97 [% IF CAN_user_updatecharges_writeoff %]
98 <button type="submit" class="btn btn-default btn-xs" name="wo_indiv_[% line.accountlines_id | html %]" value="Write off">Write off</button>
101 <input type="hidden" name="itemnumber[% line.accountlines_id | html %]" value="[% line.itemnumber | html %]" />
102 <input type="hidden" name="description[% line.accountlines_id | html %]" value="[% line.description | html %]" />
103 <input type="hidden" name="debit_type_code[% line.accountlines_id | html %]" value="[% line.debit_type_code | html %]" />
104 <input type="hidden" name="amount[% line.accountlines_id | html %]" value="[% line.amount | html %]" />
105 <input type="hidden" name="accountlines_id[% line.accountlines_id | html %]" value="[% line.accountlines_id | html %]" />
106 <input type="hidden" name="amountoutstanding[% line.accountlines_id | html %]" value="[% line.amountoutstanding | html %]" />
107 <input type="hidden" name="borrowernumber[% line.accountlines_id | html %]" value="[% line.borrowernumber | html %]" />
110 [% PROCESS account_type_description account=line %]
113 [%- IF line.description %][% line.description | html %][% END %]
114 [% IF line.itemnumber %]([% line.item.biblio.title | html %])[% END %]
116 <td data-order="[% line.date | html %]">
117 [% line.date | $KohaDates %]
120 [% IF line.itemnumber %]
121 <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>
125 [% IF line.issue_id %]
126 [% line.checkout.date_due | $KohaDates as_due_date => 1 %]
130 [% IF line.issue_id %]
131 [% line.checkout.returndate | $KohaDates with_hours => 1 %]
135 [% IF line.issue_id %]
136 [% line.checkout.issuedate | $KohaDates %]
139 <td class="checked_out_from">
140 [% IF line.issue_id && line.checkout.library %]
141 [% line.checkout.library.branchname | html %]
145 <a href="#" class="add-note" data-accountlines_id="[% line.accountlines_id | html %]"><i class="fa fa-plus"></i> Add note</a>
146 <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>
148 <td class="debit" style="text-align: right;">[% line.amount | $Price %]</td>
149 <td class="debit" style="text-align: right;">[% line.amountoutstanding | $Price %]</td>
156 <td class="total" colspan="12">Total due:</td>
157 <td style="text-align: right;">[% total | $Price %]</td>
159 [% IF outstanding_credits.total_outstanding < 0 %]
161 <td class="total" colspan="12">Outstanding credits could be applied: </td>
162 <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>
165 <td class="total" colspan="12">Total due if credit applied:</td>
166 <td style="text-align: right;">[% total + outstanding_credits.total_outstanding | $Price %]</td>
172 <fieldset class="action">
173 <input type="submit" id="paycollect" name="paycollect" value="Pay amount" class="submit" />
174 <input type="submit" id="payselected" name="payselected" value="Pay selected" class="submit" />
175 [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall" id="woall" value="Write off all" class="submit" />
176 <input type="submit" id="writeoff-selected" name="writeoff_selected" value="Write off selected" class="submit" />[% END %]
177 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
181 <p>[% INCLUDE 'patron-title.inc' %] has no outstanding fines.</p>
186 </div> <!-- /.col-sm-10.col-sm-push-2 -->
188 <div class="col-sm-2 col-sm-pull-10">
190 [% INCLUDE 'circ-menu.inc' %]
192 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
193 </div> <!-- /.row -->
195 [% MACRO jsinclude BLOCK %]
196 [% INCLUDE 'str/members-menu.inc' %]
197 [% Asset.js("js/members-menu.js") | $raw %]
198 [% INCLUDE 'datatables.inc' %]
199 [% INCLUDE 'columns_settings.inc' %]
201 function enableCheckboxActions(){
202 // Enable/disable controls if checkboxes are checked
203 var checkedBoxes = $("input.cb:checked");
204 if ($(checkedBoxes).size()) {
205 $("#payselected, #writeoff-selected").prop("disabled",false);
207 $("#payselected, #writeoff-selected").prop("disabled",true);
210 $(document).ready(function(){
211 [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
212 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');
215 $('#pay-fines-form').preventDoubleFormSubmit();
216 $("#woall").click(function(event){
217 var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% total | $Price %]" );
218 var answer = confirm(msg);
220 event.preventDefault();
223 $('#CheckAll').click(function(e){
225 $(".cb").each(function(){
226 $(this).prop("checked", true );
228 enableCheckboxActions();
230 $('#CheckNone').click(function(e){
232 $(".cb").each(function(){
233 $(this).prop("checked", false );
235 enableCheckboxActions();
237 $(".cb").change(function(){
238 enableCheckboxActions();
240 enableCheckboxActions();
241 $(".add-note").on("click", function(e){
244 var accountlines_id = $(this).data("accountlines_id");
245 $("#payment_note_" + accountlines_id ).show().find("input").focus();
247 $(".cancel-note").on("click", function(e){
249 $(".payment_note").hide().find("input").val("");
250 $(".add-note").show();
253 var table_settings = [% TablesSettings.GetTableSettings('members', 'pay', 'pay-fines-table', 'json') | $raw %];
254 KohaTable("finest", {
262 [% INCLUDE 'intranet-bottom.inc' %]