From 63b7948f648f4d377fbb5e12565e1bae34e422d2 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 25 Oct 2017 13:41:56 +1300 Subject: [PATCH] Revert "Bug 18996: [16.11.x] Handle data corruption from old_issues at SIP checkin" This reverts commit 722c26c4ef16074624f0606233a1671509289bd6. --- C4/SIP/ILS.pm | 37 ++++++++++++++----------------- C4/SIP/ILS/Transaction/Checkin.pm | 4 +--- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm index b3816f49ec..7a40777af3 100644 --- a/C4/SIP/ILS.pm +++ b/C4/SIP/ILS.pm @@ -211,32 +211,29 @@ sub checkin { else { $circ->alert(1); $circ->alert_type(99); - $circ->ok( 0 ); $circ->screen_msg('Invalid Item'); - return $circ; } - if( !$circ->ok && $circ->alert_type && $circ->alert_type == 98 ) { # data corruption - $circ->screen_msg("Checkin failed: data problem"); - syslog( "LOG_WARNING", "Problem with issue_id in issues and old_issues; check the about page" ); - } elsif( !$item->{patron} ) { - if( $checked_in_ok ) { # Mark checkin ok although book not checked out - $circ->ok( 1 ); - syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - using checked_in_ok"); - } else { - $circ->screen_msg("Item not checked out"); - syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - item not checked out"); + # It's ok to check it in if it exists, and if it was checked out + # or it was not checked out but the checked_in_ok flag was set + $circ->ok( ( $checked_in_ok && $item ) || ( $item && $item->{patron} ) ); + syslog("LOG_DEBUG", "C4::SIP::ILS::checkin - using checked_in_ok") if $checked_in_ok; + + if ( !defined( $item->{patron} ) ) { + $circ->screen_msg("Item not checked out") unless $checked_in_ok; + syslog("LOG_DEBUG", "C4::SIP::ILS::checkin - item not checked out"); + } + else { + if ( $circ->ok ) { + $circ->patron( $patron = C4::SIP::ILS::Patron->new( $item->{patron} ) ); + delete $item->{patron}; + delete $item->{due_date}; + $patron->{items} = [ grep { $_ ne $item_id } @{ $patron->{items} } ]; } - } elsif( $circ->ok ) { - $circ->patron( $patron = C4::SIP::ILS::Patron->new( $item->{patron} ) ); - delete $item->{patron}; - delete $item->{due_date}; - $patron->{items} = [ grep { $_ ne $item_id } @{ $patron->{items} } ]; - } else { - $circ->screen_msg("Checkin failed"); - syslog( "LOG_WARNING", "Checkin failed: probably for Wrongbranch or withdrawn" ); } + # END TRANSACTION + return $circ; } diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm index 1e138bcf6e..19c82e9a63 100644 --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ b/C4/SIP/ILS/Transaction/Checkin.pm @@ -72,9 +72,7 @@ sub do_checkin { # biblionumber, biblioitemnumber, itemnumber # borrowernumber, reservedate, branchcode # cancellationdate, found, reservenotes, priority, timestamp - if( $messages->{DataCorrupted} ) { - $self->alert_type('98'); - } + if ($messages->{BadBarcode}) { $self->alert_type('99'); } -- 2.39.5