View | Details | Raw Unified | Return to bug 27131
Collapse All | Expand All

(-)a/Koha/Holds.pm (+6 lines)
Lines 92-97 sub forced_hold_level { Link Here
92
    return;
92
    return;
93
}
93
}
94
94
95
=head3 get_items_that_can_fill
96
97
Developer will certainly submit an appropriate description.
98
99
=cut
100
95
sub get_items_that_can_fill {
101
sub get_items_that_can_fill {
96
    my ( $self ) = @_;
102
    my ( $self ) = @_;
97
103
(-)a/t/db_dependent/Koha/Holds.t (-2 / +2 lines)
Lines 414-419 subtest 'get_items_that_can_fill' => sub { Link Here
414
414
415
    my $biblio = $builder->build_sample_biblio;
415
    my $biblio = $builder->build_sample_biblio;
416
    my $item_1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } );
416
    my $item_1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } );
417
        # waiting
417
    my $item_2 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } );
418
    my $item_2 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } );
418
    my $item_3 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } )
419
    my $item_3 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } )
419
      ;    # onloan
420
      ;    # onloan
Lines 481-487 subtest 'get_items_that_can_fill' => sub { Link Here
481
482
482
    my @items = $holds->get_items_that_can_fill;
483
    my @items = $holds->get_items_that_can_fill;
483
    is_deeply( [ map { $_->itemnumber } @items ],
484
    is_deeply( [ map { $_->itemnumber } @items ],
484
        [ $item_2->itemnumber, $item_5->itemnumber ], 'Only item 1 and 5 are available for filling the hold' );
485
        [ $item_2->itemnumber, $item_5->itemnumber ], 'Only item 2 and 5 are available for filling the hold' );
485
};
486
};
486
487
487
$schema->storage->txn_rollback;
488
$schema->storage->txn_rollback;
488
- 

Return to bug 27131