@@ -, +, @@ collection doesn't exist --- C4/Circulation.pm | 3 +-- C4/RotatingCollections.pm | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2166,7 +2166,6 @@ sub AddReturn { my $transfer = $item->get_transfer; # if we have a transfer to complete, we update the line of transfers with the datearrived - my $is_in_rotating_collection = C4::RotatingCollections::isItemInAnyCollection( $item->itemnumber ); if ($transfer) { $validTransfer = 0; if ( $transfer->in_transit ) { @@ -2278,7 +2277,7 @@ sub AddReturn { } # Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer - if ( $validTransfer && !$is_in_rotating_collection + if ( $validTransfer && !C4::RotatingCollections::isItemInAnyCollection( $item->itemnumber ) && ( $doreturn or $messages->{'NotIssued'} ) and !$resfound and ( $branch ne $returnbranch ) --- a/C4/RotatingCollections.pm +++ a/C4/RotatingCollections.pm @@ -571,7 +571,7 @@ sub isItemInAnyCollection { my $dbh = C4::Context->dbh; my $sth = $dbh->prepare( - "SELECT itemnumber FROM collections_tracking WHERE itemnumber = ?"); + "SELECT itemnumber FROM collections_tracking JOIN collections USING (colId) WHERE itemnumber = ?"); $sth->execute($itemnumber) or return (0); my $row = $sth->fetchrow_hashref; --