Bug 23115: (QA follow-up) Address QA tools complaints
[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>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.amountoutstanding > 0 || ACCOUNT_LINE.amountoutstanding < 0 %]<tr class="outstanding">[% 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                         [% PROCESS account_type_description account=ACCOUNT_LINE %]
32                         [%- PROCESS account_status_description account=ACCOUNT_LINE -%]
33                     </td>
34                     <td>
35                         [%- IF ACCOUNT_LINE.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) | html %][% END %]
36                         [%- IF ACCOUNT_LINE.description %][% ACCOUNT_LINE.description | html %][% END %]
37                         [% IF ACCOUNT_LINE.itemnumber %]([% ACCOUNT_LINE.item.biblio.title | html %])[% END %]
38                     </td>
39                     [% IF ( ACCOUNT_LINE.is_credit ) %]<td class="credit">[% ACCOUNT_LINE.amount * -1 | $Price %][% ELSE %]<td class="debit">[% ACCOUNT_LINE.amount | $Price %][% END %]</td>
40                     [% IF ( ACCOUNT_LINE.is_credit ) %]<td class="credit">[% ACCOUNT_LINE.amountoutstanding * -1 | $Price %][% ELSE %]<td class="debit">[% ACCOUNT_LINE.amountoutstanding | $Price %][% END %]</td>
41                 </tr>
42             [% END %]
43         </tbody>
44
45         <tfoot>
46             <tr>
47                 [%- IF ENABLE_OPAC_PAYMENTS -%]
48                     [%- SET COLSPAN = 5 -%]
49                 [%- ELSE -%]
50                     [%- SET COLSPAN = 4 -%]
51                 [%- END -%]
52                 <th class="sum" colspan="[% COLSPAN | html %]">Total due</th>
53                 <td class="sum">[% total | $Price %]</td>
54             </tr>
55             [% IF outstanding_credits.total_outstanding < 0 %]
56             [% FOREACH outstanding_credit IN outstanding_credits %]
57                 [% IF outstanding_credit.amountoutstanding < 0 %]<tr class="outstanding">[% ELSE %]<tr>[% END%]
58                     [% IF ENABLE_OPAC_PAYMENTS %]<td></td>[% END %]
59                     <td><span title="[% outstanding_credit.date | html %]">[% outstanding_credit.date | $KohaDates %]</span></td>
60                     <td>
61                         [% PROCESS account_type_description account=outstanding_credit %]
62                         [%- PROCESS account_status_description account=outstanding_credit -%]
63                     </td>
64                     <td>
65                         [%- IF outstanding_credit.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', outstanding_credit.payment_type, 1) | html %][% END %]
66                         [%- IF outstanding_credit.description %][% outstanding_credit.description | html %][% END %]
67                         [% IF outstanding_credit.itemnumber %]([% outstanding_credit.item.biblio.title | html %])[% END %]
68                     </td>
69                     <td class="credit">[% outstanding_credit.amount * -1 | $Price %]</td>
70                     <td class="credit">[% outstanding_credit.amountoutstanding * -1 | $Price %]</td>
71                 </tr>
72             [% END %]
73             <tr>
74                 <th class="sum" colspan="[% COLSPAN | html %]">Total due if credit(s) applied:</th>
75                 <td class="sum">[% total + outstanding_credits.total_outstanding | $Price %]</td>
76             </tr>
77             [% END %]
78         </tfoot>
79
80     </table>
81
82         [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
83             <fieldset class="pay-online hidden">
84                 <legend>Pay selected fines and charges</legend>
85                     <span class="help-block"><h3>Payment method</h3></span>
86
87                     [% IF Koha.Preference('EnablePayPalOpacPayments') %]
88                         <div class="control-group">
89                             <label class="radio">
90                                 <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
91                                 <!-- 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 -->
92                             </label>
93                         </div>
94                     [% END %]
95
96                     [% FOREACH p IN plugins %]
97                         <div class="control-group">
98                             <label class="radio">
99                                 <input type="radio" name="payment_method" id="payment_method-[% p.class | html %]" value="[% p.class | html %]" checked="checked">
100                                 [% p.get_metadata.name | html %]
101                             </label>
102                         </div>
103                     [% END %]
104
105                     <div class="control-group">
106                         <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
107                         <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
108                         <span id="amount-to-pay-label">
109                             Amount to pay: <span id="amount-to-pay">0.00</span>
110                         </span>
111                     </div>
112             </fieldset>
113         [% END %]
114     </form>
115 [% ELSE %]
116     <h4>You have no fines or charges</h4>
117 [% END %]
118
119 [%- BLOCK account_type_description -%]
120     [%- SWITCH account.accounttype -%]
121         [%- CASE 'Pay'     -%]<span>Payment
122         [%- CASE 'Pay00'   -%]<span>Payment (cash via SIP2)
123         [%- CASE 'Pay01'   -%]<span>Payment (VISA via SIP2)
124         [%- CASE 'Pay02'   -%]<span>Payment (credit card via SIP2)
125         [%- CASE 'N'       -%]<span>New card
126         [%- CASE 'OVERDUE' -%]<span>Fine
127         [%- CASE 'A'       -%]<span>Account management fee
128         [%- CASE 'M'       -%]<span>Sundry
129         [%- CASE 'L'       -%]<span>Lost item
130         [%- CASE 'W'       -%]<span>Writeoff
131         [%- CASE 'HE'      -%]<span>Hold waiting too long
132         [%- CASE 'Rent'    -%]<span>Rental fee
133         [%- CASE 'FOR'     -%]<span>Forgiven
134         [%- CASE 'LR'      -%]<span>Lost item fee refund
135         [%- CASE 'PF'      -%]<span>Lost item processing fee
136         [%- CASE 'PAY'     -%]<span>Payment
137         [%- CASE 'WO'      -%]<span>Writeoff
138         [%- CASE 'C'       -%]<span>Credit
139         [%- CASE 'CR'      -%]<span>Credit
140         [%- CASE 'Res'     -%]<span>Hold fee
141         [%- CASE           -%]<span>[% account.accounttype | html %]
142     [%- END -%]
143     [%- PROCESS account_status_description account=account -%]</span>
144 [%- END -%]
145
146 [%- BLOCK account_status_description -%]
147     [%- SWITCH account.status -%]
148         [%- CASE 'UNRETURNED' -%]<span> (Accruing)</span>
149         [%- CASE 'RETURNED'   -%]<span> (Returned)</span>
150         [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
151         [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
152         [%- CASE 'VOID'       -%]<span> (Voided)</span>
153         [%- CASE              -%]
154     [%- END -%]
155 [%- END -%]