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

(-)a/C4/Circulation.pm (+1 lines)
Lines 1812-1817 sub AddReturn { Link Here
1812
                . Dumper($issue->unblessed) . "\n";
1812
                . Dumper($issue->unblessed) . "\n";
1813
    } else {
1813
    } else {
1814
        $messages->{'NotIssued'} = $barcode;
1814
        $messages->{'NotIssued'} = $barcode;
1815
        ModItem({ onloan => undef }, $item->{biblionumber}, $item->{itemnumber}) if defined $item->{onloan};
1815
        # even though item is not on loan, it may still be transferred;  therefore, get current branch info
1816
        # even though item is not on loan, it may still be transferred;  therefore, get current branch info
1816
        $doreturn = 0;
1817
        $doreturn = 0;
1817
        # No issue, no borrowernumber.  ONLY if $doreturn, *might* you have a $borrower later.
1818
        # No issue, no borrowernumber.  ONLY if $doreturn, *might* you have a $borrower later.
(-)a/t/db_dependent/Circulation.t (-2 / +11 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 113;
20
use Test::More tests => 114;
21
21
22
use DateTime;
22
use DateTime;
23
23
Lines 2047-2052 subtest 'CanBookBeIssued | is_overdue' => sub { Link Here
2047
2047
2048
};
2048
};
2049
2049
2050
subtest 'AddReturn should clear items.onloan for unissued items' => sub {
2051
    plan tests => 1;
2052
2053
    t::lib::Mocks::mock_preference( "AllowReturnToBranch", 'anywhere' );
2054
    my $item = $builder->build_object({ class => 'Koha::Items', value  => { onloan => '2018-01-01' }});
2055
    AddReturn( $item->barcode, $item->homebranch );
2056
    $item->discard_changes; # refresh
2057
    is( $item->onloan, undef, 'AddReturn did clear items.onloan' );
2058
};
2059
2050
sub set_userenv {
2060
sub set_userenv {
2051
    my ( $library ) = @_;
2061
    my ( $library ) = @_;
2052
    C4::Context->set_userenv(0,0,0,'firstname','surname', $library->{branchcode}, $library->{branchname}, '', '', '');
2062
    C4::Context->set_userenv(0,0,0,'firstname','surname', $library->{branchcode}, $library->{branchname}, '', '', '');
2053
- 

Return to bug 20487