From 87f24187670b3442444bf9ae75e31636fdbae68f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 13 Aug 2020 16:44:28 +0100 Subject: [PATCH] Bug 25261: (QA follow-up) Catch check in SIP Checkin Signed-off-by: Martin Renvoize --- C4/SIP/ILS/Transaction/Checkin.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm index 10cd87b5ad..ee5144a96d 100644 --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ b/C4/SIP/ILS/Transaction/Checkin.pm @@ -16,6 +16,7 @@ use C4::Debug; use C4::Items qw( ModItemTransfer ); use C4::Reserves qw( ModReserveAffect ); use Koha::DateUtils qw( dt_from_string ); +use Koha::Items; use parent qw(C4::SIP::ILS::Transaction); @@ -71,8 +72,21 @@ sub do_checkin { $return_date = dt_from_string($return_date); } + my ( $return, $messages, $issue, $borrower ); + my $item = Koha::Items->find( { barcode => $barcode } ); + my $human_required = 0; + if ( C4::Context->preference("CircConfirmItemParts") + && defined($item) + && $item->materials ) + { + $human_required = 1; + $messages->{additional_materials} = 1; + } + $debug and warn "do_checkin() calling AddReturn($barcode, $branch)"; - my ($return, $messages, $issue, $borrower) = AddReturn($barcode, $branch, undef, $return_date); + ( $return, $messages, $issue, $borrower ) = + AddReturn( $barcode, $branch, undef, $return_date ) + unless $human_required; if ( $checked_in_ok ) { delete $messages->{ItemLocationUpdated}; @@ -84,6 +98,9 @@ sub do_checkin { # biblionumber, biblioitemnumber, itemnumber # borrowernumber, reservedate, branchcode # cancellationdate, found, reservenotes, priority, timestamp + if ($messages->{additional_materials}) { + $self->alert_type('99'); + } if( $messages->{DataCorrupted} ) { $self->alert_type('98'); } -- 2.20.1