From 9fd2c440e7708d7da42274b4ffddc57dec557ee7 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 --- 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 28791d3c4f..bb76afd48f 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.20.1