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