5 [% SET ENABLE_OPAC_PAYMENTS = Koha.Preference('EnablePayPalOpacPayments') || plugins %]
6 [% SET DISPLAY_PAYMENT_BLOCK = 0 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your fines and charges</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% BLOCK cssinclude %]
11 [% Asset.css("css/datatables.css") %]
15 [% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %]
16 [% INCLUDE 'masthead.inc' %]
19 <ul class="breadcrumb">
20 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
21 <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>
22 <li><a href="#">Your fines and charges</a></li>
25 <div class="container-fluid">
26 <div class="row-fluid">
29 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
33 <div id="useraccount" class="maincontent">
36 <div class="alert alert-info">
37 [% IF message == 'valid_payment' %]
38 <p>Your payment of $[% message_value %] has been processed successfully!</p>
39 [% ELSIF message == 'duplicate_payment' %]
40 <p>A payment with the transaction id '[% message_value %]' has already been posted to an account.</p>
41 <p>Please contact a librarian for details.</p>
42 [% ELSIF message == 'invalid_payment' %]
43 <p>The transaction id '[% message_value %]' for this payment is invalid.</p>
44 <p>Please contact a librarian for details.</p>
49 [% IF payment_error %]
50 <div id="error" class="dialog alert">
51 <p><strong>Error:</strong> there was a problem processing your payment</p>
53 [% IF payment_error == "PAYPAL_UNABLE_TO_CONNECT" %]
54 <p>Unable to connect to PayPal.</p>
55 <p>Please contact a librarian to verify your payment.</p>
56 [% ELSIF payment_error == "PAYPAL_ERROR_PROCESSING" %]
57 <p>Unable to verify payment.</p>
58 <p>Please contact a librarian to verify your payment.</p>
62 <div class="alert alert-info">
63 <p><strong>Payment applied:</strong> your payment of [% payment %] has been applied to your account</p>
67 <h3>Fines and charges</h3>
69 [% IF ( ACCOUNT_LINES ) %]
70 <form method="post" action="opac-account-pay.pl" class="form-horizontal">
71 <table class="table table-bordered table-striped" id="finestable">
74 [% IF ENABLE_OPAC_PAYMENTS %]<th> </th>[% END %]
75 <th class="title-string">Date</th>
78 <th>Amount outstanding</th>
84 [%- IF ENABLE_OPAC_PAYMENTS -%]
85 [%- SET COLSPAN = 4 -%]
87 [%- SET COLSPAN = 3 -%]
89 <th class="sum" colspan="[% COLSPAN %]">Total due</th>
90 <td class="sum">[% total | $Price %]</td>
95 [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
96 [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
97 [% IF ENABLE_OPAC_PAYMENTS %]
99 [% IF ACCOUNT_LINE.amountoutstanding > 0 %]
100 [% SET DISPLAY_PAYMENT_BLOCK = 1 %]
101 <input class="checkbox-pay pay-online hidden" name="accountline" type="checkbox" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.accountlines_id %]">
102 <input type="hidden" id="amount-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.amountoutstanding %]" />
106 <td><span title="[% ACCOUNT_LINE.date %]">[% ACCOUNT_LINE.date | $KohaDates %]</span></td>
108 [% SWITCH ACCOUNT_LINE.accounttype %]
109 [% CASE 'Pay' %]Payment, thanks
110 [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
111 [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
112 [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
113 [% CASE 'N' %]New card
115 [% CASE 'A' %]Account management fee
117 [% CASE 'L' %]Lost item
118 [% CASE 'W' %]Writeoff
119 [% CASE 'FU' %]Accruing fine
120 [% CASE 'HE' %]Hold waiting too long
121 [% CASE 'Rent' %]Rental fee
122 [% CASE 'FOR' %]Forgiven
123 [% CASE 'LR' %]Lost item fee refund
124 [% CASE 'PF' %]Processing fee
125 [% CASE 'PAY' %]Payment
126 [% CASE 'WO' %]Writeoff
128 [% CASE 'CR' %]Credit
129 [% CASE %][% ACCOUNT_LINE.accounttype %]
131 [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %]
132 [% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title %])[% END %]
134 [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount | $Price %]</td>
135 [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding | $Price %]</td>
142 [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
143 <fieldset class="pay-online hidden">
144 <legend>Pay selected fines and charges</legend>
145 <span class="help-block"><h3>Payment method</h3></span>
147 [% IF Koha.Preference('EnablePayPalOpacPayments') %]
148 <div class="control-group">
149 <label class="radio">
150 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
151 <!-- 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 -->
156 [% FOREACH p IN plugins %]
157 <div class="control-group">
158 <label class="radio">
159 <input type="radio" name="payment_method" id="payment_method-[% p.class %]" value="[% p.class %]" checked="checked">
160 [% p.get_metadata.name %]
165 <div class="control-group">
166 <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
167 <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
168 <span id="amount-to-pay-label">
169 Amount to pay: <span id="amount-to-pay">0.00</span>
176 <h4>You have no fines or charges</h4>
178 </div> <!-- / #useraccount -->
179 </div> <!-- / .span10 -->
180 </div> <!-- / .row-fluid -->
181 </div> <!-- / .container-fluid -->
182 </div> <!-- / .main -->
184 [% INCLUDE 'opac-bottom.inc' %]
185 [% BLOCK jsinclude %]
186 [% INCLUDE 'datatables.inc' %]
187 <script type="text/javascript">
188 $( document ).ready(function() {
190 $("#finestable").dataTable($.extend(true, {}, dataTablesDefaults, {
192 { "sType": "title-string", "aTargets" : [ "title-string" ] }
196 $(".paypal").on("click", function() {
197 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');
201 $(".pay-online").removeClass("hidden");
203 $("#amount-to-pay-label").hide();
205 $(".checkbox-pay").change( function() {
206 // Disable the pay button if no fees are selected
207 $("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length );
209 // Calculate the total amount to be paid based on selected fees
211 $(".checkbox-pay").each( function() {
212 if ( $(this).is(":checked") ) {
213 var id = this.id.split("checkbox-pay-")[1];
214 total += parseFloat( $("#amount-" + id).val() );
219 $("#amount-to-pay").html( total.toFixed(2) );
220 $("#amount-to-pay-label").show();
222 $("#amount-to-pay-label").hide();