4 [% SET ENABLE_OPAC_PAYMENTS = Koha.Preference('EnablePayPalOpacPayments') %]
5 [% 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 %][% END %]
12 <body id="opac-account" class="scrollto">
13 [% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %]
14 [% INCLUDE 'masthead.inc' %]
17 <ul class="breadcrumb">
18 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
19 <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>
20 <li><a href="#">Your fines and charges</a></li>
23 <div class="container-fluid">
24 <div class="row-fluid">
27 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
31 <div id="useraccount" class="maincontent">
34 <div class="alert alert-info">
35 [% IF message == 'valid_payment' %]
36 <p>Your payment of $[% message_value %] has been processed successfully!</p>
37 [% ELSIF message == 'duplicate_payment' %]
38 <p>A payment with the transaction id '[% message_value %]' has already been posted to an account.</p>
39 <p>Please contact a librarian for details.</p>
40 [% ELSIF message == 'invalid_payment' %]
41 <p>The transaction id '[% message_value %]' for this payment is invalid.</p>
42 <p>Please contact a librarian for details.</p>
47 [% IF payment_error %]
48 <div id="error" class="dialog alert">
49 <p><strong>Error:</strong> there was a problem processing your payment</p>
51 [% IF payment_error == "PAYPAL_UNABLE_TO_CONNECT" %]
52 <p>Unable to connect to PayPal.</p>
53 <p>Please contact a librarian to verify your payment.</p>
54 [% ELSIF payment_error == "PAYPAL_ERROR_PROCESSING" %]
55 <p>Unable to verify payment.</p>
56 <p>Please contact a librarian to verify your payment.</p>
60 <div class="alert alert-info">
61 <p><strong>Payment applied:</strong> your payment of [% payment %] has been applied to your account</p>
65 <h3>Fines and charges</h3>
67 [% IF ( ACCOUNT_LINES ) %]
68 <form method="post" action="opac-account-pay.pl" class="form-horizontal">
69 <table class="table table-bordered table-striped">
72 [% IF ENABLE_OPAC_PAYMENTS %]<th> </th>[% END %]
76 <th>Amount outstanding</th>
82 [%- IF ENABLE_OPAC_PAYMENTS -%]
83 [%- SET COLSPAN = 4 -%]
85 [%- SET COLSPAN = 3 -%]
87 <th class="sum" colspan="[% COLSPAN %]">Total due</th>
88 <td class="sum">[% total | $Price %]</td>
93 [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
94 [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
95 [% IF ENABLE_OPAC_PAYMENTS %]
97 [% IF ACCOUNT_LINE.amountoutstanding > 0 %]
98 [% SET DISPLAY_PAYMENT_BLOCK = 1 %]
99 <input class="checkbox-pay pay-online hidden" name="accountline" type="checkbox" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.accountlines_id %]">
100 <input type="hidden" id="amount-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.amountoutstanding %]" />
104 <td>[% ACCOUNT_LINE.date | $KohaDates %]</td>
106 [% SWITCH ACCOUNT_LINE.accounttype %]
107 [% CASE 'Pay' %]Payment, thanks
108 [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
109 [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
110 [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
111 [% CASE 'N' %]New card
113 [% CASE 'A' %]Account management fee
115 [% CASE 'L' %]Lost item
116 [% CASE 'W' %]Writeoff
117 [% CASE 'FU' %]Accruing fine
118 [% CASE 'HE' %]Hold waiting too long
119 [% CASE 'Rent' %]Rental fee
120 [% CASE 'FOR' %]Forgiven
121 [% CASE 'LR' %]Lost item fee refund
122 [% CASE 'PAY' %]Payment
123 [% CASE 'WO' %]Writeoff
125 [% CASE 'CR' %]Credit
126 [% CASE %][% ACCOUNT_LINE.accounttype %]
128 [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %]
129 [% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title %])[% END %]
131 [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount | $Price %]</td>
132 [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding | $Price %]</td>
139 [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
140 <fieldset class="pay-online hidden">
141 <legend>Pay selected fines and charges</legend>
142 <span class="help-block"><h3>Payment method</h3></span>
143 <div class="control-group">
144 <label class="radio">
145 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
146 <!-- 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 -->
149 <!-- look to the future
150 <div class="control-group">
151 <label class="radio">
152 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
158 <div class="control-group">
159 <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
160 <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
161 <span id="amount-to-pay-label">
162 Amount to pay: <span id="amount-to-pay">0.00</span>
169 <h4>You have no fines or charges</h4>
171 </div> <!-- / #useraccount -->
172 </div> <!-- / .span10 -->
173 </div> <!-- / .row-fluid -->
174 </div> <!-- / .container-fluid -->
175 </div> <!-- / .main -->
177 [% INCLUDE 'opac-bottom.inc' %]
178 [% BLOCK jsinclude %]
179 <script type="text/javascript">
180 $( document ).ready(function() {
181 $(".pay-online").removeClass("hidden");
183 $("#amount-to-pay-label").hide();
185 $(".checkbox-pay").change( function() {
186 // Disable the pay button if no fees are selected
187 $("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length );
189 // Calculate the total amount to be paid based on selected fees
191 $(".checkbox-pay").each( function() {
192 if ( $(this).is(":checked") ) {
193 var id = this.id.split("checkbox-pay-")[1];
194 total += parseFloat( $("#amount-" + id).val() );
199 $("#amount-to-pay").html( total.toFixed(2) );
200 $("#amount-to-pay-label").show();
202 $("#amount-to-pay-label").hide();