3 [% SET ENABLE_OPAC_PAYMENTS = Koha.Preference('EnablePayPalOpacPayments') %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your fines and charges</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% BLOCK cssinclude %][% END %]
10 <body id="opac-account" class="scrollto">
11 [% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %]
12 [% INCLUDE 'masthead.inc' %]
15 <ul class="breadcrumb">
16 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
17 <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>
18 <li><a href="#">Your fines and charges</a></li>
21 <div class="container-fluid">
22 <div class="row-fluid">
25 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
29 <div id="useraccount" class="maincontent">
32 <div class="alert alert-info">
33 [% IF message == 'valid_payment' %]
34 <p>Your payment of $[% message_value %] has been processed sucessfully!</p>
35 [% ELSIF message == 'duplicate_payment' %]
36 <p>A payment with the transaction id <i>[% message_value %]</i> has already been posted to an account.</p>
37 <p>Please contact a librarian for details.</p>
38 [% ELSIF message == 'invalid_payment' %]
39 <p>The transaction id <i>[% message_value %]</i> for this payment is invalid.</p>
40 <p>Please contact a librarian for details.</p>
45 [% IF payment_error %]
46 <div id="error" class="dialog alert">
47 <p><strong>Error:</strong> there was an problem processing your payment</p>
49 [% IF payment_error == "PAYPAL_UNABLE_TO_CONNECT" %]
50 <p>Unable to connect to PayPal.</p>
51 <p>Please contact a librarian to verify your payment.</p>
52 [% ELSIF payment_error == "PAYPAL_ERROR_PROCESSING" %]
53 <p>Unable to verify payment.</p>
54 <p>Please contact a librarian to verify your payment.</p>
58 <div class="alert alert-info">
59 <p><strong>Payment applied:</strong> your payment of [% payment %] has been applied to your account</p>
63 <h3>Fines and charges</h3>
65 [% IF ( ACCOUNT_LINES ) %]
66 <form method="post" action="opac-account-pay.pl" class="form-horizontal">
67 <table class="table table-bordered table-striped">
70 [% IF ENABLE_OPAC_PAYMENTS %]<th> </th>[% END %]
74 <th>Amount outstanding</th>
80 [%- IF ENABLE_OPAC_PAYMENTS -%]
81 [%- SET COLSPAN = 4 -%]
83 [%- SET COLSPAN = 3 -%]
85 <th class="sum" colspan="[% COLSPAN %]">Total due</th>
86 <td class="sum">[% total %]</td>
91 [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
92 [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
93 [% IF ENABLE_OPAC_PAYMENTS %]
95 [% IF ACCOUNT_LINE.amountoutstanding > 0 %]
96 <input name="accountline" type="checkbox" class="checkbox-pay" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.accountlines_id %]">
97 <input type="hidden" id="amount-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.amountoutstanding %]" />
101 <td>[% ACCOUNT_LINE.date | $KohaDates %]</td>
103 [% SWITCH ACCOUNT_LINE.accounttype %]
104 [% CASE 'Pay' %]Payment, thanks
105 [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
106 [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
107 [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
108 [% CASE 'N' %]New card
110 [% CASE 'A' %]Account management fee
112 [% CASE 'L' %]Lost item
113 [% CASE 'W' %]Writeoff
114 [% CASE 'FU' %]Accruing fine
115 [% CASE 'Rent' %]Rental fee
116 [% CASE 'FOR' %]Forgiven
117 [% CASE 'LR' %]Lost item fee refund
118 [% CASE 'PAY' %]Payment
119 [% CASE 'WO' %]Writeoff
121 [% CASE 'CR' %]Credit
122 [% CASE %][% ACCOUNT_LINE.accounttype %]
124 [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %]
125 [% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title %])[% END %]
127 [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount %]</td>
128 [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding %]</td>
135 [% IF ENABLE_OPAC_PAYMENTS %]
137 <legend>Pay selected fines and charges</legend>
138 <span class="help-block"><h3>Payment method</h3></span>
139 <div class="control-group">
140 <label class="radio">
141 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
142 <!-- 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 -->
145 <!-- look to the future
146 <div class="control-group">
147 <label class="radio">
148 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
154 <div class="control-group">
155 <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
156 <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
157 <span id="amount-to-pay-label">
158 Amount to pay: <span id="amount-to-pay">0.00</span>
165 <h4>You have no fines or charges</h4>
167 </div> <!-- / #useraccount -->
168 </div> <!-- / .span10 -->
169 </div> <!-- / .row-fluid -->
170 </div> <!-- / .container-fluid -->
171 </div> <!-- / .main -->
173 [% INCLUDE 'opac-bottom.inc' %]
174 [% BLOCK jsinclude %]
175 <script type="text/javascript">
176 $( document ).ready(function() {
177 $("#amount-to-pay-label").hide();
179 $(".checkbox-pay").change( function() {
180 // Disable the pay button if no fees are selected
181 $("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length );
183 // Calculate the total amount to be paid based on selected fees
185 $(".checkbox-pay").each( function() {
186 if ( $(this).is(":checked") ) {
187 var id = this.id.split("checkbox-pay-")[1];
188 total += parseFloat( $("#amount-" + id).val() );
193 $("#amount-to-pay").html( total.toFixed(2) );
194 $("#amount-to-pay-label").show();
196 $("#amount-to-pay-label").hide();