|
Lines 34-40
use Koha::DateUtils qw(dt_from_string);
Link Here
|
| 34 |
use Koha::Holds; |
34 |
use Koha::Holds; |
| 35 |
use Koha::Libraries; |
35 |
use Koha::Libraries; |
| 36 |
use Koha::Old::Holds; |
36 |
use Koha::Old::Holds; |
| 37 |
use C4::Reserves qw( AddReserve ModReserveAffect ); |
37 |
use C4::Reserves qw( AddReserve ModReserveAffect RevertWaitingStatus); |
| 38 |
use C4::Circulation qw( AddReturn ); |
38 |
use C4::Circulation qw( AddReturn ); |
| 39 |
|
39 |
|
| 40 |
my $schema = Koha::Database->new->schema; |
40 |
my $schema = Koha::Database->new->schema; |
|
Lines 1389-1395
subtest 'is_hold_group_target, cleanup_hold_group and set_as_hold_group_target t
Link Here
|
| 1389 |
}; |
1389 |
}; |
| 1390 |
|
1390 |
|
| 1391 |
subtest '_Findgroupreserve in the context of hold groups' => sub { |
1391 |
subtest '_Findgroupreserve in the context of hold groups' => sub { |
| 1392 |
plan tests => 17; |
1392 |
plan tests => 19; |
| 1393 |
|
1393 |
|
| 1394 |
$schema->storage->txn_begin; |
1394 |
$schema->storage->txn_begin; |
| 1395 |
|
1395 |
|
|
Lines 1490-1495
subtest '_Findgroupreserve in the context of hold groups' => sub {
Link Here
|
| 1490 |
|
1490 |
|
| 1491 |
is( $hold->is_hold_group_target, 1, 'First hold is the hold group target' ); |
1491 |
is( $hold->is_hold_group_target, 1, 'First hold is the hold group target' ); |
| 1492 |
|
1492 |
|
|
|
1493 |
C4::Reserves::RevertWaitingStatus( { itemnumber => $item->itemnumber } ); |
| 1494 |
is( $hold->is_hold_group_target, 0, 'First hold is no longer the hold group target' ); |
| 1495 |
is( $hold->hold_group->target_hold_id, undef, 'Hold group no longer has a target' ); |
| 1496 |
|
| 1497 |
AddReturn( $item->barcode, $library_1->{branchcode} ); |
| 1498 |
ModReserveAffect( $item->itemnumber, undef, $do_transfer, $reserve_id ); |
| 1499 |
|
| 1493 |
my @reserves_with_target_hold = C4::Reserves::_Findgroupreserve( $item->biblionumber, $item->id, 0, [] ); |
1500 |
my @reserves_with_target_hold = C4::Reserves::_Findgroupreserve( $item->biblionumber, $item->id, 0, [] ); |
| 1494 |
|
1501 |
|
| 1495 |
is( |
1502 |
is( |
| 1496 |
- |
|
|