1 [% PROCESS "opac/parts/header.tt2";
2 PROCESS "opac/parts/misc_util.tt2";
3 WRAPPER "opac/parts/myopac/main_base.tt2";
5 myopac_main_page = "main";
7 IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1;
11 <h3 class="sr-only">[% l('My Account Summary') %]</h3>
12 [% IF myopac_cc_allowed;
13 # http://www.w3.org/TR/WCAG20-TECHS/H32.html
14 # avoid forms w/ no submit action %]
15 <form action="[% ctx.opac_root %]/myopac/main_payment_form" method="get">
18 [% IF ctx.fines.circulation.size > 0 %]
19 <div id='myopac_circ_trans_div'>
20 <table width='100%' class='data_grid' title="[% l('Items Checked Out') %]">
23 <td colspan='10' style='padding: 6px'>
24 <strong>[% l("Fines") %]</strong>
28 <td>[% l("Title") %]</td>
29 <td>[% l("Author") %]</td>
30 <td>[% l("Checkout Date") %]</td>
31 <td>[% l("Due Date") %]</td>
32 <td>[% l("Date Returned") %]</td>
33 <td>[% l("Balance Owed") %]</td>
34 [% IF myopac_cc_allowed %]
35 <td nowrap="nowrap" style="white-space:nowrap;">
36 <input id="pay_fines_box1" checked="checked"
37 type="checkbox" onclick="select_all_checkboxes('xact', this.checked)"
38 title="[% l('Click to (un)select all fines') %]" />
39 <label for="pay_fines_box1">[% l('Pay Fines') %]</label>
44 <tbody id='myopac_circ_trans_tbody'>
45 [% FOR f IN ctx.fines.circulation;
46 attrs = {marc_xml => f.marc_xml};
48 PROCESS get_marc_attrs args=attrs;
49 ELSIF f.xact.reservation;
50 attrs.title = f.xact.reservation.target_resource_type.name;
52 <tr id='myopac_circ_trans_row'>
54 [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
56 <a href="[% mkurl(ctx.opac_root _ '/record/' _ recid,
57 {loc => ctx.search_ou}) %]">[% attrs.title | html %]</a>
59 [% attrs.title | html %]
62 <td>[%- author_query = attrs.author.replace('[,\.:;]', ''); %]
63 <a href="[% mkurl(ctx.opac_root _ '/results',
64 {qtype => 'author', query => author_query,
65 loc => ctx.search_ou}) %]">[% attrs.author | html %]</a>
67 <td name='myopac_circ_trans_start'>
68 [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
70 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
73 <td name='myopac_circ_trans_due'>
74 [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;
75 due_org = f.xact.circulation.circ_lib || f.xact.reservation.pickup_lib;
77 date.format(ctx.parse_datetime(ts, due_org), DATE_FORMAT);
80 <td name='myopac_circ_trans_finished'>
81 [% ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
83 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
85 <!-- XXX TODO fines aren't really accruing
86 if circ has hit maxfines. more clarity
88 <span class="alert">[% l('(fines accruing)') %]</span>
92 <strong class="alert">
93 [% money(f.xact.balance_owed) %]
96 [% IF myopac_cc_allowed %]
98 <input type="checkbox" checked="checked"
99 title="[% l('Pay this fine') %]" name="xact"
100 value="[% f.xact.id %]" />
110 [% IF ctx.fines.grocery.size > 0 %]
111 <!-- Table for all non-circulation transactions -->
112 <div id='myopac_trans_div'>
114 <hr class='opac-auto-013' color="#dcdbdb" />
116 <table width='100%' class='data_grid data_grid_center'
117 id='myopac_trans_table' title="[% l('Other Fines and Fees') %]">
120 <td colspan='8' style='padding: 6px'>
121 <span class="bold">[% l("Other Fees") %]</span>
125 <td width='16%'>[% l("Transaction Start Time") %]</td>
126 <td width='16%'>[% l("Last Payment Time") %]</td>
127 <td width='16%'>[% l("Initial Amount Owed") %]</td>
128 <td width='16%'>[% l("Total Amount Paid") %]</td>
129 <td width='16%'>[% l("Balance Owed") %]</td>
130 <td width='16%'>[% l("Billing Type") %]</td>
131 [% IF myopac_cc_allowed %]
132 <td width='4%' align="center" nowrap="nowrap"
133 style="white-space:nowrap;">
134 <input id="pay_fines_box2" checked="checked"
135 type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
136 title="[% l('Click to (un)select all fines') %]" />
137 <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
142 <tbody id='myopac_trans_tbody'>
143 [% FOR f IN ctx.fines.grocery %]
144 <tr id='myopac_trans_row'>
146 ctx.parse_datetime(f.xact.xact_start),
150 [% IF f.xact.last_payment_ts;
153 f.xact.last_payment_ts
158 <td>[% money(f.xact.total_owed) %]</td>
159 <td>[% money(f.xact.total_paid) %]</td>
162 [% money(f.xact.balance_owed) %]
165 <td>[% f.xact.last_billing_type %]</td>
166 [% IF myopac_cc_allowed %]
168 <input type="checkbox" title='[% l("Pay this fine") %]'
169 name="xact_misc" value="[% f.xact.id %]"
179 [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
180 <div>[% l('You have no current fines.') %]</div>
181 [% ELSIF myopac_cc_allowed %]
182 <div class="text-right pad-top-ten">
184 value="[% l('Pay selected fines') %]"
185 title="[% l('Pay selected fines') %]"
186 class="opac-button" />
189 [% IF myopac_cc_allowed %]