View | Details | Raw Unified | Return to bug 13919
Collapse All | Expand All

(-)a/t/db_dependent/Circulation.t (-2 / +16 lines)
Lines 300-308 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
300
    is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds');
300
    is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds');
301
    ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber2);
301
    ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber2);
302
    is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds');
302
    is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds');
303
304
    # Now let's add an item level hold, we should no longer be able to renew the item
305
    my $hold = Koha::Database->new()->schema()->resultset('Reserve')->create(
306
        {
307
            borrowernumber => $hold_waiting_borrowernumber,
308
            biblionumber   => $biblionumber,
309
            itemnumber     => $itemnumber,
310
            branchcode     => $branch,
311
            priority       => 3,
312
        }
313
    );
314
    ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber);
315
    is( $renewokay, 0, 'Bug 13919 - Renewal possible with item level hold on item');
316
    $hold->delete();
317
303
    # 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
318
    # 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
304
    # be able to renew these items
319
    # be able to renew these items
305
    my $hold = Koha::Database->new()->schema()->resultset('Reserve')->create(
320
    $hold = Koha::Database->new()->schema()->resultset('Reserve')->create(
306
        {
321
        {
307
            borrowernumber => $hold_waiting_borrowernumber,
322
            borrowernumber => $hold_waiting_borrowernumber,
308
            biblionumber   => $biblionumber,
323
            biblionumber   => $biblionumber,
309
- 

Return to bug 13919