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

(-)a/C4/Circulation.pm (-1 / +2 lines)
Lines 2522-2528 sub AddReturn { Link Here
2522
        and not $messages->{'WrongTransfer'}
2522
        and not $messages->{'WrongTransfer'}
2523
        and not $messages->{'WasTransfered'}
2523
        and not $messages->{'WasTransfered'}
2524
        and not $messages->{TransferredRecall}
2524
        and not $messages->{TransferredRecall}
2525
        and not $messages->{RecallNeedsTransfer} )
2525
        and not $messages->{RecallNeedsTransfer}
2526
        and ( $messages->{WasLost} and !C4::Context->preference('BlockReturnOfLostItems') ) )
2526
    {
2527
    {
2527
        my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType") eq 'itemtype' ? 'effective_itemtype' : 'ccode';
2528
        my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType") eq 'itemtype' ? 'effective_itemtype' : 'ccode';
2528
        if  (C4::Context->preference("AutomaticItemReturn"    ) or
2529
        if  (C4::Context->preference("AutomaticItemReturn"    ) or
(-)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