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

(-)a/C4/Circulation.pm (-3 / +3 lines)
Lines 827-835 sub CanBookBeIssued { Link Here
827
            }
827
            }
828
        );
828
        );
829
        my $block_lost_return = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0;
829
        my $block_lost_return = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0;
830
        my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower) =
830
        my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) =
831
        AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} );
831
            AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} );
832
        ModDateLastSeen( $item_object->itemnumber, $block_lost_return ); # FIXME Move to Koha::Item
832
        ModDateLastSeen( $item_object->itemnumber, $block_lost_return );    # FIXME Move to Koha::Item
833
        return (
833
        return (
834
            {
834
            {
835
                STATS     => 1,
835
                STATS     => 1,
(-)a/t/db_dependent/Circulation.t (-7 / +6 lines)
Lines 2474-2490 subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { Link Here
2474
    is( $stat->categorycode,   $patron->categorycode,            'Recorded a categorycode' );
2474
    is( $stat->categorycode,   $patron->categorycode,            'Recorded a categorycode' );
2475
    is( $stat->location,       $item_1->location,                'Recorded a location' );
2475
    is( $stat->location,       $item_1->location,                'Recorded a location' );
2476
2476
2477
2477
    t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode } );
2478
    t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
2478
    my $patron_2 = $builder->build_object(
2479
    my $patron_2  = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } );
2479
        { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } );
2480
    my $item_2 = $builder->build_sample_item( { library => $library->branchcode } );
2480
    my $item_2 = $builder->build_sample_item( { library => $library->branchcode } );
2481
    my $issue = AddIssue( $patron_2, $item_2->barcode );
2481
    my $issue  = AddIssue( $patron_2, $item_2->barcode );
2482
    $item_2->discard_changes;
2482
    $item_2->discard_changes;
2483
    ok($item_2->onloan, "Item is checked out");
2483
    ok( $item_2->onloan, "Item is checked out" );
2484
2484
2485
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode );
2485
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode );
2486
    $item_2->discard_changes;
2486
    $item_2->discard_changes;
2487
    ok(!$item_2->onloan, "Checked out item is returned");
2487
    ok( !$item_2->onloan, "Checked out item is returned" );
2488
2488
2489
    # TODO There are other tests to provide here
2489
    # TODO There are other tests to provide here
2490
};
2490
};
2491
- 

Return to bug 27992