|
Lines 153-158
$requesters{'CPL'} = AddMember(
Link Here
|
| 153 |
categorycode => 'PT', |
153 |
categorycode => 'PT', |
| 154 |
surname => 'borrower from CPL', |
154 |
surname => 'borrower from CPL', |
| 155 |
); |
155 |
); |
|
|
156 |
for my $i ( 2 .. 5 ) { |
| 157 |
$requesters{"CPL$i"} = AddMember( |
| 158 |
branchcode => 'CPL', |
| 159 |
categorycode => 'PT', |
| 160 |
surname => 'borrower $i from CPL', |
| 161 |
); |
| 162 |
} |
| 156 |
$requesters{'FPL'} = AddMember( |
163 |
$requesters{'FPL'} = AddMember( |
| 157 |
branchcode => 'FPL', |
164 |
branchcode => 'FPL', |
| 158 |
categorycode => 'PT', |
165 |
categorycode => 'PT', |
|
Lines 393-403
ModReserveAffect( $itemnumber, $requesters{'CPL'} , 0); #confirm hold
Link Here
|
| 393 |
is(defined $results[3]?1:0, 1, 'GetReservesFromItemnumber returns a future wait (confirmed future hold)'); |
400 |
is(defined $results[3]?1:0, 1, 'GetReservesFromItemnumber returns a future wait (confirmed future hold)'); |
| 394 |
# End of tests for bug 9788 |
401 |
# End of tests for bug 9788 |
| 395 |
|
402 |
|
|
|
403 |
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); |
| 396 |
# Tests for CalculatePriority (bug 8918) |
404 |
# Tests for CalculatePriority (bug 8918) |
| 397 |
my $p = C4::Reserves::CalculatePriority($bibnum2); |
405 |
my $p = C4::Reserves::CalculatePriority($bibnum2); |
| 398 |
is($p, 4, 'CalculatePriority should now return priority 4'); |
406 |
is($p, 4, 'CalculatePriority should now return priority 4'); |
| 399 |
$resdate=undef; |
407 |
$resdate=undef; |
| 400 |
AddReserve('CPL', $requesters{'CPL'}, $bibnum2, |
408 |
AddReserve('CPL', $requesters{'CPL2'}, $bibnum2, |
| 401 |
$bibitems, $p, $resdate, $expdate, $notes, |
409 |
$bibitems, $p, $resdate, $expdate, $notes, |
| 402 |
$title, $checkitem, $found); |
410 |
$title, $checkitem, $found); |
| 403 |
$p = C4::Reserves::CalculatePriority($bibnum2); |
411 |
$p = C4::Reserves::CalculatePriority($bibnum2); |
|
Lines 416-422
ModReserveAffect( $itemnumber, $requesters{'CPL'} , 0);
Link Here
|
| 416 |
$p = C4::Reserves::CalculatePriority($bibnum); |
424 |
$p = C4::Reserves::CalculatePriority($bibnum); |
| 417 |
is($p, 1, 'CalculatePriority should now return priority 1'); |
425 |
is($p, 1, 'CalculatePriority should now return priority 1'); |
| 418 |
#add another biblio hold, no resdate |
426 |
#add another biblio hold, no resdate |
| 419 |
AddReserve('CPL', $requesters{'CPL'}, $bibnum, |
427 |
AddReserve('CPL', $requesters{'CPL2'}, $bibnum, |
| 420 |
$bibitems, $p, $resdate, $expdate, $notes, |
428 |
$bibitems, $p, $resdate, $expdate, $notes, |
| 421 |
$title, $checkitem, $found); |
429 |
$title, $checkitem, $found); |
| 422 |
$p = C4::Reserves::CalculatePriority($bibnum); |
430 |
$p = C4::Reserves::CalculatePriority($bibnum); |
|
Lines 425-431
is($p, 2, 'CalculatePriority should now return priority 2');
Link Here
|
| 425 |
C4::Context->set_preference('AllowHoldDateInFuture', 1); |
433 |
C4::Context->set_preference('AllowHoldDateInFuture', 1); |
| 426 |
$resdate= dt_from_string(); |
434 |
$resdate= dt_from_string(); |
| 427 |
$resdate->add_duration(DateTime::Duration->new(days => 1)); |
435 |
$resdate->add_duration(DateTime::Duration->new(days => 1)); |
| 428 |
AddReserve('CPL', $requesters{'CPL'}, $bibnum, |
436 |
AddReserve('CPL', $requesters{'CPL3'}, $bibnum, |
| 429 |
$bibitems, $p, output_pref($resdate), $expdate, $notes, |
437 |
$bibitems, $p, output_pref($resdate), $expdate, $notes, |
| 430 |
$title, $checkitem, $found); |
438 |
$title, $checkitem, $found); |
| 431 |
$p = C4::Reserves::CalculatePriority($bibnum); |
439 |
$p = C4::Reserves::CalculatePriority($bibnum); |
| 432 |
- |
|
|