JBAS-1587 CC always avoids negative transactions
authorBill Erickson <berickxx@gmail.com>
Fri, 16 Sep 2016 14:47:11 +0000 (10:47 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
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 <berickxx@gmail.com>
KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm

index 649c08a..9c3f6e6 100644 (file)
@@ -58,7 +58,6 @@
             </thead>
             <tbody id='myopac_circ_trans_tbody'>
                 [% 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;
             </thead>
             <tbody id='myopac_trans_tbody'>
                 [% FOR f IN ctx.fines.grocery %]
-                    [% NEXT IF f.xact.balance_owed < 0 %] <!-- XXX middle layer -->
                 <tr id='myopac_trans_row'>
                     <td>[% date.format(
                             ctx.parse_datetime(f.xact.xact_start),
index 52f5097..57ab865 100644 (file)
@@ -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) : ()),
         },
         {