support paying all fines at once
authorsenator <lebbeous@esilibrary.com>
Wed, 11 May 2011 21:45:58 +0000 (17:45 -0400)
committersenator <lebbeous@esilibrary.com>
Wed, 11 May 2011 21:45:58 +0000 (17:45 -0400)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/web/templates/default/opac/myopac/main_payment_form.tt2

index 171fa39..a4fa51f 100644 (file)
@@ -612,7 +612,7 @@ sub load_fines {
         {
             usr => $self->editor->requestor->id,
             balance_owed => {'!=' => 0},
-            (ref $id_list eq 'ARRAY' ? ("id" => $id_list) : ()),
+            ($id_list && @$id_list ? ("id" => $id_list) : ()),
         },
         {
             flesh => 4,
index 587c01b..a70b684 100644 (file)
@@ -26,7 +26,8 @@
                             [%
                             pay_total = 0.0;
                             FOR f IN ctx.fines.circulation;
-                                NEXT UNLESS CGI.param('xact').grep(f.xact.id).size;
+                                NEXT IF CGI.param('xact').size &&
+                                    !CGI.param('xact').grep(f.xact.id).size;
                                 attrs = {marc_xml => f.marc_xml};
                                 IF f.marc_xml;
                                     PROCESS get_marc_attrs args=attrs;
@@ -42,7 +43,8 @@
                             [%
                             END;
                             FOR f IN ctx.fines.grocery;
-                                NEXT UNLESS CGI.param('xact').grep(f.xact.id).size;
+                                NEXT IF CGI.param('xact').size &&
+                                    !CGI.param('xact').grep(f.xact.id).size;
                                 # XXX use fixed point math
                                 pay_total = pay_total + f.xact.balance_owed; %]
                                 <tr>