Lines 404-411
is(
Link Here
|
404 |
my $letter = ReserveSlip($branch_1, $requesters{$branch_1}, $bibnum); |
404 |
my $letter = ReserveSlip($branch_1, $requesters{$branch_1}, $bibnum); |
405 |
ok(defined($letter), 'can successfully generate hold slip (bug 10949)'); |
405 |
ok(defined($letter), 'can successfully generate hold slip (bug 10949)'); |
406 |
|
406 |
|
407 |
# Tests for bug 9788: Does Koha::Item->holds_placed_before_today return a future wait? |
407 |
# Tests for bug 9788: Does Koha::Item->current_holds return a future wait? |
408 |
# 9788a: holds_placed_before_today does not return future next available hold |
408 |
# 9788a: current_holds does not return future next available hold |
409 |
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); |
409 |
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); |
410 |
t::lib::Mocks::mock_preference('ConfirmFutureHolds', 2); |
410 |
t::lib::Mocks::mock_preference('ConfirmFutureHolds', 2); |
411 |
t::lib::Mocks::mock_preference('AllowHoldDateInFuture', 1); |
411 |
t::lib::Mocks::mock_preference('AllowHoldDateInFuture', 1); |
Lines 416-436
AddReserve($branch_1, $requesters{$branch_1}, $bibnum,
Link Here
|
416 |
$bibitems, 1, $resdate, $expdate, $notes, |
416 |
$bibitems, 1, $resdate, $expdate, $notes, |
417 |
$title, $checkitem, $found); |
417 |
$title, $checkitem, $found); |
418 |
my $item = Koha::Items->find( $itemnumber ); |
418 |
my $item = Koha::Items->find( $itemnumber ); |
419 |
$holds = $item->holds_placed_before_today; |
419 |
$holds = $item->current_holds; |
420 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
420 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
421 |
my $future_holds = $holds->search({ reservedate => { '>' => $dtf->format_date( dt_from_string ) } } ); |
421 |
my $future_holds = $holds->search({ reservedate => { '>' => $dtf->format_date( dt_from_string ) } } ); |
422 |
is( $future_holds->count, 0, 'holds_placed_before_today does not return a future next available hold'); |
422 |
is( $future_holds->count, 0, 'current_holds does not return a future next available hold'); |
423 |
# 9788b: holds_placed_before_today does not return future item level hold |
423 |
# 9788b: current_holds does not return future item level hold |
424 |
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); |
424 |
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); |
425 |
AddReserve($branch_1, $requesters{$branch_1}, $bibnum, |
425 |
AddReserve($branch_1, $requesters{$branch_1}, $bibnum, |
426 |
$bibitems, 1, $resdate, $expdate, $notes, |
426 |
$bibitems, 1, $resdate, $expdate, $notes, |
427 |
$title, $itemnumber, $found); #item level hold |
427 |
$title, $itemnumber, $found); #item level hold |
428 |
$future_holds = $holds->search({ reservedate => { '>' => $dtf->format_date( dt_from_string ) } } ); |
428 |
$future_holds = $holds->search({ reservedate => { '>' => $dtf->format_date( dt_from_string ) } } ); |
429 |
is( $future_holds->count, 0, 'holds_placed_before_today does not return a future item level hold' ); |
429 |
is( $future_holds->count, 0, 'current_holds does not return a future item level hold' ); |
430 |
# 9788c: holds_placed_before_today returns future wait (confirmed future hold) |
430 |
# 9788c: current_holds returns future wait (confirmed future hold) |
431 |
ModReserveAffect( $itemnumber, $requesters{$branch_1} , 0); #confirm hold |
431 |
ModReserveAffect( $itemnumber, $requesters{$branch_1} , 0); #confirm hold |
432 |
$future_holds = $holds->search({ reservedate => { '>' => $dtf->format_date( dt_from_string ) } } ); |
432 |
$future_holds = $holds->search({ reservedate => { '>' => $dtf->format_date( dt_from_string ) } } ); |
433 |
is( $future_holds->count, 1, 'holds_placed_before_today returns a future wait (confirmed future hold)' ); |
433 |
is( $future_holds->count, 1, 'current_holds returns a future wait (confirmed future hold)' ); |
434 |
# End of tests for bug 9788 |
434 |
# End of tests for bug 9788 |
435 |
|
435 |
|
436 |
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); |
436 |
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); |
437 |
- |
|
|