]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/main_payments.tt2
Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac...
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / main_payments.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     WRAPPER "opac/parts/myopac/main_base.tt2";
4     myopac_page = "main";
5     myopac_main_page = "payments";
6     limit = ctx.payment_history_limit;
7     offset = ctx.payment_history_offset;
8 %]
9
10 <div>
11     <div class="header_middle">
12         <span class="float-left">[% l('Payments History') %]</span>
13         <span class='float-left' style='padding-left: 10px;'>
14             <a href='main_payments?limit=[% limit %]&amp;offset=[% offset - limit %]'
15                 [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
16             [%# TODO: get total to prevent paging off then end of the list.. %]
17             <a href='main_payments?limit=[% limit %]&amp;offset=[% offset + limit %]'
18                [% IF ctx.payments.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
19         </span>
20     </div>
21     <div class="clear-both"></div>
22
23     [% IF ctx.payments.size %]
24     <table class='myopac_payments_table data_grid' width='100%'>
25         <thead><tr>
26             <th>[% l('Payment Date') %]</th>
27             <th>[% l('Payment For') %]</th>
28             <th>[% l('Amount') %]</th>
29             <th>[% l('Receipt') %]</th> 
30         </tr></thead>
31         <tbody>
32             [% FOR payment IN ctx.payments %]
33             <tr>
34                 <td>[% date.format(ctx.parse_datetime(payment.mp.payment_ts), DATE_FORMAT) %]</td>
35                 <td>[% 
36                     btype = payment.last_billing_type | html;
37                     ptitle = payment.title | html;
38                     (payment.xact_type == 'grocery') ? btype : ptitle
39                 %]</td>
40                 <td>[% money(payment.mp.amount) %]</td>
41                 <td>
42                     <form action="[% ctx.opac_root %]/myopac/receipt_print" method="POST">
43                         <input type="hidden" name="payment" value="[% payment.mp.id %]" />
44                         <input type="submit" value="[% l('Print') %]" />
45                     </form>
46                     <form action="[% ctx.opac_root %]/myopac/receipt_email" method="POST">
47                         <input type="hidden" name="payment" value="[% payment.mp.id %]" />
48                         <input type="submit" value="[% l('Email') %]" />
49                     </form>
50                 </td>
51             </tr>
52             [% END %]
53         </tbody>
54     </table>
55     [% ELSE %]
56     <div>[% l('You have no historical payments to display.') %]</div>
57     [% END %]
58 </div>
59 [% END %]