Lines 6285-6305
subtest 'Tests for transfer not in transit' => sub {
Link Here
|
6285 |
|
6285 |
|
6286 |
subtest 'Tests for RecordLocalUseOnReturn' => sub { |
6286 |
subtest 'Tests for RecordLocalUseOnReturn' => sub { |
6287 |
|
6287 |
|
6288 |
plan tests => 2; |
6288 |
plan tests => 5; |
6289 |
|
6289 |
|
6290 |
t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 0); |
6290 |
t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 0); |
6291 |
my $item = $builder->build_sample_item(); |
6291 |
my $item = $builder->build_sample_item(); |
|
|
6292 |
|
6293 |
my $item_2 = $builder->build_sample_item( |
6294 |
{ |
6295 |
onloan => undef, |
6296 |
} |
6297 |
); |
6298 |
|
6292 |
$item->withdrawn(1)->itemlost(1)->store; |
6299 |
$item->withdrawn(1)->itemlost(1)->store; |
6293 |
my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef ); |
6300 |
my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef ); |
6294 |
is_deeply( |
6301 |
is_deeply( |
6295 |
\@return, |
6302 |
\@return, |
6296 |
[ 0, { NotIssued => $item->barcode, withdrawn => 1 }, undef, {} ], "RecordLocalUSeOnReturn is off, no local use recorded"); |
6303 |
[ 0, { NotIssued => $item->barcode, withdrawn => 1 }, undef, {} ], "RecordLocalUSeOnReturn is off, no local use recorded"); |
6297 |
|
6304 |
|
|
|
6305 |
AddReturn( $item_2->barcode, $item_2->homebranch ); |
6306 |
$item_2->discard_changes; # refresh |
6307 |
is( $item_2->localuse, undef , 'Without RecordLocalUseOnReturn no localuse is recorded.'); |
6308 |
|
6298 |
t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 1); |
6309 |
t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 1); |
6299 |
my @return2 = AddReturn( $item->barcode, $item->homebranch, 0, undef ); |
6310 |
my @return2 = AddReturn( $item->barcode, $item->homebranch, 0, undef ); |
6300 |
is_deeply( |
6311 |
is_deeply( |
6301 |
\@return2, |
6312 |
\@return2, |
6302 |
[ 0, { NotIssued => $item->barcode, withdrawn => 1, LocalUse => 1 }, undef, {} ], "Local use is recorded"); |
6313 |
[ 0, { NotIssued => $item->barcode, withdrawn => 1, LocalUse => 1 }, undef, {} ], "Local use is recorded"); |
|
|
6314 |
|
6315 |
AddReturn( $item_2->barcode, $item_2->homebranch ); |
6316 |
$item_2->discard_changes; # refresh |
6317 |
is( $item_2->localuse, 1 , 'With RecordLocalUseOnReturn localuse is recorded.'); |
6318 |
|
6319 |
AddReturn( $item_2->barcode, $item_2->homebranch ); |
6320 |
$item_2->discard_changes; # refresh |
6321 |
is( $item_2->localuse, 2 , 'With RecordLocalUseOnReturn localuse is recorded.'); |
6303 |
}; |
6322 |
}; |
6304 |
|
6323 |
|
6305 |
subtest 'Test CanBookBeIssued param ignore_reserves (Bug 35322)' => sub { |
6324 |
subtest 'Test CanBookBeIssued param ignore_reserves (Bug 35322)' => sub { |
6306 |
- |
|
|