Lines 699-705
AddReserve(
Link Here
|
699 |
priority => 1, |
699 |
priority => 1, |
700 |
} |
700 |
} |
701 |
); |
701 |
); |
702 |
MoveReserve( $item->itemnumber, $borrowernumber ); |
702 |
MoveReserve( $item, $patron ); |
703 |
($status) = CheckReserves($item); |
703 |
($status) = CheckReserves($item); |
704 |
is( $status, '', 'MoveReserve filled hold' ); |
704 |
is( $status, '', 'MoveReserve filled hold' ); |
705 |
|
705 |
|
Lines 715-721
AddReserve(
Link Here
|
715 |
itemnumber => $other_item->id, |
715 |
itemnumber => $other_item->id, |
716 |
} |
716 |
} |
717 |
); |
717 |
); |
718 |
MoveReserve( $item->itemnumber, $borrowernumber ); |
718 |
MoveReserve( $item, $patron ); |
719 |
($status) = CheckReserves($item); |
719 |
($status) = CheckReserves($item); |
720 |
is( $status, '', 'MoveReserve filled waiting hold' ); |
720 |
is( $status, '', 'MoveReserve filled waiting hold' ); |
721 |
|
721 |
|
Lines 731-737
AddReserve(
Link Here
|
731 |
reservation_date => $resdate, |
731 |
reservation_date => $resdate, |
732 |
} |
732 |
} |
733 |
); |
733 |
); |
734 |
MoveReserve( $item->itemnumber, $borrowernumber ); |
734 |
MoveReserve( $item, $patron ); |
735 |
($status) = CheckReserves( $item, 1 ); |
735 |
($status) = CheckReserves( $item, 1 ); |
736 |
is( $status, 'Reserved', 'MoveReserve did not fill future hold' ); |
736 |
is( $status, 'Reserved', 'MoveReserve did not fill future hold' ); |
737 |
$dbh->do( 'DELETE FROM reserves', undef, ($bibnum) ); |
737 |
$dbh->do( 'DELETE FROM reserves', undef, ($bibnum) ); |
Lines 747-753
AddReserve(
Link Here
|
747 |
reservation_date => $resdate, |
747 |
reservation_date => $resdate, |
748 |
} |
748 |
} |
749 |
); |
749 |
); |
750 |
MoveReserve( $item->itemnumber, $borrowernumber ); |
750 |
MoveReserve( $item, $patron ); |
751 |
($status) = CheckReserves( $item, undef, 2 ); |
751 |
($status) = CheckReserves( $item, undef, 2 ); |
752 |
is( $status, '', 'MoveReserve filled future hold now' ); |
752 |
is( $status, '', 'MoveReserve filled future hold now' ); |
753 |
|
753 |
|
Lines 761-767
AddReserve(
Link Here
|
761 |
reservation_date => $resdate, |
761 |
reservation_date => $resdate, |
762 |
} |
762 |
} |
763 |
); |
763 |
); |
764 |
MoveReserve( $item->itemnumber, $borrowernumber ); |
764 |
MoveReserve( $item, $patron ); |
765 |
($status) = CheckReserves( $item, undef, 2 ); |
765 |
($status) = CheckReserves( $item, undef, 2 ); |
766 |
is( $status, '', 'MoveReserve filled future waiting hold now' ); |
766 |
is( $status, '', 'MoveReserve filled future waiting hold now' ); |
767 |
|
767 |
|
Lines 777-783
AddReserve(
Link Here
|
777 |
reservation_date => $resdate, |
777 |
reservation_date => $resdate, |
778 |
} |
778 |
} |
779 |
); |
779 |
); |
780 |
MoveReserve( $item->itemnumber, $borrowernumber ); |
780 |
MoveReserve( $item, $patron ); |
781 |
($status) = CheckReserves( $item, 3 ); |
781 |
($status) = CheckReserves( $item, 3 ); |
782 |
is( $status, 'Reserved', 'MoveReserve did not fill future hold of 3 days' ); |
782 |
is( $status, 'Reserved', 'MoveReserve did not fill future hold of 3 days' ); |
783 |
$dbh->do( 'DELETE FROM reserves', undef, ($bibnum) ); |
783 |
$dbh->do( 'DELETE FROM reserves', undef, ($bibnum) ); |
Lines 1176-1182
subtest 'MoveReserve additional test' => sub {
Link Here
|
1176 |
); |
1176 |
); |
1177 |
|
1177 |
|
1178 |
# The 2nd hold should be filled even if the item is preselected for the first hold |
1178 |
# The 2nd hold should be filled even if the item is preselected for the first hold |
1179 |
MoveReserve( $item_1->itemnumber, $patron_2->borrowernumber ); |
1179 |
MoveReserve( $item_1, $patron_2 ); |
1180 |
is( $patron_2->holds->count, 0, "The 2nd patrons no longer has a hold" ); |
1180 |
is( $patron_2->holds->count, 0, "The 2nd patrons no longer has a hold" ); |
1181 |
is( |
1181 |
is( |
1182 |
$patron_2->old_holds->next()->reserve_id, $reserve_2, |
1182 |
$patron_2->old_holds->next()->reserve_id, $reserve_2, |
Lines 1194-1200
subtest 'MoveReserve additional test' => sub {
Link Here
|
1194 |
); |
1194 |
); |
1195 |
|
1195 |
|
1196 |
# The 3rd hold should not be filled as it is an item level hold on a different item |
1196 |
# The 3rd hold should not be filled as it is an item level hold on a different item |
1197 |
MoveReserve( $item_1->itemnumber, $patron_2->borrowernumber ); |
1197 |
MoveReserve( $item_1, $patron_2 ); |
1198 |
is( $patron_2->holds->count, 1, "The 2nd patron still has a hold" ); |
1198 |
is( $patron_2->holds->count, 1, "The 2nd patron still has a hold" ); |
1199 |
is( $patron_2->old_holds->count, 1, "The 2nd patron has only 1 old holds" ); |
1199 |
is( $patron_2->old_holds->count, 1, "The 2nd patron has only 1 old holds" ); |
1200 |
|
1200 |
|
Lines 1202-1208
subtest 'MoveReserve additional test' => sub {
Link Here
|
1202 |
$hold_3->item_level_hold(0)->store(); |
1202 |
$hold_3->item_level_hold(0)->store(); |
1203 |
|
1203 |
|
1204 |
# The 3rd hold should now be filled as it is a title level hold, even though associated with a different item |
1204 |
# The 3rd hold should now be filled as it is a title level hold, even though associated with a different item |
1205 |
MoveReserve( $item_1->itemnumber, $patron_2->borrowernumber ); |
1205 |
MoveReserve( $item_1, $patron_2 ); |
1206 |
is( $patron_2->holds->count, 0, "The 2nd patron no longer has a hold" ); |
1206 |
is( $patron_2->holds->count, 0, "The 2nd patron no longer has a hold" ); |
1207 |
is( $patron_2->old_holds->count(), 2, "The 2nd patron's hold was filled and moved to old holds" ); |
1207 |
is( $patron_2->old_holds->count(), 2, "The 2nd patron's hold was filled and moved to old holds" ); |
1208 |
|
1208 |
|
1209 |
- |
|
|