Lines 6290-6296
subtest 'Tests for RecordLocalUseOnReturn' => sub {
Link Here
|
6290 |
|
6290 |
|
6291 |
plan tests => 5; |
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 |
|
6295 |
|
6296 |
my $item_2 = $builder->build_sample_item( |
6296 |
my $item_2 = $builder->build_sample_item( |
Lines 6303-6327
subtest 'Tests for RecordLocalUseOnReturn' => sub {
Link Here
|
6303 |
my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef ); |
6303 |
my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef ); |
6304 |
is_deeply( |
6304 |
is_deeply( |
6305 |
\@return, |
6305 |
\@return, |
6306 |
[ 0, { NotIssued => $item->barcode, withdrawn => 1 }, undef, {} ], "RecordLocalUSeOnReturn is off, no local use recorded"); |
6306 |
[ 0, { NotIssued => $item->barcode, withdrawn => 1 }, undef, {} ], |
|
|
6307 |
"RecordLocalUSeOnReturn is off, no local use recorded" |
6308 |
); |
6307 |
|
6309 |
|
6308 |
AddReturn( $item_2->barcode, $item_2->homebranch ); |
6310 |
AddReturn( $item_2->barcode, $item_2->homebranch ); |
6309 |
$item_2->discard_changes; # refresh |
6311 |
$item_2->discard_changes; # refresh |
6310 |
is( $item_2->localuse, undef , 'Without RecordLocalUseOnReturn no localuse is recorded.'); |
6312 |
is( $item_2->localuse, undef, 'Without RecordLocalUseOnReturn no localuse is recorded.' ); |
6311 |
|
6313 |
|
6312 |
t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 1); |
6314 |
t::lib::Mocks::mock_preference( 'RecordLocalUseOnReturn', 1 ); |
6313 |
my @return2 = AddReturn( $item->barcode, $item->homebranch, 0, undef ); |
6315 |
my @return2 = AddReturn( $item->barcode, $item->homebranch, 0, undef ); |
6314 |
is_deeply( |
6316 |
is_deeply( |
6315 |
\@return2, |
6317 |
\@return2, |
6316 |
[ 0, { NotIssued => $item->barcode, withdrawn => 1, LocalUse => 1 }, undef, {} ], "Local use is recorded"); |
6318 |
[ 0, { NotIssued => $item->barcode, withdrawn => 1, LocalUse => 1 }, undef, {} ], "Local use is recorded" |
|
|
6319 |
); |
6317 |
|
6320 |
|
6318 |
AddReturn( $item_2->barcode, $item_2->homebranch ); |
6321 |
AddReturn( $item_2->barcode, $item_2->homebranch ); |
6319 |
$item_2->discard_changes; # refresh |
6322 |
$item_2->discard_changes; # refresh |
6320 |
is( $item_2->localuse, 1 , 'With RecordLocalUseOnReturn localuse is recorded.'); |
6323 |
is( $item_2->localuse, 1, 'With RecordLocalUseOnReturn localuse is recorded.' ); |
6321 |
|
6324 |
|
6322 |
AddReturn( $item_2->barcode, $item_2->homebranch ); |
6325 |
AddReturn( $item_2->barcode, $item_2->homebranch ); |
6323 |
$item_2->discard_changes; # refresh |
6326 |
$item_2->discard_changes; # refresh |
6324 |
is( $item_2->localuse, 2 , 'With RecordLocalUseOnReturn localuse is recorded.'); |
6327 |
is( $item_2->localuse, 2, 'With RecordLocalUseOnReturn localuse is recorded.' ); |
6325 |
}; |
6328 |
}; |
6326 |
|
6329 |
|
6327 |
subtest 'Test CanBookBeIssued param ignore_reserves (Bug 35322)' => sub { |
6330 |
subtest 'Test CanBookBeIssued param ignore_reserves (Bug 35322)' => sub { |
6328 |
- |
|
|