start on cc payments
[evergreen-equinox.git] / Open-ILS / web / templates / default / opac / myopac / main.tt2
1 [%  PROCESS "default/opac/parts/header.tt2";
2     PROCESS "default/opac/parts/misc_util.tt2";
3     WRAPPER "default/opac/parts/myopac/main_base.tt2";
4     myopac_page = "main";
5     myopac_main_page = "main";
6 %]
7 <form action="[% ctx.opac_root %]/myopac/main_pay" method="POST">
8     [% IF ctx.fines.circulation.size > 0 %]
9     <div id='myopac_circ_trans_div'>
10         <table width='100%' class='data_grid'>
11             <thead>
12                 <tr>
13                     <td colspan='10' style='padding: 6px'>
14                         <strong>[% l("Fines") %]</strong>
15                     </td>
16                 </tr>
17                 <tr>
18                     <td>[% l("Title") %]</td>
19                     <td>[% l("Author") %]</td>
20                     <td>[% l("Checkout Date") %]</td>
21                     <td>[% l("Due Date") %]</td>
22                     <td>[% l("Date Returned") %]</td>
23                     <td>[% l("Balance Owed") %]</td>
24                     <td nowrap="nowrap" style="white-space:nowrap;">
25                         <!-- XXX TODO select all js --><input id="pay_fines_box1" checked="checked"
26                             type="checkbox" title="[% l('Click to (un)select all fines') %]" />
27                         <label for="pay_fines_box1">[% l('Pay Fines') %]</label>
28                     </td>
29                 </tr>
30             </thead>
31             <tbody id='myopac_circ_trans_tbody'>
32                 [% FOR f IN ctx.fines.circulation;
33                     attrs = {marc_xml => f.marc_xml};
34                     IF f.marc_xml;
35                         PROCESS get_marc_attrs args=attrs;
36                     ELSIF f.xact.reservation;
37                         attrs.title = f.xact.reservation.target_resource_type.name;
38                     END %]
39                 <tr id='myopac_circ_trans_row'>
40                     <td>
41                         [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
42                         IF recid; %]
43                         <a href="[% ctx.opac_root %]/record/[% recid %]">[% attrs.title %]</a>
44                         [% ELSE %]
45                         [% attrs.title %]
46                         [% END %]
47                     </td>
48                     <td>
49                         <a href="[% ctx.opac_root %]/results?qtype=author&amp;query=[% attrs.author | replace('[,\.:;]', '') | url %]">[% attrs.author %]</a>
50                     </td>
51                     <td name='myopac_circ_trans_start'>
52                         [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
53                         IF ts;
54                             date.format(ctx.parse_datetime(ts), DATE_FORMAT);
55                         END %]
56                     </td>
57                     <td name='myopac_circ_trans_due'>
58                         [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;
59                         IF ts;
60                             date.format(ctx.parse_datetime(ts), DATE_FORMAT);
61                         END %]
62                     </td>
63                     <td name='myopac_circ_trans_finished'>
64                         [%  ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
65                             IF ts;
66                                 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
67                             ELSE %]
68                             <!-- XXX TODO fines aren't really accruing
69                                 if circ has hit maxfines. more clarity
70                                 here? -->
71                             <span class="red">[% l('(fines accruing)') %]</span>
72                         [%  END %]
73                     </td>
74                     <td>
75                         <strong class="red">
76                             [% money(f.xact.balance_owed) %]
77                         </strong>
78                     </td>
79                     <td>
80                         <input type="checkbox" name="selector" title="[% l('Pay this fine') %]" />
81                     </td>
82                 </tr>
83                 [% END %]
84             </tbody>
85         </table>
86     </div>
87     [% END %]
88
89     [% IF ctx.fines.grocery.size > 0 %]
90     <!-- Table for all non-circulation transactions -->
91     <div id='myopac_trans_div'>
92         <br/>
93         <hr class='opac-auto-013'  color="#dcdbdb" />
94         <br/>
95         <table width='100%' class='data_grid data_grid_center'
96             id='myopac_trans_table'>
97             <thead>
98                 <tr>
99                     <td colspan='8' style='padding: 6px'>
100                         <b>[% l("Other Fees") %]</b>
101                     </td>
102                 </tr>
103                 <tr>
104                     <td width='16%'>[% l("Transaction Start Time") %]</td>
105                     <td width='16%'>[% l("Last Payment Time") %]</td>
106                     <td width='16%'>[% l("Initial Amount Owed") %]</td>
107                     <td width='16%'>[% l("Total Amount Paid") %]</td>
108                     <td width='16%'>[% l("Balance Owed") %]</td>
109                     <td width='16%'>[% l("Billing Type") %]</td>
110                     <td width='4%' align="center" nowrap="nowrap"
111                         style="white-space:nowrap;">
112                         <input id="pay_fines_box2" checked="checked"
113                             type="checkbox"
114                             title="[% l('Click to (un)select all fines') %]" />
115                         <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
116                     </td>
117                 </tr>
118             </thead>
119             <tbody id='myopac_trans_tbody'>
120                 [% FOR f IN ctx.fines.grocery %]
121                 <tr id='myopac_trans_row'>
122                     <td>[% date.format(
123                             ctx.parse_datetime(f.xact.xact_start),
124                             DATE_FORMAT
125                     ) %]</td>
126                     <td>
127                         [%  IF f.xact.last_payment_ts;
128                                 date.format(
129                                     ctx.parse_datetime(
130                                         f.xact.last_payment_ts
131                                     ), DATE_FORMAT
132                                 );
133                             END %]
134                     </td>
135                     <td>[% money(f.xact.total_owed) %]</td>
136                     <td>[% money(f.xact.total_paid) %]</td>
137                     <td class="red">
138                         <strong>
139                             [% money(f.xact.balance_owed) %]
140                         </strong>
141                     </td>
142                     <td>[% f.xact.last_billing_type %]</td>
143                     <td>
144                         <input type="checkbox" name='selector' title='[% l("Pay this fine") %]'/>
145                     </td>
146                 </tr>
147                 [% END %]
148             </tbody>
149         </table>
150     </div>
151     [% END %]
152     <div class="text-right pad-top-ten">
153         <input type="image"
154             alt="[% l('Pay selected fines') %]"
155             title="[% l('Pay selected fines') %]"
156             onmouseover="this.src='[% ctx.media_prefix %]/images/pay-fines-btn-hover.png';"
157             onmouseout="this.src='[% ctx.media_prefix %]/images/pay-fines-btn.png';"
158             src="[% ctx.media_prefix %]/images/pay-fines-btn.png" />
159     </div>
160 </form>
161 [% END %]