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 [% WRAPPER breadcrumbs %]
23 [% WRAPPER breadcrumb_item %]
24 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
26 [% WRAPPER breadcrumb_item %]
27 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">
28 [% INCLUDE 'patron-title.inc' %]
31 [% WRAPPER breadcrumb_item bc_active= 1 %]
32 <span>Make a payment</span>
34 [% END #/ WRAPPER breadcrumbs %]
35 [% END #/ WRAPPER sub-header.inc %]
37 <div class="main container-fluid">
39 <div class="col-sm-10 col-sm-push-2">
42 [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
44 <h1>Make a payment</h1>
46 <!-- The manual invoice and credit buttons -->
48 <ul class="nav nav-tabs" role="tablist">
49 <li role="presentation" class="transactions">
50 <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]" role="tab">Transactions</a>
52 <li role="presentation" class="makepayment active">
53 <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]" role="tab">Make a payment</a>
55 [% IF CAN_user_updatecharges_manual_invoice %]
56 <li role="presentation" class="manualinvoice">
57 <a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber | uri %]" role="tab">Create manual invoice</a>
60 [% IF CAN_user_updatecharges_manual_credit %]
61 <li role="presentation" class="manualcredit">
62 <a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber | uri %]" role="tab">Create manual credit</a>
65 </ul> <!-- /.nav.nav-tabs -->
66 <div class="tab-content">
67 <div role="tabpanel" class="tab-pane active">
69 [% INCLUDE 'renew_results.inc' renew_results=renew_results %]
71 <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
72 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
73 [% INCLUDE 'csrf-token.inc' %]
74 <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-times"></i> Clear all</a></span></p>
78 <th class="NoSort"> </th>
79 <th class="NoSort noExport">Actions</th>
87 <th>Checkout date</th>
88 <th class="checked_out_from">Checked out from</th>
90 <th class="NoSort">Payment note</th>
92 <th>Amount outstanding</th>
97 [% FOREACH line IN accounts %]
100 [% IF ( line.amountoutstanding > 0 ) %]
101 <input class="cb" type="checkbox" checked="checked" name="incl_par_[% line.accountlines_id | html %]" />
105 [% IF ( line.amountoutstanding > 0 ) %]
106 <button type="submit" class="btn btn-default btn-xs" name="pay_indiv_[% line.accountlines_id | html %]" value="Pay">Pay</button>
107 [% IF CAN_user_updatecharges_writeoff %]
108 <button type="submit" class="btn btn-default btn-xs" name="wo_indiv_[% line.accountlines_id | html %]" value="Write off">Write off</button>
111 <input type="hidden" name="itemnumber[% line.accountlines_id | html %]" value="[% line.itemnumber | html %]" />
112 <input type="hidden" name="description[% line.accountlines_id | html %]" value="[% line.description | html %]" />
113 <input type="hidden" name="debit_type_code[% line.accountlines_id | html %]" value="[% line.debit_type_code | html %]" />
114 <input type="hidden" name="amount[% line.accountlines_id | html %]" value="[% line.amount | html %]" />
115 <input type="hidden" name="accountlines_id[% line.accountlines_id | html %]" value="[% line.accountlines_id | html %]" />
116 <input type="hidden" name="amountoutstanding[% line.accountlines_id | html %]" value="[% line.amountoutstanding | html %]" />
117 <input type="hidden" name="borrowernumber[% line.accountlines_id | html %]" value="[% line.borrowernumber | html %]" />
120 [% PROCESS account_type_description account=line %]
123 [%- IF line.description %][% line.description | html %][% END %]
124 [% IF line.itemnumber %]([% line.item.biblio.title | html %])[% END %]
126 <td data-order="[% line.date | html %]">
127 [% line.date | $KohaDates %]
130 [% IF line.itemnumber %]
131 <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>
135 [% IF line.itemnumber %]
136 [% line.item.itemcallnumber | html %]
140 [% IF line.issue_id %]
141 [% line.checkout.date_due | $KohaDates as_due_date => 1 %]
145 [% IF line.issue_id %]
146 [% line.checkout.returndate | $KohaDates with_hours => 1 %]
150 [% IF line.issue_id %]
151 [% line.checkout.issuedate | $KohaDates %]
154 <td class="checked_out_from">
155 [% IF line.issue_id && line.checkout.library %]
156 [% line.checkout.library.branchname | html %]
160 [% IF line.itemnumber %]
161 [% Branches.GetName( line.item.homebranch ) | html %]
165 <a href="#" class="add-note" data-accountlines_id="[% line.accountlines_id | html %]"><i class="fa fa-plus"></i> Add note</a>
166 <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-times"></i></a></span>
168 <td class="debit" style="text-align: right;">[% line.amount | $Price %]</td>
169 <td class="debit" style="text-align: right;">[% line.amountoutstanding | $Price %]</td>
176 <td class="total" colspan="12">Total due:</td>
177 <td style="text-align: right;">[% total | $Price %]</td>
179 [% IF outstanding_credits.total_outstanding < 0 %]
181 <td class="total" colspan="12">Outstanding credits could be applied: </td>
182 <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>
185 <td class="total" colspan="12">Total due if credit applied:</td>
186 <td style="text-align: right;">[% total + outstanding_credits.total_outstanding | $Price %]</td>
192 <fieldset class="action">
193 <input type="submit" id="paycollect" name="paycollect" value="Pay amount" class="submit" />
194 <input type="submit" id="payselected" name="payselected" value="Pay selected" class="submit" />
195 [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall" id="woall" value="Write off all" class="submit" />
196 <input type="submit" id="writeoff-selected" name="writeoff_selected" value="Write off selected" class="submit" />[% END %]
197 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
201 <p>[% INCLUDE 'patron-title.inc' %] has no outstanding charges.</p>
203 </div> <!-- /.tab-pane -->
204 </div> <!-- /.tab-content -->
205 </div> <!-- /.toptabs -->
208 </div> <!-- /.col-sm-10.col-sm-push-2 -->
210 <div class="col-sm-2 col-sm-pull-10">
212 [% INCLUDE 'circ-menu.inc' %]
214 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
215 </div> <!-- /.row -->
217 [% MACRO jsinclude BLOCK %]
218 [% INCLUDE 'str/members-menu.inc' %]
219 [% Asset.js("js/members-menu.js") | $raw %]
220 [% INCLUDE 'datatables.inc' %]
221 [% INCLUDE 'columns_settings.inc' %]
223 function enableCheckboxActions(){
224 // Enable/disable controls if checkboxes are checked
225 var checkedBoxes = $("input.cb:checked");
226 if ($(checkedBoxes).size()) {
227 $("#payselected, #writeoff-selected").prop("disabled",false);
229 $("#payselected, #writeoff-selected").prop("disabled",true);
232 $(document).ready(function(){
233 [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
234 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');
237 $('#pay-fines-form').preventDoubleFormSubmit();
238 $("#woall").click(function(event){
239 var msg = _("Are you sure you want to write off %s in outstanding charges? This cannot be undone!").format( "[% total | $Price %]" );
240 var answer = confirm(msg);
242 event.preventDefault();
245 $('#CheckAll').click(function(e){
247 $(".cb").each(function(){
248 $(this).prop("checked", true );
250 enableCheckboxActions();
252 $('#CheckNone').click(function(e){
254 $(".cb").each(function(){
255 $(this).prop("checked", false );
257 enableCheckboxActions();
259 $(".cb").change(function(){
260 enableCheckboxActions();
262 enableCheckboxActions();
263 $(".add-note").on("click", function(e){
266 var accountlines_id = $(this).data("accountlines_id");
267 $("#payment_note_" + accountlines_id ).show().find("input").focus();
269 $(".cancel-note").on("click", function(e){
271 $(".payment_note").hide().find("input").val("");
272 $(".add-note").show();
275 var table_settings = [% TablesSettings.GetTableSettings('members', 'pay', 'pay-fines-table', 'json') | $raw %];
276 KohaTable("finest", {
284 [% INCLUDE 'intranet-bottom.inc' %]