Bug 12166: Improve display of Reserve charges in patron account
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / account-table.inc
1 <h3>Fines and charges</h3>
2
3 [% IF ( ACCOUNT_LINES ) %]
4     <form method="post" action="opac-account-pay.pl" class="form-horizontal">
5     <table class="table table-bordered table-striped" id="finestable">
6         <thead>
7             <tr>
8                 [% IF ENABLE_OPAC_PAYMENTS %]<th>&nbsp;</th>[% END %]
9                 <th class="title-string">Date</th>
10                 <th>Description</th>
11                 <th>Type</th>
12                 <th>Fine amount</th>
13                 <th>Amount outstanding</th>
14             </tr>
15         </thead>
16
17         <tbody>
18             [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
19                 [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
20                     [% IF ENABLE_OPAC_PAYMENTS %]
21                         <td>
22                             [% IF ACCOUNT_LINE.amountoutstanding > 0 %]
23                                 [% SET DISPLAY_PAYMENT_BLOCK = 1 %]
24                                 <input class="checkbox-pay pay-online hidden" name="accountline" type="checkbox" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id | html %]" value="[% ACCOUNT_LINE.accountlines_id | html %]">
25                                 <input type="hidden" id="amount-[% ACCOUNT_LINE.accountlines_id | html %]" value="[% ACCOUNT_LINE.amountoutstanding | html %]" />
26                             [% END %]
27                         </td>
28                     [% END %]
29                     <td><span title="[% ACCOUNT_LINE.date | html %]">[% ACCOUNT_LINE.date | $KohaDates %]</span></td>
30                     <td>
31                         [% SWITCH ACCOUNT_LINE.accounttype %]
32                         [% CASE 'Pay' %]Payment, thanks
33                         [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
34                         [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
35                         [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
36                         [% CASE 'N' %]New card
37                         [% CASE 'F' %]Fine
38                         [% CASE 'A' %]Account management fee
39                         [% CASE 'M' %]Sundry
40                         [% CASE 'L' %]Lost item
41                         [% CASE 'W' %]Writeoff
42                         [% CASE 'FU' %]Accruing fine
43                         [% CASE 'HE' %]Hold waiting too long
44                         [% CASE 'Rent' %]Rental fee
45                         [% CASE 'FOR' %]Forgiven
46                         [% CASE 'LR' %]Lost item fee refund
47                         [% CASE 'PF' %]Processing fee
48                         [% CASE 'PAY' %]Payment
49                         [% CASE 'WO' %]Writeoff
50                         [% CASE 'C' %]Credit
51                         [% CASE 'CR' %]Credit
52                         [%-CASE 'Res' %]Hold fee
53                         [% CASE %][% ACCOUNT_LINE.accounttype | html %]
54                         [%- END -%]
55                     </td>
56                     <td>
57                         [%- IF ACCOUNT_LINE.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) | html %][% END %]
58                         [%- IF ACCOUNT_LINE.description %][% ACCOUNT_LINE.description | html %][% END %]
59                         [% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title | html %])[% END %]
60                     </td>
61                     [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount | $Price %]</td>
62                     [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding | $Price %]</td>
63                 </tr>
64             [% END %]
65         </tbody>
66
67         <tfoot>
68             <tr>
69                 [%- IF ENABLE_OPAC_PAYMENTS -%]
70                     [%- SET COLSPAN = 5 -%]
71                 [%- ELSE -%]
72                     [%- SET COLSPAN = 4 -%]
73                 [%- END -%]
74                 <th class="sum" colspan="[% COLSPAN | html %]">Total due</th>
75                 <td class="sum">[% total | $Price %]</td>
76             </tr>
77         </tfoot>
78
79     </table>
80
81         [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
82             <fieldset class="pay-online hidden">
83                 <legend>Pay selected fines and charges</legend>
84                     <span class="help-block"><h3>Payment method</h3></span>
85
86                     [% IF Koha.Preference('EnablePayPalOpacPayments') %]
87                         <div class="control-group">
88                             <label class="radio">
89                                 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
90                                 <!-- 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 -->
91                             </label>
92                         </div>
93                     [% END %]
94
95                     [% FOREACH p IN plugins %]
96                         <div class="control-group">
97                             <label class="radio">
98                                 <input type="radio" name="payment_method" id="payment_method-[% p.class | html %]" value="[% p.class | html %]" checked="checked">
99                                 [% p.get_metadata.name | html %]
100                             </label>
101                         </div>
102                     [% END %]
103
104                     <div class="control-group">
105                         <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
106                         <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
107                         <span id="amount-to-pay-label">
108                             Amount to pay: <span id="amount-to-pay">0.00</span>
109                         </span>
110                     </div>
111             </fieldset>
112         [% END %]
113     </form>
114 [% ELSE %]
115     <h4>You have no fines or charges</h4>
116 [% END %]