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

(-)a/C4/Circulation.pm (+1 lines)
Lines 1814-1819 sub AddReturn { Link Here
1814
                . Dumper($issue->unblessed) . "\n";
1814
                . Dumper($issue->unblessed) . "\n";
1815
    } else {
1815
    } else {
1816
        $messages->{'NotIssued'} = $barcode;
1816
        $messages->{'NotIssued'} = $barcode;
1817
        ModItem({ onloan => undef }, $item->{biblionumber}, $item->{itemnumber}) if defined $item->{onloan};
1817
        # even though item is not on loan, it may still be transferred;  therefore, get current branch info
1818
        # even though item is not on loan, it may still be transferred;  therefore, get current branch info
1818
        $doreturn = 0;
1819
        $doreturn = 0;
1819
        # No issue, no borrowernumber.  ONLY if $doreturn, *might* you have a $borrower later.
1820
        # No issue, no borrowernumber.  ONLY if $doreturn, *might* you have a $borrower later.
(-)a/t/db_dependent/Circulation.t (-2 / +10 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 116;
20
use Test::More tests => 117;
21
21
22
use DateTime;
22
use DateTime;
23
use POSIX qw( floor );
23
use POSIX qw( floor );
Lines 2214-2219 subtest 'CanBookBeIssued | is_overdue' => sub { Link Here
2214
2214
2215
};
2215
};
2216
2216
2217
subtest 'AddReturn should clear items.onloan for unissued items' => sub {
2218
    plan tests => 1;
2219
2220
    t::lib::Mocks::mock_preference( "AllowReturnToBranch", 'anywhere' );
2221
    my $item = $builder->build_object({ class => 'Koha::Items', value  => { onloan => '2018-01-01' }});
2222
    AddReturn( $item->barcode, $item->homebranch );
2223
    $item->discard_changes; # refresh
2224
    is( $item->onloan, undef, 'AddReturn did clear items.onloan' );
2225
};
2217
2226
2218
$schema->storage->txn_rollback;
2227
$schema->storage->txn_rollback;
2219
$cache->clear_from_cache('single_holidays');
2228
$cache->clear_from_cache('single_holidays');
2220
- 

Return to bug 20487