From cd91b3163ba02df72d11838fc196dea91711a8d2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 23 Aug 2016 17:58:54 +0100 Subject: [PATCH] Bug 15438: Do not display irrelevant errors when checking out via SIP See bug report for more info --- C4/SIP/ILS/Transaction/Checkout.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm index 14a2b66..350df76 100644 --- a/C4/SIP/ILS/Transaction/Checkout.pm +++ b/C4/SIP/ILS/Transaction/Checkout.pm @@ -71,9 +71,11 @@ sub do_checkout { $noerror = 0; } } else { + my $msg_sent = 0; foreach my $confirmation (keys %{$needsconfirmation}) { if ($confirmation eq 'RENEW_ISSUE'){ $self->screen_msg("Item already checked out to you: renewing item."); + $msg_sent++; } elsif ($confirmation eq 'RESERVED' or $confirmation eq 'RESERVE_WAITING') { my $x = $self->{item}->available($patron_barcode); if ($x) { @@ -82,25 +84,30 @@ sub do_checkout { $self->screen_msg("Item is reserved for another patron upon return."); # $noerror = 0; } + $msg_sent++; } elsif ($confirmation eq 'ISSUED_TO_ANOTHER') { $self->screen_msg("Item already checked out to another patron. Please return item for check-in."); $noerror = 0; + $msg_sent++; } elsif ($confirmation eq 'DEBT') { $self->screen_msg('Outstanding Fines block issue'); $noerror = 0; + $msg_sent++; } elsif ($confirmation eq 'HIGHHOLDS') { $overridden_duedate = $needsconfirmation->{$confirmation}->{returndate}; $self->screen_msg('Loan period reduced for high-demand item'); + $msg_sent++; } elsif ($confirmation eq 'RENTALCHARGE') { if ($self->{fee_ack} ne 'Y') { $noerror = 0; } - } else { - $self->screen_msg($needsconfirmation->{$confirmation}); - $noerror = 0; - syslog('LOG_DEBUG', "Blocking checkout Reason:$confirmation"); } } + if ( keys %$needsconfirmation and $msg_sent == 0 ) { + $self->screen_msg('Item cannot be issued'); + $noerror = 0; + syslog('LOG_DEBUG', "Blocking checkout Reason:$confirmation"); + } } my $itemnumber = $self->{item}->{itemnumber}; foreach (@$shelf) { -- 2.8.1