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' class="mt-3">
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 <div class="table-responsive">
147 <table id="acct_fees_main_header" class="table table-hover table-bordered my-3" title="[% l('Other Fines and Fees') %]">
151 [% IF myopac_cc_allowed %]
152 <th style="white-space:nowrap;">
153 <input id="pay_fines_box2" checked="checked"
154 type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
155 aria-label="[% l('Check/Uncheck All') %]" />
158 <th >[% l("Owed") %]</th>
159 <th >[% l("Billing Type") %]</th>
160 <th >[% l("Note") %]</th>
161 <th >[% l("Date") %]</th>
166 <tbody id='myopac_trans_tbody'>
167 [% c = 0; neg_or_zero = 0; %]
168 [% FOR f IN ctx.fines.grocery %]
169 <tr class ='myopac_trans_row'>
171 [% IF myopac_cc_allowed %]
172 <td class="checkCell">
173 <label class="sr-only">Billing Number [% c %]</label>
174 <input aria-label="Pay This Bill" class="fineCheck" type="checkbox" name="xact_misc" value="[% f.xact.id %]" checked="checked" />
179 <span class="sr-only">Amount Owed</span>
181 [% money(f.xact.balance_owed) %]
183 <input type="hidden" class="fineAmount" value="[% f.xact.balance_owed %]" hidden />
184 [% IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END %]
188 <span class="sr-only">Billing For</span>
189 [% f.xact.last_billing_type %]
193 [% IF f.xact.last_billing_note; %]
194 <span class="sr-only">Note</span>
195 [% f.xact.last_billing_note %]
200 <span class="sr-only">Date of Billing</span>
201 [% date.format(ctx.parse_datetime(f.xact.xact_start),DATE_FORMAT) %]
212 [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
213 <div>[% l('You have no current fines.') %]</div>
214 [% ELSIF myopac_cc_allowed %]
215 [% IF neg_or_zero > 0 %]
216 <div class="my-3">[% l('There are negative bills on your account that must be resolved before you are able to make a payment. Please contact your library for assistance.') %]
219 <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"
220 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>
221 <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>
225 [% IF myopac_cc_allowed %]
229 $( document ).ready(function() {
230 $("input[type=checkbox]").click(function () {
232 $("td input:checked").each(function () {
233 var item = jQuery( this ).parent().parent().children("td").children(".fineAmount").attr("value");
234 item = parseFloat(item);
237 $("#total").val(amount);
238 $("#selectPay").html('<i class="fas fa-money-bill-wave" aria-hidden="true"></i> Pay Selected Charges - $' + amount.toFixed(2));
245 <!--Table functions ~ Running total of selected items for use in a Paypal module or where running total is needed-->