From adae6d24614c6e38fd16f93f91718a974165837e Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Wed, 13 Jul 2011 18:28:26 -0400 Subject: [PATCH] Bail from fee payment if no bills are found. Signed-off-by: Jason Stephenson Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/FeePayment.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.11.0