|
Lines 26-32
use C4::Reserves;
Link Here
|
| 26 |
use Koha::DateUtils; |
26 |
use Koha::DateUtils; |
| 27 |
use Koha::Database; |
27 |
use Koha::Database; |
| 28 |
|
28 |
|
| 29 |
use Test::More tests => 59; |
29 |
use Test::More tests => 60; |
| 30 |
|
30 |
|
| 31 |
BEGIN { |
31 |
BEGIN { |
| 32 |
use_ok('C4::Circulation'); |
32 |
use_ok('C4::Circulation'); |
|
Lines 297-305
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 297 |
is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds'); |
297 |
is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds'); |
| 298 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber2); |
298 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber2); |
| 299 |
is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds'); |
299 |
is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds'); |
|
|
300 |
|
| 301 |
# Now let's add an item level hold, we should no longer be able to renew the item |
| 302 |
my $hold = Koha::Database->new()->schema()->resultset('Reserve')->create( |
| 303 |
{ |
| 304 |
borrowernumber => $hold_waiting_borrowernumber, |
| 305 |
biblionumber => $biblionumber, |
| 306 |
itemnumber => $itemnumber, |
| 307 |
branchcode => $branch, |
| 308 |
priority => 3, |
| 309 |
} |
| 310 |
); |
| 311 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber); |
| 312 |
is( $renewokay, 0, 'Bug 13919 - Renewal possible with item level hold on item'); |
| 313 |
$hold->delete(); |
| 314 |
|
| 300 |
# Now let's add a waiting hold on the 3rd item, it's no longer available tp check out by just anyone, so we should no longer |
315 |
# Now let's add a waiting hold on the 3rd item, it's no longer available tp check out by just anyone, so we should no longer |
| 301 |
# be able to renew these items |
316 |
# be able to renew these items |
| 302 |
my $hold = Koha::Database->new()->schema()->resultset('Reserve')->create( |
317 |
$hold = Koha::Database->new()->schema()->resultset('Reserve')->create( |
| 303 |
{ |
318 |
{ |
| 304 |
borrowernumber => $hold_waiting_borrowernumber, |
319 |
borrowernumber => $hold_waiting_borrowernumber, |
| 305 |
biblionumber => $biblionumber, |
320 |
biblionumber => $biblionumber, |
| 306 |
- |
|
|