From 8e0b1657e19636ffd3c906e5e7f9c83801c7ccb6 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 20 Apr 2022 14:27:14 -0400 Subject: [PATCH] LP#1965579: stop gap for negative bills in OPAC (and zero bills). If a patron has zero-dollar or negative bills present, the OPAC will disallow payment and point the patron to their library to resolve. Cribbed from Terran's rel_3_8_0_temp_fix_for_stripe_negative_bill_bug @ evergreen/pines.git Signed-off-by: Jason Etheridge Signed-off-by: Terran McCanna Signed-off-by: Galen Charlton --- .../opac/myopac/charges.tt2 | 18 +++++++++++------- Open-ILS/src/templates/opac/myopac/main.tt2 | 18 ++++++++++++------ docs/RELEASE_NOTES_NEXT/miscellaneous.adoc | 1 + 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 index efb7276af7..653740ded0 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 @@ -164,7 +164,7 @@ - [% c = 0; %] + [% c = 0; neg_or_zero = 0; %] [% FOR f IN ctx.fines.grocery %] [% c = c + 1; %] @@ -181,6 +181,7 @@ [% money(f.xact.balance_owed) %] + [% IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END %] @@ -211,12 +212,15 @@ [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
[% l('You have no current fines.') %]
[% ELSIF myopac_cc_allowed %] - -
- - -
+ [% IF neg_or_zero > 0 %] +
[% 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.') %] + [% ELSE %] +
+ + +
+ [% END %] [% END %] [% IF myopac_cc_allowed %] diff --git a/Open-ILS/src/templates/opac/myopac/main.tt2 b/Open-ILS/src/templates/opac/myopac/main.tt2 index e6d7f1381e..87a3b3f85b 100644 --- a/Open-ILS/src/templates/opac/myopac/main.tt2 +++ b/Open-ILS/src/templates/opac/myopac/main.tt2 @@ -163,6 +163,7 @@ + [% neg_or_zero = 0; %] [% FOR f IN ctx.fines.grocery %] @@ -178,6 +179,7 @@ [% money(f.xact.balance_owed) %] + [% IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END %] [% f.xact.last_billing_type %] @@ -201,12 +203,16 @@ [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
[% l('You have no current fines.') %]
[% ELSIF myopac_cc_allowed %] -
- -
+ [% IF neg_or_zero > 0 %] +
[% 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.') %] + [% ELSE %] +
+ +
+ [% END %] [% END %] [% IF myopac_cc_allowed %] diff --git a/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc b/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc index aca510406a..55e809f5d4 100644 --- a/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc +++ b/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc @@ -2,3 +2,4 @@ items out print templates. * The Notices / Action Triggers administration interface (under Local Administration) is ported to Angular. +* Disallow payments via the OPAC if negative or zero billings are present. -- 2.43.2