From: Jason Stephenson Date: Wed, 13 Jul 2011 22:28:26 +0000 (-0400) Subject: Bail from fee payment if no bills are found. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=782bb8512bd6732ec9dbcd38b20c0fae831e23b1;p=working%2FEvergreen.git Bail from fee payment if no bills are found. Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/FeePayment.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/FeePayment.pm index ceab0db801..3a8509fe45 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/FeePayment.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/FeePayment.pm @@ -100,11 +100,18 @@ sub do_fee_payment { } } else { # We attempt to pay as many of the patron's bills as possible with the payment provided. - my $results = $U->simplereq('open-ils.actor', 'open-ils.actor.user.transactions.history.have_balance', $self->{authtoken}, $self->patron->internal_id); if ($results && ref($results) eq 'ARRAY') { syslog('LOG_INFO', 'OILS: ' . scalar @$results . " bills found for " . $self->patron->internal_id); + # If we get an empty array, we report not bills found and + # quit. + unless (@$results) { + $self->ok(0); + $self->screen_msg(OILS_SIP_MSG_NO_BILL); + return $self->ok; + } + # We fill an array with the payment information as # open-ils.circ.money.payment expects it, i.e. an arrayref # with the bill_id and payment amount of its members. To