|
Lines 326-341
subtest 'Check holds availability with different item types' => sub {
Link Here
|
| 326 |
# (Bug 24683): |
326 |
# (Bug 24683): |
| 327 |
|
327 |
|
| 328 |
my $biblio2 = $builder->build_sample_biblio( { itemtype => $itemtype } ); |
328 |
my $biblio2 = $builder->build_sample_biblio( { itemtype => $itemtype } ); |
| 329 |
my $biblionumber1 = $biblio2->biblionumber; |
|
|
| 330 |
my $item4 = $builder->build_sample_item( |
329 |
my $item4 = $builder->build_sample_item( |
| 331 |
{ biblionumber => $biblionumber1, |
330 |
{ biblionumber => $biblio2->biblionumber, |
| 332 |
itype => $itemtype, |
331 |
itype => $itemtype, |
| 333 |
homebranch => $library_A, |
332 |
homebranch => $library_A, |
| 334 |
holdingbranch => $library_A |
333 |
holdingbranch => $library_A |
| 335 |
} |
334 |
} |
| 336 |
); |
335 |
); |
| 337 |
my $item5 = $builder->build_sample_item( |
336 |
my $item5 = $builder->build_sample_item( |
| 338 |
{ biblionumber => $biblionumber1, |
337 |
{ biblionumber => $biblio2->biblionumber, |
| 339 |
itype => $itemtype2, |
338 |
itype => $itemtype2, |
| 340 |
homebranch => $library_A, |
339 |
homebranch => $library_A, |
| 341 |
holdingbranch => $library_A |
340 |
holdingbranch => $library_A |
|
Lines 371-377
subtest 'Check holds availability with different item types' => sub {
Link Here
|
| 371 |
} |
370 |
} |
| 372 |
); |
371 |
); |
| 373 |
|
372 |
|
| 374 |
$is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblionumber1, patron => $patron1 } ); |
373 |
$is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblio2->biblionumber, patron => $patron1 } ); |
| 375 |
is( $is, 1, "Items availability: 2 items, one allowed by smart rule but not checked out, another one not allowed to be held by smart rule" ); |
374 |
is( $is, 1, "Items availability: 2 items, one allowed by smart rule but not checked out, another one not allowed to be held by smart rule" ); |
| 376 |
|
375 |
|
| 377 |
$is = IsAvailableForItemLevelRequest( $item4, $patron1 ); |
376 |
$is = IsAvailableForItemLevelRequest( $item4, $patron1 ); |
|
Lines 382-388
subtest 'Check holds availability with different item types' => sub {
Link Here
|
| 382 |
|
381 |
|
| 383 |
AddIssue( $patron2->unblessed, $item4->barcode ); |
382 |
AddIssue( $patron2->unblessed, $item4->barcode ); |
| 384 |
|
383 |
|
| 385 |
$is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblionumber1, patron => $patron1 } ); |
384 |
$is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblio2->biblionumber, patron => $patron1 } ); |
| 386 |
is( $is, 0, "Items availability: 2 items, one allowed by smart rule and checked out, another one not allowed to be held by smart rule" ); |
385 |
is( $is, 0, "Items availability: 2 items, one allowed by smart rule and checked out, another one not allowed to be held by smart rule" ); |
| 387 |
|
386 |
|
| 388 |
$is = IsAvailableForItemLevelRequest( $item4, $patron1 ); |
387 |
$is = IsAvailableForItemLevelRequest( $item4, $patron1 ); |
|
Lines 397-405
subtest 'Check item checkout availability with ordered item' => sub {
Link Here
|
| 397 |
plan tests => 1; |
396 |
plan tests => 1; |
| 398 |
|
397 |
|
| 399 |
my $biblio2 = $builder->build_sample_biblio( { itemtype => $itemtype } ); |
398 |
my $biblio2 = $builder->build_sample_biblio( { itemtype => $itemtype } ); |
| 400 |
my $biblionumber1 = $biblio2->biblionumber; |
|
|
| 401 |
my $item1 = $builder->build_sample_item( |
399 |
my $item1 = $builder->build_sample_item( |
| 402 |
{ biblionumber => $biblionumber1, |
400 |
{ biblionumber => $biblio2->biblionumber, |
| 403 |
itype => $itemtype2, |
401 |
itype => $itemtype2, |
| 404 |
homebranch => $library_A, |
402 |
homebranch => $library_A, |
| 405 |
holdingbranch => $library_A, |
403 |
holdingbranch => $library_A, |
|
Lines 422-428
subtest 'Check item checkout availability with ordered item' => sub {
Link Here
|
| 422 |
} |
420 |
} |
| 423 |
); |
421 |
); |
| 424 |
|
422 |
|
| 425 |
$is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblionumber1, patron => $patron1 } ); |
423 |
$is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblio2->biblionumber, patron => $patron1 } ); |
| 426 |
is( $is, 0, "Ordered item cannot be checked out" ); |
424 |
is( $is, 0, "Ordered item cannot be checked out" ); |
| 427 |
}; |
425 |
}; |
| 428 |
|
426 |
|
| 429 |
- |
|
|