From: Bill Erickson Date: Fri, 3 Feb 2012 21:32:03 +0000 (-0500) Subject: TPac; credit card assumes all xacts if none selected X-Git-Tag: sprint4-merge-nov22~4445 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f0f44824204f78313f4c8776ddd1adfc68053e14;p=working%2FEvergreen.git 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 --- 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};