Bug 26265: (QA follow-up) Remove g option from regex, add few dirs
[koha-equinox.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / account-table.inc
1 <h3>Charges</h3>
2
3 <form method="post" action="opac-account-pay.pl" class="form-horizontal">
4 [% IF ( ACCOUNT_LINES ) %]
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                     </td>
33                     <td>
34                         [%- IF ACCOUNT_LINE.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) | html %][% END %]
35                         [%- IF ACCOUNT_LINE.description %][% ACCOUNT_LINE.description | html %][% END %]
36                         [% IF ACCOUNT_LINE.itemnumber %]([% ACCOUNT_LINE.item.biblio.title | html %])[% END %]
37                     </td>
38                     [% IF ( ACCOUNT_LINE.is_credit ) %]<td class="credit">[% ACCOUNT_LINE.amount * -1 | $Price %][% ELSE %]<td class="debit">[% ACCOUNT_LINE.amount | $Price %][% END %]</td>
39                     [% IF ( ACCOUNT_LINE.is_credit ) %]<td class="credit">[% ACCOUNT_LINE.amountoutstanding * -1 | $Price %][% ELSE %]<td class="debit">[% ACCOUNT_LINE.amountoutstanding | $Price %][% END %]</td>
40                 </tr>
41             [% END %]
42         </tbody>
43
44         <tfoot>
45             <tr>
46                 [%- IF ENABLE_OPAC_PAYMENTS -%]
47                     [%- SET COLSPAN = 5 -%]
48                 [%- ELSE -%]
49                     [%- SET COLSPAN = 4 -%]
50                 [%- END -%]
51                 <th class="sum" colspan="[% COLSPAN | html %]">Total due</th>
52                 <td class="sum">[% total | $Price %]</td>
53             </tr>
54             [% IF outstanding_credits.total_outstanding < 0 %]
55             [% FOREACH outstanding_credit IN outstanding_credits %]
56                 [% IF outstanding_credit.amountoutstanding < 0 %]<tr class="outstanding">[% ELSE %]<tr>[% END%]
57                     [% IF ENABLE_OPAC_PAYMENTS %]<td></td>[% END %]
58                     <td><span title="[% outstanding_credit.date | html %]">[% outstanding_credit.date | $KohaDates %]</span></td>
59                     <td>
60                         [% PROCESS account_type_description account=outstanding_credit %]
61                     </td>
62                     <td>
63                         [%- IF outstanding_credit.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', outstanding_credit.payment_type, 1) | html %][% END %]
64                         [%- IF outstanding_credit.description %][% outstanding_credit.description | html %][% END %]
65                         [% IF outstanding_credit.itemnumber %]([% outstanding_credit.item.biblio.title | html %])[% END %]
66                     </td>
67                     <td class="credit">[% outstanding_credit.amount * -1 | $Price %]</td>
68                     <td class="credit">[% outstanding_credit.amountoutstanding * -1 | $Price %]</td>
69                 </tr>
70             [% END %]
71             <tr>
72                 <th class="sum" colspan="[% COLSPAN | html %]">Total due if credit(s) applied:</th>
73                 <td class="sum">[% total + outstanding_credits.total_outstanding | $Price %]</td>
74             </tr>
75             [% END %]
76         </tfoot>
77
78     </table>
79
80
81 [% ELSE %]
82     <h4>You have no fines or charges</h4>
83 [% END %]
84
85 [% FOREACH r IN relatives %]
86     <h3 id="g[% r.patron.id | html %]">[% r.patron.firstname | html %] [% r.patron.surname | html %]'s fines and charges</h3>
87
88     <table class="table table-bordered table-striped" id="finestable-[% r.id | html %]">
89         <thead>
90             <tr>
91                 [% IF ENABLE_OPAC_PAYMENTS %]<th>&nbsp;</th>[% END %]
92                 <th class="title-string">Date</th>
93                 <th>Description</th>
94                 <th>Fine amount</th>
95                 <th>Amount outstanding</th>
96             </tr>
97         </thead>
98
99         <tbody>
100             [% SET account_sum = 0 %]
101             [% FOREACH a IN r.accountlines %]
102                 [% SET account_sum = account_sum + a.amountoutstanding %]
103                 <tr>
104                     [% IF ENABLE_OPAC_PAYMENTS %]
105                         <td>
106                             [% IF a.amountoutstanding > 0 %]
107                                 [% SET DISPLAY_PAYMENT_BLOCK = 1 %]
108                                 <input class="checkbox-pay pay-online hidden" name="accountline" type="checkbox" id="checkbox-pay-[% a.accountlines_id | html %]" value="[% a.accountlines_id | html %]">
109                                 <input type="hidden" id="amount-[% a.accountlines_id | html %]" value="[% a.amountoutstanding | html %]" />
110                             [% END %]
111                         </td>
112                     [% END %]
113                     <td><span title="[% a.date | html %]">[% a.date | $KohaDates %]</span></td>
114                     <td>
115                         [% PROCESS account_type_description account=a %]
116                         [%- IF a.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', a.payment_type, 1) | html %][% END %]
117                         [%- IF a.description %], [% a.description | html %][% END %]
118                         [% IF a.itemnumber %]([% a.item.biblio.title | html %])[% END %]
119                     </td>
120                     [% IF ( a.amount < 0 ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% a.amount | $Price %]</td>
121                     [% IF ( a.amountoutstanding < 0 ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% a.amountoutstanding | $Price %]</td>
122                 </tr>
123             [% END %]
124         </tbody>
125
126         <tfoot>
127             <tr>
128                 <th class="sum" colspan="3">Total due</th>
129                 <td class="sum">[% account_sum | $Price %]</td>
130             </tr>
131         </tfoot>
132     </table>
133 [% END %]
134
135 [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
136     <fieldset class="pay-online hidden">
137         <legend>Pay selected fines and charges</legend>
138             <span class="help-block"><h3>Payment method</h3></span>
139
140             [% IF Koha.Preference('EnablePayPalOpacPayments') %]
141                 <div class="control-group">
142                     <label class="radio">
143                         <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
144                         <!-- 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 -->
145                     </label>
146                 </div>
147             [% END %]
148
149             [% FOREACH p IN plugins %]
150                 <div class="control-group">
151                     <label class="radio">
152                         <input type="radio" data-threshold="[% p.opac_online_payment_threshold | html %]" name="payment_method" id="payment_method-[% p.class | html %]" value="[% p.class | html %]" checked="checked">
153                         [% p.get_metadata.name | html %]
154                     </label>
155                     <small class="help-block text-muted"></small>
156                 </div>
157             [% END %]
158
159             <div class="control-group">
160                 <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
161                 <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
162                 <span id="amount-to-pay-label">
163                     Amount to pay: <span id="amount-to-pay">0.00</span>
164                 </span>
165             </div>
166     </fieldset>
167 [% END %]
168 </form>
169
170 [%- BLOCK account_type_description -%]
171     <span>
172     [%- IF account.credit_type_code -%]
173         [%- SWITCH account.credit_type_code -%]
174             [%- CASE 'PAYMENT'          -%]Payment
175             [%- CASE 'WRITEOFF'         -%]Writeoff
176             [%- CASE 'FORGIVEN'         -%]Forgiven
177             [%- CASE 'CREDIT'           -%]Credit
178             [%- CASE 'LOST_FOUND'       -%]Lost item fee refund
179             [%- CASE                    -%][% account.credit_type.description | html %]
180         [%- END -%]
181     [%- ELSIF account.debit_type_code -%]
182        [%- SWITCH account.debit_type_code -%]
183            [%- CASE 'ACCOUNT'          -%]Account creation fee
184            [%- CASE 'ACCOUNT_RENEW'    -%]Account renewal fee
185            [%- CASE 'LOST'             -%]Lost item
186            [%- CASE 'MANUAL'           -%]Manual fee
187            [%- CASE 'NEW_CARD'         -%]New card
188            [%- CASE 'OVERDUE'          -%]Fine
189            [%- CASE 'PROCESSING'       -%]Lost item processing fee
190            [%- CASE 'RENT'             -%]Rental fee
191            [%- CASE 'RENT_DAILY'       -%]Daily rental fee
192            [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
193            [%- CASE 'RENT_DAILY_RENEW' -%]Renewal of daily rental item
194            [%- CASE 'RESERVE'          -%]Hold fee
195            [%- CASE 'RESERVE_EXPIRED'  -%]Hold waiting too long
196            [%- CASE                    -%][% account.debit_type.description | html %]
197        [%- END -%]
198     [%- END -%]
199     [%- SWITCH account.status -%]
200         [%- CASE 'UNRETURNED' -%]<span> (Accruing)</span>
201         [%- CASE 'RETURNED'   -%]<span> (Returned)</span>
202         [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
203         [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
204         [%- CASE 'VOID'       -%]<span> (Voided)</span>
205         [%- CASE 'LOST'       -%]<span> (Lost)</span>
206         [%- CASE              -%]
207     [%- END -%]
208     </span>
209 [%- END -%]