Bug 23049: Update debit_type_code 'Res' to 'RESERVE'
[koha.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                         [%- 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
83 [% ELSE %]
84     <h4>You have no fines or charges</h4>
85 [% END %]
86
87 [% FOREACH r IN relatives %]
88     <h3 id="g[% r.patron.id | html %]">[% r.patron.firstname | html %] [% r.patron.surname | html %]'s fines and charges</h3>
89
90     <table class="table table-bordered table-striped" id="finestable-[% r.id | html %]">
91         <thead>
92             <tr>
93                 [% IF ENABLE_OPAC_PAYMENTS %]<th>&nbsp;</th>[% END %]
94                 <th class="title-string">Date</th>
95                 <th>Description</th>
96                 <th>Fine amount</th>
97                 <th>Amount outstanding</th>
98             </tr>
99         </thead>
100
101         <tbody>
102             [% SET account_sum = 0 %]
103             [% FOREACH a IN r.accountlines %]
104                 [% SET account_sum = account_sum + a.amountoutstanding %]
105                 <tr>
106                     [% IF ENABLE_OPAC_PAYMENTS %]
107                         <td>
108                             [% IF a.amountoutstanding > 0 %]
109                                 [% SET DISPLAY_PAYMENT_BLOCK = 1 %]
110                                 <input class="checkbox-pay pay-online hidden" name="accountline" type="checkbox" id="checkbox-pay-[% a.accountlines_id | html %]" value="[% a.accountlines_id | html %]">
111                                 <input type="hidden" id="amount-[% a.accountlines_id | html %]" value="[% a.amountoutstanding | html %]" />
112                             [% END %]
113                         </td>
114                     [% END %]
115                     <td><span title="[% a.date | html %]">[% a.date | $KohaDates %]</span></td>
116                     <td>
117                         [% PROCESS account_type_description account=a %]
118                         [%- IF a.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', a.payment_type, 1) | html %][% END %]
119                         [%- IF a.description %], [% a.description | html %][% END %]
120                         [% IF a.itemnumber %]([% a.item.biblio.title | html %])[% END %]
121                     </td>
122                     [% IF ( a.amount < 0 ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% a.amount | $Price %]</td>
123                     [% IF ( a.amountoutstanding < 0 ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% a.amountoutstanding | $Price %]</td>
124                 </tr>
125             [% END %]
126         </tbody>
127
128         <tfoot>
129             <tr>
130                 <th class="sum" colspan="3">Total due</th>
131                 <td class="sum">[% account_sum | $Price %]</td>
132             </tr>
133         </tfoot>
134     </table>
135 [% END %]
136
137 [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
138     <fieldset class="pay-online hidden">
139         <legend>Pay selected fines and charges</legend>
140             <span class="help-block"><h3>Payment method</h3></span>
141
142             [% IF Koha.Preference('EnablePayPalOpacPayments') %]
143                 <div class="control-group">
144                     <label class="radio">
145                         <input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
146                         <!-- 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 -->
147                     </label>
148                 </div>
149             [% END %]
150
151             [% FOREACH p IN plugins %]
152                 <div class="control-group">
153                     <label class="radio">
154                         <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">
155                         [% p.get_metadata.name | html %]
156                     </label>
157                     <small class="help-block text-muted"></small>
158                 </div>
159             [% END %]
160
161             <div class="control-group">
162                 <input type="hidden" id="payment-amount" name="payment_amount" value="0" />
163                 <button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
164                 <span id="amount-to-pay-label">
165                     Amount to pay: <span id="amount-to-pay">0.00</span>
166                 </span>
167             </div>
168     </fieldset>
169 [% END %]
170 </form>
171
172 [%- BLOCK account_type_description -%]
173     <span>
174     [%- IF account.accounttype -%]
175         [%- SWITCH account.accounttype -%]
176             [%- CASE 'Pay'              -%]Payment
177             [%- CASE 'W'                -%]Writeoff
178             [%- CASE 'FOR'              -%]Forgiven
179             [%- CASE 'PAY'              -%]Payment
180             [%- CASE 'WO'               -%]Writeoff
181             [%- CASE 'C'                -%]Credit
182             [%- CASE 'LOST_RETURN'      -%]Lost item fee refund
183             [%- CASE                    -%][% account.accounttype | html %]
184         [%- END -%]
185     [%- ELSIF account.debit_type -%]
186        [%- SWITCH account.debit_type -%]
187            [%- CASE 'ACCOUNT'          -%]Account creation fee
188            [%- CASE 'ACCOUNT_RENEW'    -%]Account renewal fee
189            [%- CASE 'HE'               -%]Hold waiting too long
190            [%- CASE 'LOST'             -%]Lost item
191            [%- CASE 'M'                -%]Sundry
192            [%- CASE 'N'                -%]New card
193            [%- CASE 'OVERDUE'          -%]Fine
194            [%- CASE 'PF'               -%]Lost item processing fee
195            [%- CASE 'RENT'             -%]Rental fee
196            [%- CASE 'RENT_DAILY'       -%]Daily rental fee
197            [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
198            [%- CASE 'RENT_DAILY_RENEW' -%]Rewewal of daily rental item
199            [%- CASE 'RESERVE'          -%]Hold fee
200            [%- CASE                    -%][% account.debit_type.description | html %]
201        [%- END -%]
202     [%- END -%]
203     [%- PROCESS account_status_description account=account -%]
204     </span>
205 [%- END -%]
206
207 [%- BLOCK account_status_description -%]
208     [%- SWITCH account.status -%]
209         [%- CASE 'UNRETURNED' -%]<span> (Accruing)</span>
210         [%- CASE 'RETURNED'   -%]<span> (Returned)</span>
211         [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
212         [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
213         [%- CASE 'VOID'       -%]<span> (Voided)</span>
214         [%- CASE 'LOST'       -%]<span> (Lost)</span>
215         [%- CASE              -%]
216     [%- END -%]
217 [%- END -%]