3 [% SET ENABLE_OPAC_PAYMENTS = Koha.Preference('EnablePayPalOpacPayments') %]
4 [% 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' %]
9 [% BLOCK cssinclude %][% END %]
11 <body id="opac-account" class="scrollto">
12 [% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %]
13 [% INCLUDE 'masthead.inc' %]
16 <ul class="breadcrumb">
17 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
18 <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>
19 <li><a href="#">Your fines and charges</a></li>
22 <div class="container-fluid">
23 <div class="row-fluid">
26 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
30 <div id="useraccount" class="maincontent">
33 <div class="alert alert-info">
34 [% IF message == 'valid_payment' %]
35 <p>Your payment of $[% message_value %] has been processed successfully!</p>
36 [% ELSIF message == 'duplicate_payment' %]
37 <p>A payment with the transaction id '[% message_value %]' has already been posted to an account.</p>
38 <p>Please contact a librarian for details.</p>
39 [% ELSIF message == 'invalid_payment' %]
40 <p>The transaction id '[% message_value %]' for this payment is invalid.</p>
41 <p>Please contact a librarian for details.</p>
46 [% IF payment_error %]
47 <div id="error" class="dialog alert">
48 <p><strong>Error:</strong> there was a problem processing your payment</p>
50 [% IF payment_error == "PAYPAL_UNABLE_TO_CONNECT" %]
51 <p>Unable to connect to PayPal.</p>
52 <p>Please contact a librarian to verify your payment.</p>
53 [% ELSIF payment_error == "PAYPAL_ERROR_PROCESSING" %]
54 <p>Unable to verify payment.</p>
55 <p>Please contact a librarian to verify your payment.</p>
59 <div class="alert alert-info">
60 <p><strong>Payment applied:</strong> your payment of [% payment %] has been applied to your account</p>
64 <h3>Fines and charges</h3>
66 [% IF ( ACCOUNT_LINES ) %]
67 <form method="post" action="opac-account-pay.pl" class="form-horizontal">
68 <table class="table table-bordered table-striped">
71 [% IF ENABLE_OPAC_PAYMENTS %]<th> </th>[% END %]
75 <th>Amount outstanding</th>
81 [%- IF ENABLE_OPAC_PAYMENTS -%]
82 [%- SET COLSPAN = 4 -%]
84 [%- SET COLSPAN = 3 -%]
86 <th class="sum" colspan="[% COLSPAN %]">Total due</th>
87 <td class="sum">[% total %]</td>
92 [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
93 [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
94 [% IF ENABLE_OPAC_PAYMENTS %]
96 [% IF ACCOUNT_LINE.amountoutstanding > 0 %]
97 [% SET DISPLAY_PAYMENT_BLOCK = 1 %]
98 <input class="checkbox-pay pay-online hidden" name="accountline" type="checkbox" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.accountlines_id %]">
99 <input type="hidden" id="amount-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.amountoutstanding %]" />
103 <td>[% ACCOUNT_LINE.date | $KohaDates %]</td>
105 [% SWITCH ACCOUNT_LINE.accounttype %]
106 [% CASE 'Pay' %]Payment, thanks
107 [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
108 [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
109 [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
110 [% CASE 'N' %]New card
112 [% CASE 'A' %]Account management fee
114 [% CASE 'L' %]Lost item
115 [% CASE 'W' %]Writeoff
116 [% CASE 'FU' %]Accruing fine
117 [% CASE 'HE' %]Hold waiting too long
118 [% CASE 'Rent' %]Rental fee
119 [% CASE 'FOR' %]Forgiven
120 [% CASE 'LR' %]Lost item fee refund
121 [% CASE 'PAY' %]Payment
122 [% CASE 'WO' %]Writeoff
124 [% CASE 'CR' %]Credit
125 [% CASE %][% ACCOUNT_LINE.accounttype %]
127 [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %]
128 [% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title %])[% END %]
130 [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount %]</td>
131 [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding %]</td>
138 [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
139 <fieldset class="pay-online hidden">
140 <legend>Pay selected fines and charges</legend>
141 <span class="help-block"><h3>Payment method</h3></span>
142 <div class="control-group">
143 <label class="radio">
144 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
145 <!-- PayPal Logo --><a href="https://www.paypal.com/webapps/mpp/paypal-popup" title="How PayPal Works" onclick="javascript: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'); return false;"><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 -->
148 <!-- look to the future
149 <div class="control-group">
150 <label class="radio">
151 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
157 <div class="control-group">
158 <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
159 <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
160 <span id="amount-to-pay-label">
161 Amount to pay: <span id="amount-to-pay">0.00</span>
168 <h4>You have no fines or charges</h4>
170 </div> <!-- / #useraccount -->
171 </div> <!-- / .span10 -->
172 </div> <!-- / .row-fluid -->
173 </div> <!-- / .container-fluid -->
174 </div> <!-- / .main -->
176 [% INCLUDE 'opac-bottom.inc' %]
177 [% BLOCK jsinclude %]
178 <script type="text/javascript">
179 $( document ).ready(function() {
180 $(".pay-online").removeClass("hidden");
182 $("#amount-to-pay-label").hide();
184 $(".checkbox-pay").change( function() {
185 // Disable the pay button if no fees are selected
186 $("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length );
188 // Calculate the total amount to be paid based on selected fees
190 $(".checkbox-pay").each( function() {
191 if ( $(this).is(":checked") ) {
192 var id = this.id.split("checkbox-pay-")[1];
193 total += parseFloat( $("#amount-" + id).val() );
198 $("#amount-to-pay").html( total.toFixed(2) );
199 $("#amount-to-pay-label").show();
201 $("#amount-to-pay-label").hide();