|
Lines 288-294
Koha::CirculationRules->set_rules(
Link Here
|
| 288 |
); |
288 |
); |
| 289 |
|
289 |
|
| 290 |
subtest "CanBookBeRenewed AllowRenewalIfOtherItemsAvailable multiple borrowers and items tests" => sub { |
290 |
subtest "CanBookBeRenewed AllowRenewalIfOtherItemsAvailable multiple borrowers and items tests" => sub { |
| 291 |
plan tests => 5; |
291 |
plan tests => 7; |
| 292 |
|
292 |
|
| 293 |
#Can only reserve from home branch |
293 |
#Can only reserve from home branch |
| 294 |
Koha::CirculationRules->set_rule( |
294 |
Koha::CirculationRules->set_rule( |
|
Lines 334-340
subtest "CanBookBeRenewed AllowRenewalIfOtherItemsAvailable multiple borrowers a
Link Here
|
| 334 |
is (defined $issue->date_due(), 1, "Item 1 checked out, due date: " . $issue->date_due() ); |
334 |
is (defined $issue->date_due(), 1, "Item 1 checked out, due date: " . $issue->date_due() ); |
| 335 |
|
335 |
|
| 336 |
# Biblio-level holds |
336 |
# Biblio-level holds |
| 337 |
AddReserve( |
337 |
my $reserve_1 = AddReserve( |
| 338 |
{ |
338 |
{ |
| 339 |
branchcode => $patron_hold_1->branchcode, |
339 |
branchcode => $patron_hold_1->branchcode, |
| 340 |
borrowernumber => $patron_hold_1->borrowernumber, |
340 |
borrowernumber => $patron_hold_1->borrowernumber, |
|
Lines 370-375
subtest "CanBookBeRenewed AllowRenewalIfOtherItemsAvailable multiple borrowers a
Link Here
|
| 370 |
is( $renewokay, 1, 'Can renew, two items available for two holds'); |
370 |
is( $renewokay, 1, 'Can renew, two items available for two holds'); |
| 371 |
is( $error, undef, 'Can renew, each reserve has an item'); |
371 |
is( $error, undef, 'Can renew, each reserve has an item'); |
| 372 |
|
372 |
|
|
|
373 |
# Item level hold |
| 374 |
my $hold = Koha::Holds->find( $reserve_1 ); |
| 375 |
$hold->itemnumber( $item_1->itemnumber )->store; |
| 376 |
|
| 377 |
( $renewokay, $error ) = CanBookBeRenewed($patron_borrower->borrowernumber, $item_1->itemnumber); |
| 378 |
is( $renewokay, 0, 'Cannot renew when there is an item specific hold'); |
| 379 |
is( $error, 'on_reserve', 'Cannot renew, only this item can fill the reserve'); |
| 373 |
|
380 |
|
| 374 |
}; |
381 |
}; |
| 375 |
|
382 |
|
| 376 |
- |
|
|