From f0f44824204f78313f4c8776ddd1adfc68053e14 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 3 Feb 2012 16:32:03 -0500 Subject: [PATCH] TPac; credit card assumes all xacts if none selected For consistency with the initial payment form and to preserve backwards compatibility, if no transactions are selected, assume the user wants to pay for all transactions. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 da6f3b45a9..378bfd565b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1177,6 +1177,19 @@ sub load_myopac_pay_init { my @payment_xacts = ($self->cgi->param('xact'), $self->cgi->param('xact_misc')); + if (!@payment_xacts) { + # for consistency with load_myopac_payment_form() and + # to preserve backwards compatibility, if no xacts are + # selected, assume all (applicable) transactions are wanted. + my $stat = $self->prepare_fines(undef, undef, [$self->cgi->param('xact'), $self->cgi->param('xact_misc')]); + return $stat if $stat; + @payment_xacts = + map { $_->{xact}->id } ( + @{$self->ctx->{fines}->{circulation}}, + @{$self->ctx->{fines}->{grocery}} + ); + } + return $self->generic_redirect unless @payment_xacts; my $cc_args = {"where_process" => 1}; -- 2.11.0