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#payment" method="get" id="selected_fines" class="my-3">
18 [% IF ctx.fines.circulation.size > 0 %]
19 <div id='myopac_circ_trans_div'>
20 <!--moved tables heading to outside of the table itself - took internal styling -->
21 <div class="header_middle">
22 <span class="acct_fines_header">
23 <!-- Different heading when not able to pay -->
24 [% IF myopac_cc_allowed %]
25 [% l("Pay Selected Circulation Charges") %]
27 [% l("Circulation Charges") %]
33 <table id="acct_fines_main_header" class="table table-hover miniTable chargesMainTable" title="[% l('Items Checked Out') %]">
38 [% IF myopac_cc_allowed %]
39 <th nowrap="nowrap" style="white-space:nowrap;">
40 <input id="pay_fines_box1" checked="checked"
41 type="checkbox" onclick="select_all_checkboxes('xact', this.checked)"
42 title="[% l('Click to (un)select all charges') %]" />
45 <th>[% l("Owed") %]</th>
46 <th class="mobile_hide">[% l("Billing Type") %]</th>
47 <th>[% l("Title") %]</th>
48 <th class='mobile_hide'>[% l("Checkout") %]</th>
49 <th>[% l(" Due ") %]</th>
51 <span class="mobile_hide">[% l(" Returned/Renewed") %]</span>
52 <span class="mobile_view">[% l(" Returned*") %]</span>
57 <tbody id='myopac_circ_trans_tbody'>
58 [% FOR f IN ctx.fines.circulation;
59 attrs = {marc_xml => f.marc_xml};
61 PROCESS get_marc_attrs args=attrs;
62 ELSIF f.xact.reservation;
63 attrs.title = f.xact.reservation.target_resource_type.name;
65 <tr id='myopac_circ_trans_row'>
66 [% IF myopac_cc_allowed %]
68 <input type="checkbox" checked="checked"
69 title="[% l('Pay this fine') %]" name="xact"
70 value="[% f.xact.id %]" class="fineCheck"/>
75 <strong class="fineAmount" value="[% f.xact.balance_owed %]">
76 [% money(f.xact.balance_owed) %]
80 <td class="mobile_hide">
81 [% f.xact.last_billing_type %]
85 [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
87 <a href="[% mkurl(ctx.opac_root _ '/record/' _ recid,
88 {loc => ctx.search_ou}) %]">[% attrs.title | html %]</a>
90 [% attrs.title | html %]
94 <td name='myopac_circ_trans_start' class='mobile_hide'>
95 [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
97 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
101 <td name='myopac_circ_trans_due' >
102 [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;
103 due_org = f.xact.circulation.circ_lib || f.xact.reservation.pickup_lib;
105 date.format(ctx.parse_datetime(ts, due_org), DATE_FORMAT);
109 <td name='myopac_circ_trans_finished' >
110 [% ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
112 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
114 <!-- XXX TODO fines aren't really accruing
115 if circ has hit maxfines. more clarity
117 <span class="alert">[% l('(fines accruing)') %]</span>
125 <!-- Disclaimer for mobile -->
126 <span class="mobile_view cc_disclaimer"> <strong>*</strong>Items may have been renewed. </span>
130 [% IF ctx.fines.grocery.size > 0 %]
131 <!-- Table for all non-circulation transactions -->
132 <div id='myopac_trans_div'>
133 <h2 class="acct_fines_header text-center">
134 [% l("Charges On Your Account") %]
138 <table id="acct_fees_main_header" class="table table-hover miniTable chargesTable my-3" title="[% l('Other Fines and Fees') %]">
142 [% IF myopac_cc_allowed %]
143 <th nowrap="nowrap" style="white-space:nowrap;">
144 <input id="pay_fines_box2" checked="checked"
145 type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
146 title="[% l('Click to (un)select all fines') %]" />
149 <th >[% l("Owed") %]</th>
150 <th >[% l("Billing Type") %]</th>
151 <th >[% l("Note") %]</th>
152 <th >[% l("Date") %]</th>
157 <tbody id='myopac_trans_tbody'>
159 [% FOR f IN ctx.fines.grocery %]
160 <tr id='myopac_trans_row'>
162 [% IF myopac_cc_allowed %]
164 <span class="sr-only">Billing Number [% c %]</span>
165 <input class="fineCheck" type="checkbox" title='[% l("Pay this fine") %]' name="xact_misc" value="[% f.xact.id %]" checked="checked" />
170 <span class="sr-only">Amount Owed</span>
171 <strong class="fineAmount" value="[% f.xact.balance_owed %]">
172 [% money(f.xact.balance_owed) %]
177 <span class="sr-only">Billing For</span>
178 [% f.xact.last_billing_type %]
182 [% IF f.xact.last_billing_note; %]
183 <span class="sr-only">Note</span>
184 [% f.xact.last_billing_note %]
189 <span class="sr-only">Date of Billing</span>
190 [% date.format(ctx.parse_datetime(f.xact.xact_start),DATE_FORMAT) %]
200 [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
201 <div>[% l('You have no current fines.') %]</div>
202 [% ELSIF myopac_cc_allowed %]
206 value="[% l('Pay selected charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]"
207 title="[% l('Pay selected charges') %]"
208 class="btn btn-confirm my-1"
210 <form action="[% ctx.opac_root %]/myopac/main_payment_form" method="get"><input
211 type="submit" title="[% l('Pay All Charges') %] "
212 value="[% l('Pay All Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]" class="btn btn-confirm my-1" /></form>
215 [% IF myopac_cc_allowed %]
220 <!--Table functions ~ Running total of selected items for use in a Paypal module or where running total is needed-->
222 jQuery("input[type=checkbox]").click(function () {
224 jQuery("td input:checked").each(function () {
225 var item = jQuery( this ).parent().parent().children("td").children(".fineAmount").attr("value");
226 item = parseFloat(item);
229 jQuery("#total").val(amount);
230 jQuery("#selectPay").val('Pay selected charges - $' + amount.toFixed(2));