1 [% PROCESS "opac/parts/header.tt2";
2 PROCESS "opac/parts/misc_util.tt2";
3 WRAPPER "opac/parts/myopac/base.tt2";
4 myopac_page = "charges";
5 myopac_main_page = "main";
8 IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1;
12 [% IF myopac_cc_allowed; %]
13 <form action="[% ctx.opac_root %]/myopac/main_payment_form#payment" method="get" id="selected_fines">
16 [% IF ctx.fines.circulation.size > 0 %]
17 <div id='myopac_circ_trans_div'>
18 <div class="header_middle">
19 <span class="acct_fines_header">
20 <!-- Different heading when not able to pay -->
21 [% IF myopac_cc_allowed %]
22 [% l("Pay Selected Circulation Charges") %]
24 [% l("Circulation Charges") %]
32 <table id="acct_fines_main_header" class="table table-hover table-responsive table-bordered miniTable chargesMainTable" title="[% l('Items Checked Out') %]">
37 [% IF myopac_cc_allowed %]
38 <th style="white-space:nowrap;">
39 <input id="pay_fines_box1" checked="checked"
40 type="checkbox" onclick="select_all_checkboxes('xact', this.checked)"
41 title="[% l('Click to (un)select all charges') %]" />
44 <th>[% l("Owed") %]</th>
45 <th>[% l("Billing Type") %]</th>
46 <th>[% l("Title") %]</th>
47 <th>[% l("Checkout") %]</th>
48 <th>[% l(" Due ") %]</th>
50 <span>[% l(" Returned/Renewed") %]</span>
51 <span>[% l(" Returned*") %]</span>
56 <tbody id='myopac_circ_trans_tbody'>
57 [% FOR f IN ctx.fines.circulation;
58 attrs = {marc_xml => f.marc_xml};
60 PROCESS get_marc_attrs args=attrs;
61 ELSIF f.xact.reservation;
62 attrs.title = f.xact.reservation.target_resource_type.name;
64 <tr id='myopac_circ_trans_row'>
65 [% IF myopac_cc_allowed %]
66 <td class="checkCell">
67 <input type="checkbox" checked="checked"
68 title="[% l('Pay this fine') %]" name="xact"
69 value="[% f.xact.id %]" class="fineCheck"/>
75 [% money(f.xact.balance_owed) %]
77 <input class="fineAmount" value="[% f.xact.balance_owed %]" hidden />
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'>
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="danger">[% 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'>
134 [% l("Charges On Your Account") %]
137 [% IF myopac_cc_allowed %]
138 <div class="d-block d-md-none">
139 <input id="pay_fines_check" checked="checked"
140 type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
141 aria-label="[% l('Check/Uncheck All') %]" />
142 <label for="pay_fines_check">[% l('Check/Uncheck All') %]</label>
146 <table id="acct_fees_main_header" class="table table-hover table-bordered miniTable chargesTable my-3" title="[% l('Other Fines and Fees') %]">
150 [% IF myopac_cc_allowed %]
151 <th style="white-space:nowrap;">
152 <input id="pay_fines_box2" checked="checked"
153 type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
154 aria-label="[% l('Check/Uncheck All') %]" />
157 <th >[% l("Owed") %]</th>
158 <th >[% l("Billing Type") %]</th>
159 <th >[% l("Note") %]</th>
160 <th >[% l("Date") %]</th>
165 <tbody id='myopac_trans_tbody'>
167 [% FOR f IN ctx.fines.grocery %]
168 <tr class ='myopac_trans_row'>
170 [% IF myopac_cc_allowed %]
171 <td class="checkCell">
172 <label class="sr-only">Billing Number [% c %]</label>
173 <input aria-label="Pay This Bill" class="fineCheck" type="checkbox" name="xact_misc" value="[% f.xact.id %]" checked="checked" />
178 <span class="sr-only">Amount Owed</span>
180 [% money(f.xact.balance_owed) %]
182 <input type="hidden" class="fineAmount" value="[% f.xact.balance_owed %]" hidden />
186 <span class="sr-only">Billing For</span>
187 [% f.xact.last_billing_type %]
191 [% IF f.xact.last_billing_note; %]
192 <span class="sr-only">Note</span>
193 [% f.xact.last_billing_note %]
198 <span class="sr-only">Date of Billing</span>
199 [% date.format(ctx.parse_datetime(f.xact.xact_start),DATE_FORMAT) %]
209 [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
210 <div>[% l('You have no current fines.') %]</div>
211 [% ELSIF myopac_cc_allowed %]
214 <button type="submit" value="[% l('Pay selected charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]" title="[% l('Pay selected charges') %]" class="btn btn-confirm my-1"
215 id="selectPay"> <i class='fas fa-money-bill-wave' aria-hidden="true"></i> [% l('Pay Selected Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]</button>
216 <button type="submit" class="btn btn-confirm my-1"><i class="fas fa-cash-register" aria-hidden="true"></i> [% l('Pay All Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]</button>
219 [% IF myopac_cc_allowed %]
223 $( document ).ready(function() {
224 $("input[type=checkbox]").click(function () {
226 $("td input:checked").each(function () {
227 var item = jQuery( this ).parent().parent().children("td").children(".fineAmount").attr("value");
228 item = parseFloat(item);
231 $("#total").val(amount);
232 $("#selectPay").html('<i class="fas fa-money-bill-wave" aria-hidden="true"></i> Pay Selected Charges - $' + amount.toFixed(2));
239 <!--Table functions ~ Running total of selected items for use in a Paypal module or where running total is needed-->