09748807e4225eba7d43a8e9e5ef138ad5595338
[koha-equinox.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>Type</th>
11                 <th>Description</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                 <tr>
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 'VOID' %]Voided
37                         [% CASE 'N' %]New card
38                         [% CASE 'F' %]Fine
39                         [% CASE 'A' %]Account management fee
40                         [% CASE 'M' %]Sundry
41                         [% CASE 'L' %]Lost item
42                         [% CASE 'W' %]Writeoff
43                         [% CASE 'FU' %]Accruing fine
44                         [% CASE 'HE' %]Hold waiting too long
45                         [% CASE 'Rent' %]Rental fee
46                         [% CASE 'FOR' %]Forgiven
47                         [% CASE 'FFOR' %]Fine forgiven
48                         [% CASE 'LR' %]Lost item fee refund
49                         [% CASE 'PF' %]Lost item processing fee
50                         [% CASE 'PAY' %]Payment
51                         [% CASE 'WO' %]Writeoff
52                         [% CASE 'C' %]Credit
53                         [% CASE 'CR' %]Credit
54                         [%-CASE 'Res' %]Hold fee
55                         [% CASE %][% ACCOUNT_LINE.accounttype | html %]
56                         [%- END -%]
57                     </td>
58                     <td>
59                         [%- IF ACCOUNT_LINE.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) | html %][% END %]
60                         [%- IF ACCOUNT_LINE.description %][% ACCOUNT_LINE.description | html %][% END %]
61                         [% IF ACCOUNT_LINE.itemnumber %]([% ACCOUNT_LINE.item.biblio.title | html %])[% END %]
62                     </td>
63                     [% IF ( ACCOUNT_LINE.is_credit ) %]<td class="credit">[% ACCOUNT_LINE.amount * -1 | $Price %][% ELSE %]<td class="debit">[% ACCOUNT_LINE.amount | $Price %][% END %]</td>
64                     [% IF ( ACCOUNT_LINE.is_credit ) %]<td class="credit">[% ACCOUNT_LINE.amountoutstanding * -1 | $Price %][% ELSE %]<td class="debit">[% ACCOUNT_LINE.amountoutstanding | $Price %][% END %]</td>
65                 </tr>
66             [% END %]
67         </tbody>
68
69         <tfoot>
70             <tr>
71                 [%- IF ENABLE_OPAC_PAYMENTS -%]
72                     [%- SET COLSPAN = 5 -%]
73                 [%- ELSE -%]
74                     [%- SET COLSPAN = 4 -%]
75                 [%- END -%]
76                 <th class="sum" colspan="[% COLSPAN | html %]">Total due</th>
77                 <td class="sum">[% total | $Price %]</td>
78             </tr>
79         </tfoot>
80
81     </table>
82
83         [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
84             <fieldset class="pay-online hidden">
85                 <legend>Pay selected fines and charges</legend>
86                     <span class="help-block"><h3>Payment method</h3></span>
87
88                     [% IF Koha.Preference('EnablePayPalOpacPayments') %]
89                         <div class="control-group">
90                             <label class="radio">
91                                 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
92                                 <!-- 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 -->
93                             </label>
94                         </div>
95                     [% END %]
96
97                     [% FOREACH p IN plugins %]
98                         <div class="control-group">
99                             <label class="radio">
100                                 <input type="radio" name="payment_method" id="payment_method-[% p.class | html %]" value="[% p.class | html %]" checked="checked">
101                                 [% p.get_metadata.name | html %]
102                             </label>
103                         </div>
104                     [% END %]
105
106                     <div class="control-group">
107                         <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
108                         <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
109                         <span id="amount-to-pay-label">
110                             Amount to pay: <span id="amount-to-pay">0.00</span>
111                         </span>
112                     </div>
113             </fieldset>
114         [% END %]
115     </form>
116 [% ELSE %]
117     <h4>You have no fines or charges</h4>
118 [% END %]