View | Details | Raw Unified | Return to bug 35587
Collapse All | Expand All

(-)a/C4/Circulation.pm (+4 lines)
Lines 2514-2519 sub AddReturn { Link Here
2514
        }
2514
        }
2515
    }
2515
    }
2516
2516
2517
    if ( $messages->{WasLost} and C4::Context->preference('BlockReturnOfLostItems') ) {
2518
        $validTransfer = 0;
2519
    }
2520
2517
    # Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer
2521
    # Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer
2518
    if ( $validTransfer && !C4::RotatingCollections::isItemInAnyCollection( $item->itemnumber )
2522
    if ( $validTransfer && !C4::RotatingCollections::isItemInAnyCollection( $item->itemnumber )
2519
        && ( $doreturn or $messages->{'NotIssued'} )
2523
        && ( $doreturn or $messages->{'NotIssued'} )
(-)a/t/db_dependent/Circulation/Returns.t (-2 / +2 lines)
Lines 286-292 subtest 'Handle ids duplication' => sub { Link Here
286
};
286
};
287
287
288
subtest 'BlockReturnOfLostItems' => sub {
288
subtest 'BlockReturnOfLostItems' => sub {
289
    plan tests => 4;
289
    plan tests => 5;
290
    my $item = $builder->build_sample_item;
290
    my $item = $builder->build_sample_item;
291
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
291
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
292
    my $checkout = AddIssue( $patron, $item->barcode );
292
    my $checkout = AddIssue( $patron, $item->barcode );
Lines 298-303 subtest 'BlockReturnOfLostItems' => sub { Link Here
298
    my ( $doreturn, $messages, $issue ) = AddReturn($item->barcode);
298
    my ( $doreturn, $messages, $issue ) = AddReturn($item->barcode);
299
    is( $doreturn, 0, "With BlockReturnOfLostItems, a checkin of a lost item should be blocked");
299
    is( $doreturn, 0, "With BlockReturnOfLostItems, a checkin of a lost item should be blocked");
300
    is( $messages->{WasLost}, 1, "... and the WasLost flag should be set");
300
    is( $messages->{WasLost}, 1, "... and the WasLost flag should be set");
301
    is( $messages->{NeedsTransfer}, undef, "... and no transfer should be triggered");
301
302
302
    $item->discard_changes;
303
    $item->discard_changes;
303
    is( $item->itemlost, 1, "Item remains lost" );
304
    is( $item->itemlost, 1, "Item remains lost" );
304
- 

Return to bug 35587