|
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 2192-2197
subtest 'CanBookBeIssued | is_overdue' => sub {
Link Here
|
| 2192 |
|
2192 |
|
| 2193 |
}; |
2193 |
}; |
| 2194 |
|
2194 |
|
|
|
2195 |
subtest 'AddReturn should clear items.onloan for unissued items' => sub { |
| 2196 |
plan tests => 1; |
| 2197 |
|
| 2198 |
t::lib::Mocks::mock_preference( "AllowReturnToBranch", 'anywhere' ); |
| 2199 |
my $item = $builder->build_object({ class => 'Koha::Items', value => { onloan => '2018-01-01' }}); |
| 2200 |
AddReturn( $item->barcode, $item->homebranch ); |
| 2201 |
$item->discard_changes; # refresh |
| 2202 |
is( $item->onloan, undef, 'AddReturn did clear items.onloan' ); |
| 2203 |
}; |
| 2195 |
|
2204 |
|
| 2196 |
$schema->storage->txn_rollback; |
2205 |
$schema->storage->txn_rollback; |
| 2197 |
$cache->clear_from_cache('single_holidays'); |
2206 |
$cache->clear_from_cache('single_holidays'); |
| 2198 |
- |
|
|