myopac_cc_allowed = 0;
IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1;
myopac_cc_allowed = 1;
- END
+ END;
+ neg_or_zero = 0;
+ FOR f IN ctx.fines.circulation;
+ IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END;
+ END;
+ FOR f IN ctx.fines.grocery;
+ IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END;
+ END;
+ IF neg_or_zero > 0; myopac_cc_allowed = 0; END;
%]
[% IF myopac_cc_allowed; %]
<form action="[% ctx.opac_root %]/myopac/main_payment_form#payment" method="get" id="selected_fines">
</tr>
</thead>
<tbody id='myopac_circ_trans_tbody'>
- [% c = 0; neg_or_zero = 0; %]
+ [% c = 0; %]
[% FOR f IN ctx.fines.circulation;
attrs = {marc_xml => f.marc_xml};
IF f.marc_xml;
[% money(f.xact.balance_owed) %]
</strong>
<input class="fineAmount" value="[% f.xact.balance_owed %]" hidden />
- [% IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END %]
</td>
<td>
[% money(f.xact.balance_owed) %]
</strong>
<input type="hidden" class="fineAmount" value="[% f.xact.balance_owed %]" hidden />
- [% IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END %]
</td>
<td>
<script >
$( document ).ready(function() {
$("input[type=checkbox]").click(function () {
- var amount = 0;
+ var amount = 0;
$("td input:checked").each(function () {
- var item = jQuery( this ).parent().parent().children("td").children(".fineAmount").attr("value");
+ var item = jQuery( this ).parent().parent().children("td").children(".fineAmount").attr("value");
item = parseFloat(item);
amount += item;
});
myopac_cc_allowed = 0;
IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1;
myopac_cc_allowed = 1;
- END
+ END;
+ neg_or_zero = 0;
+ FOR f IN ctx.fines.circulation;
+ IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END;
+ END;
+ FOR f IN ctx.fines.grocery;
+ IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END;
+ END;
+ IF neg_or_zero > 0; myopac_cc_allowed = 0; END
%]
<h3 class="sr-only">[% l('My Account Summary') %]</h3>
[% IF myopac_cc_allowed;
</tr>
</thead>
<tbody id='myopac_circ_trans_tbody'>
- [% neg_or_zero = 0; %]
[% FOR f IN ctx.fines.circulation;
attrs = {marc_xml => f.marc_xml};
IF f.marc_xml;
<td>
<strong class="alert">
[% money(f.xact.balance_owed)%]
- [% IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END %]
</strong>
</td>
<td class="mobile_hide">
[% f.xact.last_billing_type %]
</td>
-
+
<td>
[% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
IF recid; %]
<strong>
[% money(f.xact.balance_owed) %]
</strong>
- [% IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END %]
</td>
<td>[% f.xact.last_billing_type %]</td>
<span class='[% ctx.user_stats.fines.balance_owed ? "alert" : ""%]'>
[% money(ctx.user_stats.fines.balance_owed) %]
</span><br />
- [% IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1 %]
+ [%
+ allow_pay_all_charges = 0;
+ IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1;
+ allow_pay_all_charges = 1;
+ END;
+ neg_or_zero = 0;
+ FOR f IN ctx.fines.circulation;
+ IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END;
+ END;
+ FOR f IN ctx.fines.grocery;
+ IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END;
+ END;
+ IF neg_or_zero > 0; allow_pay_all_charges = 0; END
+ %]
+ [% IF allow_pay_all_charges %]
<form action="[% ctx.opac_root %]/myopac/main_payment_form" method="get"><input
type="submit" title="[% l('Pay All Charges') %]"
value="[% l('Pay All Charges') %]" class="pos-rel-top-5 opac-button" /></form>