|
Lines 807-813
subtest 'Desks' => sub {
Link Here
|
| 807 |
}; |
807 |
}; |
| 808 |
|
808 |
|
| 809 |
subtest 'get_items_that_can_fill' => sub { |
809 |
subtest 'get_items_that_can_fill' => sub { |
| 810 |
plan tests => 6; |
810 |
plan tests => 7; |
| 811 |
|
811 |
|
| 812 |
Koha::CirculationRules->search( |
812 |
Koha::CirculationRules->search( |
| 813 |
{ |
813 |
{ |
|
Lines 912-917
subtest 'get_items_that_can_fill' => sub {
Link Here
|
| 912 |
[ $item_2->itemnumber, $item_5->itemnumber ], 'Only item 2 and 5 are available for filling the hold' |
912 |
[ $item_2->itemnumber, $item_5->itemnumber ], 'Only item 2 and 5 are available for filling the hold' |
| 913 |
); |
913 |
); |
| 914 |
|
914 |
|
|
|
915 |
my $waiting_recall = $builder->build_object( |
| 916 |
{ class => 'Koha::Recalls', value => { item_id => $item_5->itemnumber, status => 'waiting' } } ); |
| 917 |
$items = $holds->get_items_that_can_fill; |
| 918 |
is_deeply( |
| 919 |
[ map { $_->itemnumber } $items->as_list ], |
| 920 |
[ $item_2->itemnumber ], |
| 921 |
'Only item 2 is available for filling the hold as item 5 is allocated to a pending recall' |
| 922 |
); |
| 923 |
$waiting_recall->delete; |
| 924 |
|
| 915 |
# Marking item_5 is no hold allowed |
925 |
# Marking item_5 is no hold allowed |
| 916 |
Koha::CirculationRule->new( |
926 |
Koha::CirculationRule->new( |
| 917 |
{ |
927 |
{ |
| 918 |
- |
|
|