From b1c26178cd4caef68f91a33d9a9c5f18ef67a239 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 16 Sep 2016 10:47:11 -0400 Subject: [PATCH] JBAS-1587 CC always avoids negative transactions At the middle layer, prevent the credit card transaction retrieval code from ever accessing negative transactions. This fixes a bug where patrons could accidentally attempt to pay against negative transactions by navigating directly to /eg/opac/biblio/main_payment_form with no transactions provided in the URL, defaulting to all open (including negative) transactions. Signed-off-by: Bill Erickson --- KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 | 2 -- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 index 649c08ae38..9c3f6e66c5 100644 --- a/KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 +++ b/KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 @@ -58,7 +58,6 @@ [% FOR f IN ctx.fines.circulation; - NEXT IF f.xact.balance_owed < 0; # XXX middle layer attrs = {marc_xml => f.marc_xml}; IF f.marc_xml; PROCESS get_marc_attrs args=attrs; @@ -148,7 +147,6 @@ [% FOR f IN ctx.fines.grocery %] - [% NEXT IF f.xact.balance_owed < 0 %] [% date.format( ctx.parse_datetime(f.xact.xact_start), diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 52f50973f3..57ab865346 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -2336,7 +2336,7 @@ sub prepare_fines { 'open-ils.cstore.direct.money.open_billable_transaction_summary.search', { usr => $self->editor->requestor->id, - balance_owed => {'!=' => 0}, + balance_owed => {'>' => 0}, ($id_list && @$id_list ? ("id" => $id_list) : ()), }, { -- 2.11.0