From dc02192eb73486c6f0491dbccc18041db674a90b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 17 Sep 2020 12:59:11 +0100 Subject: [PATCH] Bug 25261: (QA follow-up) Catch attepts to return via SCO This patch adds a block to capture attempts to return items with attached materials when checking in via the self checkout when the relevant system preference is set. Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- opac/sco/sco-main.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index bc94c0e9d5..c7649f5f6d 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -135,8 +135,20 @@ if ($op eq "logout") { $query->param( patronid => undef, patronlogin => undef, patronpw => undef ); } elsif ( $op eq "returnbook" && $allowselfcheckreturns ) { - my ($doreturn) = AddReturn( $barcode, $branch ); - $template->param( returned => $doreturn ); + my $success = 0; + my $human_required = 0; + if ( C4::Context->preference("CircConfirmItemParts") ) { + my $item = Koha::Items->find( { barcode => $barcode } ); + if ( defined($item) + && $item->materials ) + { + $human_required = 1; + } + } + + ($success) = AddReturn( $barcode, $branch ) + unless $human_required; + $template->param( returned => $success ); } elsif ( $patron && ( $op eq 'checkout' ) ) { my $impossible = {}; -- 2.39.5