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