Lines 36-42
use Koha::DateUtils qw(dt_from_string);
Link Here
|
36 |
use Koha::Holds; |
36 |
use Koha::Holds; |
37 |
use Koha::Libraries; |
37 |
use Koha::Libraries; |
38 |
use Koha::Old::Holds; |
38 |
use Koha::Old::Holds; |
39 |
use C4::Reserves qw( AddReserve ModReserveAffect ); |
39 |
use C4::Reserves qw( AddReserve ModReserveAffect RevertWaitingStatus); |
40 |
use C4::Circulation qw( AddReturn ); |
40 |
use C4::Circulation qw( AddReturn ); |
41 |
|
41 |
|
42 |
my $schema = Koha::Database->new->schema; |
42 |
my $schema = Koha::Database->new->schema; |
Lines 1977-1983
subtest 'is_hold_group_target, cleanup_hold_group and set_as_hold_group_target t
Link Here
|
1977 |
}; |
1977 |
}; |
1978 |
|
1978 |
|
1979 |
subtest '_Findgroupreserve in the context of hold groups' => sub { |
1979 |
subtest '_Findgroupreserve in the context of hold groups' => sub { |
1980 |
plan tests => 17; |
1980 |
plan tests => 19; |
1981 |
|
1981 |
|
1982 |
$schema->storage->txn_begin; |
1982 |
$schema->storage->txn_begin; |
1983 |
|
1983 |
|
Lines 2078-2083
subtest '_Findgroupreserve in the context of hold groups' => sub {
Link Here
|
2078 |
|
2078 |
|
2079 |
is( $hold->is_hold_group_target, 1, 'First hold is the hold group target' ); |
2079 |
is( $hold->is_hold_group_target, 1, 'First hold is the hold group target' ); |
2080 |
|
2080 |
|
|
|
2081 |
C4::Reserves::RevertWaitingStatus( { itemnumber => $item->itemnumber } ); |
2082 |
is( $hold->is_hold_group_target, 0, 'First hold is no longer the hold group target' ); |
2083 |
is( $hold->hold_group->target_hold_id, undef, 'Hold group no longer has a target' ); |
2084 |
|
2085 |
AddReturn( $item->barcode, $library_1->{branchcode} ); |
2086 |
ModReserveAffect( $item->itemnumber, undef, $do_transfer, $reserve_id ); |
2087 |
|
2081 |
my @reserves_with_target_hold = C4::Reserves::_Findgroupreserve( $item->biblionumber, $item->id, 0, [] ); |
2088 |
my @reserves_with_target_hold = C4::Reserves::_Findgroupreserve( $item->biblionumber, $item->id, 0, [] ); |
2082 |
|
2089 |
|
2083 |
is( |
2090 |
is( |
2084 |
- |
|
|