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;
76 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
79 <td name='myopac_circ_trans_finished'>
80 [% ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
82 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
84 <!-- XXX TODO fines aren't really accruing
85 if circ has hit maxfines. more clarity
87 <span class="alert">[% l('(fines accruing)') %]</span>
91 <strong class="alert">
92 [% money(f.xact.balance_owed) %]
95 [% IF myopac_cc_allowed %]
97 <input type="checkbox" checked="checked"
98 title="[% l('Pay this fine') %]" name="xact"
99 value="[% f.xact.id %]" />
109 [% IF ctx.fines.grocery.size > 0 %]
110 <!-- Table for all non-circulation transactions -->
111 <div id='myopac_trans_div'>
113 <hr class='opac-auto-013' color="#dcdbdb" />
115 <table width='100%' class='data_grid data_grid_center'
116 id='myopac_trans_table' title="[% l('Other Fines and Fees') %]">
119 <td colspan='8' style='padding: 6px'>
120 <span class="bold">[% l("Other Fees") %]</span>
124 <td width='16%'>[% l("Transaction Start Time") %]</td>
125 <td width='16%'>[% l("Last Payment Time") %]</td>
126 <td width='16%'>[% l("Initial Amount Owed") %]</td>
127 <td width='16%'>[% l("Total Amount Paid") %]</td>
128 <td width='16%'>[% l("Balance Owed") %]</td>
129 <td width='16%'>[% l("Billing Type") %]</td>
130 [% IF myopac_cc_allowed %]
131 <td width='4%' align="center" nowrap="nowrap"
132 style="white-space:nowrap;">
133 <input id="pay_fines_box2" checked="checked"
134 type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
135 title="[% l('Click to (un)select all fines') %]" />
136 <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
141 <tbody id='myopac_trans_tbody'>
142 [% FOR f IN ctx.fines.grocery %]
143 <tr id='myopac_trans_row'>
145 ctx.parse_datetime(f.xact.xact_start),
149 [% IF f.xact.last_payment_ts;
152 f.xact.last_payment_ts
157 <td>[% money(f.xact.total_owed) %]</td>
158 <td>[% money(f.xact.total_paid) %]</td>
161 [% money(f.xact.balance_owed) %]
164 <td>[% f.xact.last_billing_type %]</td>
165 [% IF myopac_cc_allowed %]
167 <input type="checkbox" title='[% l("Pay this fine") %]'
168 name="xact_misc" value="[% f.xact.id %]"
178 [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
179 <div>[% l('You have no current fines.') %]</div>
180 [% ELSIF myopac_cc_allowed %]
181 <div class="text-right pad-top-ten">
183 value="[% l('Pay selected fines') %]"
184 title="[% l('Pay selected fines') %]"
185 class="opac-button" />
188 [% IF myopac_cc_allowed %]