From 851b4b5e3dab8d3d259d6cac9cd15d4b3ede938b Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Mon, 18 Jul 2022 15:02:54 -0400 Subject: [PATCH] LP1981628 follow-up to the follow-up Consolidate some of the logic to make it more clear what is happening, leverage the existing myopac_cc_allowed boolean, and catch the Pay All Charges button in the TPAC. This also clears up some display oddities and makes sure the non-payment labeling is being used. Signed-off-by: Jason Etheridge Signed-off-by: Galen Charlton --- .../src/templates-bootstrap/opac/myopac/charges.tt2 | 18 ++++++++++++------ Open-ILS/src/templates/opac/myopac/main.tt2 | 15 ++++++++++----- Open-ILS/src/templates/opac/parts/myopac/main_base.tt2 | 16 +++++++++++++++- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 index 1a4a671b51..31e5b107b8 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 @@ -7,7 +7,15 @@ 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; %]
@@ -54,7 +62,7 @@ - [% c = 0; neg_or_zero = 0; %] + [% c = 0; %] [% FOR f IN ctx.fines.circulation; attrs = {marc_xml => f.marc_xml}; IF f.marc_xml; @@ -76,7 +84,6 @@ [% money(f.xact.balance_owed) %] - [% IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END %] @@ -182,7 +189,6 @@ [% money(f.xact.balance_owed) %] - [% IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END %] @@ -229,9 +235,9 @@