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 <form action="[% ctx.opac_root %]/myopac/main_payment_form" method="get">
12 [% IF ctx.fines.circulation.size > 0 %]
13 <div id='myopac_circ_trans_div'>
14 <table width='100%' class='data_grid'>
17 <td colspan='10' style='padding: 6px'>
18 <strong>[% l("Fines") %]</strong>
22 <td>[% l("Title") %]</td>
23 <td>[% l("Author") %]</td>
24 <td>[% l("Checkout Date") %]</td>
25 <td>[% l("Due Date") %]</td>
26 <td>[% l("Date Returned") %]</td>
27 <td>[% l("Balance Owed") %]</td>
28 [% IF myopac_cc_allowed %]
29 <td nowrap="nowrap" style="white-space:nowrap;">
30 <input id="pay_fines_box1" checked="checked"
31 type="checkbox" onclick="select_all_checkboxes('xact', this.checked)"
32 title="[% l('Click to (un)select all fines') %]" />
33 <label for="pay_fines_box1">[% l('Pay Fines') %]</label>
38 <tbody id='myopac_circ_trans_tbody'>
39 [% FOR f IN ctx.fines.circulation;
40 attrs = {marc_xml => f.marc_xml};
42 PROCESS get_marc_attrs args=attrs;
43 ELSIF f.xact.reservation;
44 attrs.title = f.xact.reservation.target_resource_type.name;
46 <tr id='myopac_circ_trans_row'>
48 [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
50 <a href="[% mkurl(ctx.opac_root _ '/record/' _ recid,
51 {loc => ctx.search_ou}) %]">[% attrs.title | html %]</a>
53 [% attrs.title | html %]
56 <td>[%- author_query = attrs.author.replace('[,\.:;]', ''); %]
57 <a href="[% mkurl(ctx.opac_root _ '/results',
58 {qtype => 'author', query => author_query,
59 loc => ctx.search_ou}) %]">[% attrs.author | html %]</a>
61 <td name='myopac_circ_trans_start'>
62 [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
64 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
67 <td name='myopac_circ_trans_due'>
68 [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;
70 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
73 <td name='myopac_circ_trans_finished'>
74 [% ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
76 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
78 <!-- XXX TODO fines aren't really accruing
79 if circ has hit maxfines. more clarity
81 <span class="alert">[% l('(fines accruing)') %]</span>
85 <strong class="alert">
86 [% money(f.xact.balance_owed) %]
89 [% IF myopac_cc_allowed %]
91 <input type="checkbox" checked="checked"
92 title="[% l('Pay this fine') %]" name="xact"
93 value="[% f.xact.id %]" />
103 [% IF ctx.fines.grocery.size > 0 %]
104 <!-- Table for all non-circulation transactions -->
105 <div id='myopac_trans_div'>
107 <hr class='opac-auto-013' color="#dcdbdb" />
109 <table width='100%' class='data_grid data_grid_center'
110 id='myopac_trans_table'>
113 <td colspan='8' style='padding: 6px'>
114 <b>[% l("Other Fees") %]</b>
118 <td width='16%'>[% l("Transaction Start Time") %]</td>
119 <td width='16%'>[% l("Last Payment Time") %]</td>
120 <td width='16%'>[% l("Initial Amount Owed") %]</td>
121 <td width='16%'>[% l("Total Amount Paid") %]</td>
122 <td width='16%'>[% l("Balance Owed") %]</td>
123 <td width='16%'>[% l("Billing Type") %]</td>
124 [% IF myopac_cc_allowed %]
125 <td width='4%' align="center" nowrap="nowrap"
126 style="white-space:nowrap;">
127 <input id="pay_fines_box2" checked="checked"
128 type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
129 title="[% l('Click to (un)select all fines') %]" />
130 <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
135 <tbody id='myopac_trans_tbody'>
136 [% FOR f IN ctx.fines.grocery %]
137 <tr id='myopac_trans_row'>
139 ctx.parse_datetime(f.xact.xact_start),
143 [% IF f.xact.last_payment_ts;
146 f.xact.last_payment_ts
151 <td>[% money(f.xact.total_owed) %]</td>
152 <td>[% money(f.xact.total_paid) %]</td>
155 [% money(f.xact.balance_owed) %]
158 <td>[% f.xact.last_billing_type %]</td>
159 [% IF myopac_cc_allowed %]
161 <input type="checkbox" title='[% l("Pay this fine") %]'
162 name="xact_misc" value="[% f.xact.id %]"
172 [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
173 <div>[% l('You have no current fines.') %]</div>
174 [% ELSIF myopac_cc_allowed %]
175 <div class="text-right pad-top-ten">
177 value="[% l('Pay selected fines') %]"
178 alt="[% l('Pay selected fines') %]"
179 title="[% l('Pay selected fines') %]"
180 class="opac-button" />