4 [% SET ENABLE_OPAC_PAYMENTS = Koha.Preference('EnablePayPalOpacPayments') || plugins %]
5 [% SET DISPLAY_PAYMENT_BLOCK = 0 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your fines and charges</title>
8 [% INCLUDE 'doc-head-close.inc' %]
10 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
14 [% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %]
15 [% INCLUDE 'masthead.inc' %]
18 <ul class="breadcrumb">
19 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
20 <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>
21 <li><a href="#">Your fines and charges</a></li>
24 <div class="container-fluid">
25 <div class="row-fluid">
28 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
32 <div id="useraccount" class="maincontent">
35 <div class="alert alert-info">
36 [% IF message == 'valid_payment' %]
37 <p>Your payment of $[% message_value %] has been processed successfully!</p>
38 [% ELSIF message == 'duplicate_payment' %]
39 <p>A payment with the transaction id '[% message_value %]' has already been posted to an account.</p>
40 <p>Please contact a librarian for details.</p>
41 [% ELSIF message == 'invalid_payment' %]
42 <p>The transaction id '[% message_value %]' for this payment is invalid.</p>
43 <p>Please contact a librarian for details.</p>
48 [% IF payment_error %]
49 <div id="error" class="dialog alert">
50 <p><strong>Error:</strong> there was a problem processing your payment</p>
52 [% IF payment_error == "PAYPAL_UNABLE_TO_CONNECT" %]
53 <p>Unable to connect to PayPal.</p>
54 <p>Please contact a librarian to verify your payment.</p>
55 [% ELSIF payment_error == "PAYPAL_ERROR_PROCESSING" %]
56 <p>Unable to verify payment.</p>
57 <p>Please contact a librarian to verify your payment.</p>
61 <div class="alert alert-info">
62 <p><strong>Payment applied:</strong> your payment of [% payment %] has been applied to your account</p>
66 <h3>Fines and charges</h3>
68 [% IF ( ACCOUNT_LINES ) %]
69 <form method="post" action="opac-account-pay.pl" class="form-horizontal">
70 <table class="table table-bordered table-striped" id="finestable">
73 [% IF ENABLE_OPAC_PAYMENTS %]<th> </th>[% END %]
77 <th>Amount outstanding</th>
83 [%- IF ENABLE_OPAC_PAYMENTS -%]
84 [%- SET COLSPAN = 4 -%]
86 [%- SET COLSPAN = 3 -%]
88 <th class="sum" colspan="[% COLSPAN %]">Total due</th>
89 <td class="sum">[% total | $Price %]</td>
94 [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
95 [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
96 [% IF ENABLE_OPAC_PAYMENTS %]
98 [% IF ACCOUNT_LINE.amountoutstanding > 0 %]
99 [% SET DISPLAY_PAYMENT_BLOCK = 1 %]
100 <input class="checkbox-pay pay-online hidden" name="accountline" type="checkbox" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.accountlines_id %]">
101 <input type="hidden" id="amount-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.amountoutstanding %]" />
105 <td>[% ACCOUNT_LINE.date | $KohaDates %]</td>
107 [% SWITCH ACCOUNT_LINE.accounttype %]
108 [% CASE 'Pay' %]Payment, thanks
109 [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
110 [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
111 [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
112 [% CASE 'N' %]New card
114 [% CASE 'A' %]Account management fee
116 [% CASE 'L' %]Lost item
117 [% CASE 'W' %]Writeoff
118 [% CASE 'FU' %]Accruing fine
119 [% CASE 'HE' %]Hold waiting too long
120 [% CASE 'Rent' %]Rental fee
121 [% CASE 'FOR' %]Forgiven
122 [% CASE 'LR' %]Lost item fee refund
123 [% CASE 'PF' %]Processing fee
124 [% CASE 'PAY' %]Payment
125 [% CASE 'WO' %]Writeoff
127 [% CASE 'CR' %]Credit
128 [% CASE %][% ACCOUNT_LINE.accounttype %]
130 [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %]
131 [% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title %])[% END %]
133 [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount | $Price %]</td>
134 [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding | $Price %]</td>
141 [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
142 <fieldset class="pay-online hidden">
143 <legend>Pay selected fines and charges</legend>
144 <span class="help-block"><h3>Payment method</h3></span>
146 [% IF Koha.Preference('EnablePayPalOpacPayments') %]
147 <div class="control-group">
148 <label class="radio">
149 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
150 <!-- 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 -->
155 [% FOREACH p IN plugins %]
156 <div class="control-group">
157 <label class="radio">
158 <input type="radio" name="payment_method" id="payment_method-[% p.class %]" value="[% p.class %]" checked="checked">
159 [% p.get_metadata.name %]
164 <div class="control-group">
165 <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
166 <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
167 <span id="amount-to-pay-label">
168 Amount to pay: <span id="amount-to-pay">0.00</span>
175 <h4>You have no fines or charges</h4>
177 </div> <!-- / #useraccount -->
178 </div> <!-- / .span10 -->
179 </div> <!-- / .row-fluid -->
180 </div> <!-- / .container-fluid -->
181 </div> <!-- / .main -->
183 [% INCLUDE 'opac-bottom.inc' %]
184 [% BLOCK jsinclude %]
185 [% INCLUDE 'datatables.inc' %]
186 <script type="text/javascript">
187 $( document ).ready(function() {
189 $("#finestable").dataTable($.extend(true, {}, dataTablesDefaults ));
191 $(".paypal").on("click", function() {
192 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');
196 $(".pay-online").removeClass("hidden");
198 $("#amount-to-pay-label").hide();
200 $(".checkbox-pay").change( function() {
201 // Disable the pay button if no fees are selected
202 $("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length );
204 // Calculate the total amount to be paid based on selected fees
206 $(".checkbox-pay").each( function() {
207 if ( $(this).is(":checked") ) {
208 var id = this.id.split("checkbox-pay-")[1];
209 total += parseFloat( $("#amount-" + id).val() );
214 $("#amount-to-pay").html( total.toFixed(2) );
215 $("#amount-to-pay-label").show();
217 $("#amount-to-pay-label").hide();