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