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