4 [% USE AuthorisedValues %]
6 [% SET ENABLE_OPAC_PAYMENTS = Koha.Preference('EnablePayPalOpacPayments') || plugins %]
7 [% SET DISPLAY_PAYMENT_BLOCK = 0 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your fines and charges</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% BLOCK cssinclude %]
12 [% Asset.css("css/datatables.css") %]
16 [% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %]
17 [% INCLUDE 'masthead.inc' %]
20 <ul class="breadcrumb">
21 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
22 <li>[% IF BORROWER_INFO %]<a href="/cgi-bin/koha/opac-user.pl">[% BORROWER_INFO.firstname %] [% BORROWER_INFO.surname %]</a>[% END %] <span class="divider">›</span></li>
23 <li><a href="#">Your fines and charges</a></li>
26 <div class="container-fluid">
27 <div class="row-fluid">
30 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
34 <div id="useraccount" class="maincontent">
37 <div class="alert alert-info">
38 [% IF message == 'valid_payment' %]
39 <p>Your payment of $[% message_value %] has been processed successfully!</p>
40 [% ELSIF message == 'duplicate_payment' %]
41 <p>A payment with the transaction id '[% message_value %]' has already been posted to an account.</p>
42 <p>Please contact a librarian for details.</p>
43 [% ELSIF message == 'invalid_payment' %]
44 <p>The transaction id '[% message_value %]' for this payment is invalid.</p>
45 <p>Please contact a librarian for details.</p>
50 [% IF payment_error %]
51 <div id="error" class="dialog alert">
52 <p><strong>Error:</strong> there was a problem processing your payment</p>
54 [% IF payment_error == "PAYPAL_UNABLE_TO_CONNECT" %]
55 <p>Unable to connect to PayPal.</p>
56 <p>Please contact a librarian to verify your payment.</p>
57 [% ELSIF payment_error == "PAYPAL_ERROR_PROCESSING" %]
58 <p>Unable to verify payment.</p>
59 <p>Please contact a librarian to verify your payment.</p>
63 <div class="alert alert-info">
64 <p><strong>Payment applied:</strong> your payment of [% payment %] has been applied to your account</p>
68 <h3>Fines and charges</h3>
70 [% IF ( ACCOUNT_LINES ) %]
71 <form method="post" action="opac-account-pay.pl" class="form-horizontal">
72 <table class="table table-bordered table-striped" id="finestable">
75 [% IF ENABLE_OPAC_PAYMENTS %]<th> </th>[% END %]
76 <th class="title-string">Date</th>
79 <th>Amount outstanding</th>
85 [%- IF ENABLE_OPAC_PAYMENTS -%]
86 [%- SET COLSPAN = 4 -%]
88 [%- SET COLSPAN = 3 -%]
90 <th class="sum" colspan="[% COLSPAN %]">Total due</th>
91 <td class="sum">[% total | $Price %]</td>
96 [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
97 [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
98 [% IF ENABLE_OPAC_PAYMENTS %]
100 [% IF ACCOUNT_LINE.amountoutstanding > 0 %]
101 [% SET DISPLAY_PAYMENT_BLOCK = 1 %]
102 <input class="checkbox-pay pay-online hidden" name="accountline" type="checkbox" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.accountlines_id %]">
103 <input type="hidden" id="amount-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.amountoutstanding %]" />
107 <td><span title="[% ACCOUNT_LINE.date %]">[% ACCOUNT_LINE.date | $KohaDates %]</span></td>
109 [% SWITCH ACCOUNT_LINE.accounttype %]
110 [% CASE 'Pay' %]Payment, thanks
111 [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
112 [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
113 [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
114 [% CASE 'N' %]New card
116 [% CASE 'A' %]Account management fee
118 [% CASE 'L' %]Lost item
119 [% CASE 'W' %]Writeoff
120 [% CASE 'FU' %]Accruing fine
121 [% CASE 'HE' %]Hold waiting too long
122 [% CASE 'Rent' %]Rental fee
123 [% CASE 'FOR' %]Forgiven
124 [% CASE 'LR' %]Lost item fee refund
125 [% CASE 'PF' %]Processing fee
126 [% CASE 'PAY' %]Payment
127 [% CASE 'WO' %]Writeoff
129 [% CASE 'CR' %]Credit
130 [% CASE %][% ACCOUNT_LINE.accounttype %]
132 [%- IF ACCOUNT_LINE.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) %][% END %]
133 [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %]
134 [% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title %])[% END %]
136 [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount | $Price %]</td>
137 [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding | $Price %]</td>
144 [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
145 <fieldset class="pay-online hidden">
146 <legend>Pay selected fines and charges</legend>
147 <span class="help-block"><h3>Payment method</h3></span>
149 [% IF Koha.Preference('EnablePayPalOpacPayments') %]
150 <div class="control-group">
151 <label class="radio">
152 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
153 <!-- PayPal Logo --><a href="https://www.paypal.com/webapps/mpp/paypal-popup" title="How PayPal Works" class="paypal"><img src="https://www.paypalobjects.com/webstatic/mktg/logo/AM_SbyPP_mc_vs_dc_ae.jpg" border="0" alt="PayPal Acceptance Mark"></a><!-- PayPal Logo -->
158 [% FOREACH p IN plugins %]
159 <div class="control-group">
160 <label class="radio">
161 <input type="radio" name="payment_method" id="payment_method-[% p.class %]" value="[% p.class %]" checked="checked">
162 [% p.get_metadata.name %]
167 <div class="control-group">
168 <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
169 <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
170 <span id="amount-to-pay-label">
171 Amount to pay: <span id="amount-to-pay">0.00</span>
178 <h4>You have no fines or charges</h4>
180 </div> <!-- / #useraccount -->
181 </div> <!-- / .span10 -->
182 </div> <!-- / .row-fluid -->
183 </div> <!-- / .container-fluid -->
184 </div> <!-- / .main -->
186 [% INCLUDE 'opac-bottom.inc' %]
187 [% BLOCK jsinclude %]
188 [% INCLUDE 'datatables.inc' %]
190 $( document ).ready(function() {
192 $("#finestable").dataTable($.extend(true, {}, dataTablesDefaults, {
194 { "type": "title-string", "targets" : [ "title-string" ] }
198 $(".paypal").on("click", function() {
199 window.open('https://www.paypal.com/webapps/mpp/paypal-popup','WIPaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700');
203 $(".pay-online").removeClass("hidden");
205 $("#amount-to-pay-label").hide();
207 $(".checkbox-pay").change( function() {
208 // Disable the pay button if no fees are selected
209 $("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length );
211 // Calculate the total amount to be paid based on selected fees
213 $(".checkbox-pay").each( function() {
214 if ( $(this).is(":checked") ) {
215 var id = this.id.split("checkbox-pay-")[1];
216 total += parseFloat( $("#amount-" + id).val() );
221 $("#amount-to-pay").html( total.toFixed(2) );
222 $("#amount-to-pay-label").show();
224 $("#amount-to-pay-label").hide();