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

(-)a/C4/Circulation.pm (+36 lines)
Lines 4471-4476 sub LostItem { Link Here
4471
    while ( my $transfer = $transfers->next ) {
4471
    while ( my $transfer = $transfers->next ) {
4472
        $transfer->cancel( { reason => 'ItemLost', force => 1 } );
4472
        $transfer->cancel( { reason => 'ItemLost', force => 1 } );
4473
    }
4473
    }
4474
4475
    # RevertLostBibLevelHolds
4476
    my $hold = Koha::Holds->find( { itemnumber => $itemnumber, found => { '!=' => undef } } );
4477
    if ( C4::Context->preference('RevertLostBibLevelHolds') && defined $hold ) {
4478
4479
        # syspref is enabled and there is a waiting hold for this item
4480
        if ( $hold->item_level_hold && defined $params->{cancel_reserve} ) {
4481
            if ( $params->{cancel_reserve} ) {
4482
4483
                # cancel item-level hold
4484
                $hold->cancel;
4485
            } else {    # eq 'revert'
4486
                        # revert item-level hold's waiting status
4487
                $hold->revert_found();
4488
            }
4489
        }
4490
        if ( !$hold->item_level_hold ) {
4491
4492
            # revert biblio-level hold's waiting status
4493
            $hold->revert_found();
4494
        }
4495
    }
4496
4497
    # SendLostHoldNotices
4498
    if ( C4::Context->preference('SendLostHoldNotices') && defined $hold && $item->itemlost ) {
4499
        my $letter = C4::Letters::GetPreparedLetter(
4500
            module      => 'reserves',
4501
            letter_code => 'LOST_WAITING_HOLD',
4502
            branchcode  => $hold->branchcode,
4503
            tables      => {
4504
                borrowers => $hold->borrowernumber,
4505
                branches  => $hold->branchcode,
4506
            },
4507
        );
4508
        C4::Message->enqueue( $letter, $hold->borrower, 'email' );
4509
    }
4474
}
4510
}
4475
4511
4476
=head2 GetOfflineOperations
4512
=head2 GetOfflineOperations
(-)a/catalogue/moredetail.pl (+5 lines)
Lines 256-261 foreach my $item (@items) { Link Here
256
256
257
    $item_info->{nomod} = !$patron->can_edit_items_from( $item->homebranch );
257
    $item_info->{nomod} = !$patron->can_edit_items_from( $item->homebranch );
258
258
259
    if ( C4::Context->preference('RevertLostBibLevelHolds') ) {
260
        $item_info->{waiting_holds} =
261
            $item->holds( { found => [ 'W', 'T' ], item_level_hold => { '!=' => 0 } } )->count;
262
    }
263
259
    push @item_data, $item_info;
264
    push @item_data, $item_info;
260
}
265
}
261
266
(-)a/catalogue/updateitem.pl (+15 lines)
Lines 40-45 my $withdrawn = $cgi->param('withdrawn'); Link Here
40
my $damaged                           = $cgi->param('damaged');
40
my $damaged                           = $cgi->param('damaged');
41
my $exclude_from_local_holds_priority = $cgi->param('exclude_from_local_holds_priority');
41
my $exclude_from_local_holds_priority = $cgi->param('exclude_from_local_holds_priority');
42
my $bookable                          = $cgi->param('bookable') // q{};
42
my $bookable                          = $cgi->param('bookable') // q{};
43
my $cancelhold                        = $cgi->param('cancelhold');
44
my $reverthold                        = $cgi->param('reverthold');
45
my $redirecturl                       = $cgi->param('redirecturl');
46
47
if ( defined $cancelhold ) {
48
    LostItem( $itemnumber, 'moredetail', 0, { cancel_reserve => $cancelhold } );
49
} elsif ( defined $reverthold ) {
50
    $cancelhold = 0;
51
    LostItem( $itemnumber, 'moredetail', 0, { cancel_reserve => $cancelhold } );
52
} else {
53
    $cancelhold = undef;
54
}
55
if ( defined $redirecturl ) {
56
    print $cgi->redirect( $redirecturl . $biblionumber );
57
}
43
58
44
my $confirm = $cgi->param('confirm');
59
my $confirm = $cgi->param('confirm');
45
my $dbh     = C4::Context->dbh;
60
my $dbh     = C4::Context->dbh;
(-)a/cataloguing/additem.pl (+13 lines)
Lines 811-816 my @ig = Koha::Biblio::ItemGroups->search( { biblio_id => $biblionumber } )->as_ Link Here
811
#sort by display order
811
#sort by display order
812
my @sorted_ig = sort { $a->display_order <=> $b->display_order } @ig;
812
my @sorted_ig = sort { $a->display_order <=> $b->display_order } @ig;
813
813
814
if ( C4::Context->preference('RevertLostBibLevelHolds') ) {
815
    my @lostitems = Koha::Items->search( { biblionumber => $biblionumber, itemlost => { '!=' => 0 } } )->as_list;
816
817
    # find if any of these lost items have waiting holds
818
    my @waitinglostitems;
819
    foreach my $lostitem (@lostitems) {
820
        if ( $lostitem->holds( { found => [ 'W', 'T' ], item_level_hold => 1 } )->count > 0 ) {
821
            push( @waitinglostitems, $lostitem );
822
        }
823
    }
824
    $template->param( waitinglostitems => \@waitinglostitems );
825
}
826
814
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
827
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
815
$template->param(
828
$template->param(
816
    biblio           => $biblio,
829
    biblio           => $biblio,
(-)a/installer/data/mysql/atomicupdate/bug_20844-add_LOST_WAITING_HOLD_notice.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, message_transport_type, content) VALUES ('reserves','LOST_WAITING_HOLD','','Waiting hold marked lost','0','Your waiting hold has been marked lost','email',"Dear [% borrower.firstname %] [% borrowers.surname %],<br><br>Your hold awaiting pickup is no longer available. The item is lost.<br><br>Please contact the library for more information.<br><br>Thank you,<br><br>[% branch.branchname %]") });
4
5
    NewVersion( $DBversion, 20844, "Add LOST_WAITING_HOLD notice");
6
}
(-)a/installer/data/mysql/atomicupdate/bug_20844-add_RevertLostBibLevelHolds_syspref.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('RevertLostBibLevelHolds', '0', NULL, 'If an item is marked as lost after being allocated for a biblio-level hold, revert the hold from its waiting status', 'YesNo') });
4
5
    NewVersion( $DBversion, 20844, "Add RevertLostBibLevelHolds system preference");
6
}
(-)a/installer/data/mysql/atomicupdate/bug_20844-add_SendLostHoldNotices_syspref.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('SendLostHoldNotices', '0', NULL, 'Send a notice to a borrower if their reserved and waiting item is marked as lost', 'YesNo') });
4
5
    NewVersion( $DBversion, 20844, "Add SendLostHoldNotices system preference");
6
}
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (+19 lines)
Lines 2721-2723 tables: Link Here
2721
            - "[% skipped %] records skipped"
2721
            - "[% skipped %] records skipped"
2722
            - "[% in_error %] records in error"
2722
            - "[% in_error %] records in error"
2723
            - "[% total %] total"
2723
            - "[% total %] total"
2724
2725
        - module: reserves
2726
          code: LOST_WAITING_HOLD
2727
          branchcode: ""
2728
          name: "Waiting hold marked lost"
2729
          is_html: 0
2730
          title: "Your waiting hold has been marked lost"
2731
          message_transport_type: email
2732
          lang: default
2733
          content:
2734
            - "Dear [% borrower.firstname %] [% borrowers.surname %],"
2735
            - ""
2736
            - "Your hold awaiting pickup is no longer available. The item is lost."
2737
            - ""
2738
            - "Please contact the library for more information."
2739
            - ""
2740
            - "Thank you,"
2741
            - ""
2742
            - "[% branch.branchname %]"
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+2 lines)
Lines 710-715 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
710
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
710
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
711
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
711
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
712
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
712
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
713
('RevertLostBibLevelHolds', '0', NULL, 'If an item is marked as lost after being allocated for a biblio-level hold, revert the hold from its waiting status', 'YesNo'),
713
('RisExportAdditionalFields',  '', NULL ,  'Define additional RIS tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.',  'textarea'),
714
('RisExportAdditionalFields',  '', NULL ,  'Define additional RIS tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.',  'textarea'),
714
('RoundFinesAtPayment','0', NULL,'If enabled any fines with fractions of a cent will be rounded to the nearest cent when payments are coll    ected. e.g. 1.004 will be paid off by a 1.00 payment','YesNo'),
715
('RoundFinesAtPayment','0', NULL,'If enabled any fines with fractions of a cent will be rounded to the nearest cent when payments are coll    ected. e.g. 1.004 will be paid off by a 1.00 payment','YesNo'),
715
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
716
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
Lines 735-740 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
735
('SelfCheckReceiptPrompt','1','NULL','If ON, print receipt dialog pops up when self checkout is finished','YesNo'),
736
('SelfCheckReceiptPrompt','1','NULL','If ON, print receipt dialog pops up when self checkout is finished','YesNo'),
736
('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'),
737
('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'),
737
('SendAllEmailsTo','',NULL,'All emails will be redirected to this email if it is not empty','free'),
738
('SendAllEmailsTo','',NULL,'All emails will be redirected to this email if it is not empty','free'),
739
('SendLostHoldNotices', '0', NULL, 'Send a notice to a borrower if their reserved and waiting item is marked as lost', 'YesNo'),
738
('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
740
('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
739
('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
741
('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
740
('SerialsDefaultEmailAddress', '', NULL, 'Default email address used as reply-to for notices sent by the serials module.', 'Free'),
742
('SerialsDefaultEmailAddress', '', NULL, 'Default email address used as reply-to for notices sent by the serials module.', 'Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+12 lines)
Lines 770-775 Circulation: Link Here
770
            - pref: HoldRatioDefault
770
            - pref: HoldRatioDefault
771
              class: integer
771
              class: integer
772
            - .
772
            - .
773
        -
774
            - pref: RevertLostBibLevelHolds
775
              choices:
776
                  1: Revert
777
                  0: "Don't revert"
778
            - waiting status of a hold if the allocated item is marked as Lost.
779
        -
780
            - pref: SendLostHoldNotices
781
              choices:
782
                  yes: Send
783
                  no: "Don't send"
784
            - a notice to a borrower if their reserved and waiting item is marked as Lost.
773
        -
785
        -
774
            - In the staff interface, split the holds queue into separate tables by
786
            - In the staff interface, split the holds queue into separate tables by
775
            - pref: HoldsSplitQueue
787
            - pref: HoldsSplitQueue
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+11 lines)
Lines 163-168 Link Here
163
                        </div>
163
                        </div>
164
                    [% END %]
164
                    [% END %]
165
                    <div class="listgroup">
165
                    <div class="listgroup">
166
                        [% IF ITEM_DAT.itemlost and ITEM_DAT.waiting_holds > 0  %]
167
                            <div class="dialog alert">
168
                                This item has a waiting item-level hold on it, and has been marked as lost.<br>
169
                                <form action="updateitem.pl" method="post" class="inline">
170
                                    <input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]">
171
                                    <input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber | html %]">
172
                                    <button type="submit" name="reverthold" value="1" class="btn btn-default"><i class="fa fa-undo"></i> Revert waiting status</button>
173
                                    <button type="submit" name="cancelhold" value="1" class="btn btn-default"><i class="fa fa-times"></i> Cancel hold</button>
174
                                </form>
175
                            </div>
176
                        [% END %]
166
                        <h4>
177
                        <h4>
167
                            Item information
178
                            Item information
168
                            [% UNLESS ( ITEM_DAT.nomod ) %]
179
                            [% UNLESS ( ITEM_DAT.nomod ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (+18 lines)
Lines 101-106 Link Here
101
    [% END %]
101
    [% END %]
102
    [% IF last_item_for_hold %]<div class="alert alert-warning"><strong>Cannot delete</strong>: Last item for bibliographic record with biblio-level hold on it.</div>[% END %]
102
    [% IF last_item_for_hold %]<div class="alert alert-warning"><strong>Cannot delete</strong>: Last item for bibliographic record with biblio-level hold on it.</div>[% END %]
103
    [% IF item_not_found %]<div class="alert alert-warning"><strong>Cannot delete</strong>: Item not found.</div>[% END %]
103
    [% IF item_not_found %]<div class="alert alert-warning"><strong>Cannot delete</strong>: Item not found.</div>[% END %]
104
    [% IF waitinglostitems %]
105
        <div class="dialog alert">
106
            The following item(s) have a waiting item-level hold and have been marked as lost.
107
            <ul>
108
            [% FOREACH i IN waitinglostitems %]
109
                <br>
110
                <li>Item (<i>[% i.barcode | html %]</i>)
111
                <form action="../catalogue/updateitem.pl" method="post" class="inline">
112
                    <input type="hidden" name="itemnumber" value="[% i.itemnumber | html %]">
113
                    <input type="hidden" name="biblionumber" value="[% i.biblionumber | html %]">
114
                    <input type="hidden" name="redirecturl" value="../cataloguing/additem.pl?biblionumber=">
115
                    <button type="submit" name="reverthold" value="1" class="btn btn-default"><i class="fa fa-undo"></i> Revert waiting status</button>
116
                    <button type="submit" name="cancelhold" value="1" class="btn btn-default"><i class="fa fa-times"></i> Cancel hold</button></li>
117
                </form>
118
            [% END %]
119
            </ul>
120
        </div>
121
    [% END %]
104
122
105
    <div id="cataloguing_additem_itemlist">
123
    <div id="cataloguing_additem_itemlist">
106
        [% IF items %]
124
        [% IF items %]
(-)a/t/db_dependent/Reserves.t (-2 / +156 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 71;
20
use Test::More tests => 72;
21
use Test::NoWarnings;
21
use Test::NoWarnings;
22
use Test::MockModule;
22
use Test::MockModule;
23
use Test::Warn;
23
use Test::Warn;
Lines 1421-1426 subtest 'ModReserveAffect logging' => sub { Link Here
1421
    like( $log->info, qr{$expected}, 'Timestamp logged is the current one' );
1421
    like( $log->info, qr{$expected}, 'Timestamp logged is the current one' );
1422
};
1422
};
1423
1423
1424
subtest 'Waiting item is marked as lost' => sub {
1425
1426
    plan tests => 17;
1427
1428
    # Set up data
1429
    my $biblio = $builder->build_sample_biblio();
1430
    my $item   = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } );
1431
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
1432
    t::lib::Mocks::mock_preference( 'SendLostHoldNotices', 0 );
1433
    my $original_notice_count = Koha::Notice::Messages->search( { letter_code => "LOST_WAITING_HOLD" } )->count;
1434
    ## TEST 1: BIBLIO-LEVEL HOLD
1435
1436
    # place biblio-level hold
1437
    my $reserve_id = AddReserve(
1438
        {
1439
            branchcode     => $item->homebranch,
1440
            borrowernumber => $patron->borrowernumber,
1441
            biblionumber   => $biblio->biblionumber,
1442
        }
1443
    );
1444
    my $hold = Koha::Holds->find($reserve_id);
1445
1446
    $dbh->do(
1447
        q{INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, message_transport_type, content) VALUES ('reserves','LOST_WAITING_HOLD','','Waiting hold marked lost','0','Your waiting hold has been marked lost','email',"Dear [% borrower.firstname %] [% borrowers.surname %],<br><br>Your hold awaiting pickup is no longer available. The item is lost.<br><br>Please contact the library for more information.<br><br>Thank you,<br><br>[% branch.branchname %]") }
1448
    );
1449
1450
    is( $hold->item_level_hold, 0, 'Biblio-level hold placed' );
1451
1452
    # set hold as waiting and assign item
1453
    $hold->set( { itemnumber => $item->itemnumber } )->store;
1454
    $hold->set_waiting;
1455
1456
    # mark item in biblio as lost
1457
    $item->itemlost(1)->store;
1458
    is( $item->itemlost, 1, 'Item assigned to waiting hold has been marked lost' );
1459
1460
    # do test
1461
    t::lib::Mocks::mock_preference( 'RevertLostBibLevelHolds', 0 );
1462
    C4::Circulation::LostItem( $item->itemnumber, 'test', 0, { cancel_reserve => 0 } );
1463
    is(
1464
        $hold->found, 'W',
1465
        'Hold is still waiting even though the item is lost because RevertLostBibLevelHolds is disabled'
1466
    );
1467
1468
    # enable preference
1469
    t::lib::Mocks::mock_preference( 'RevertLostBibLevelHolds', 1 );
1470
1471
    # try again
1472
    is( $item->itemlost, 1, 'Item assigned to waiting hold has been marked lost' );
1473
    C4::Circulation::LostItem( $item->itemnumber, 'test', 0, { cancel_reserve => 0 } );
1474
    $hold = Koha::Holds->find($reserve_id);
1475
    is( $hold->found, undef, 'Hold waiting status has been reverted because RevertLostBibLevelHolds is enabled' );
1476
1477
    # clean up
1478
    $hold->cancel;
1479
    $item->itemlost(0);
1480
1481
    ## TEST 2: ITEM-LEVEL HOLD, REVERT
1482
1483
    # place item-level hold
1484
    $reserve_id = AddReserve(
1485
        {
1486
            branchcode     => $item->homebranch,
1487
            borrowernumber => $patron->borrowernumber,
1488
            biblionumber   => $biblio->biblionumber,
1489
            itemnumber     => $item->itemnumber
1490
        }
1491
    );
1492
    $hold = Koha::Holds->find($reserve_id);
1493
1494
    is( $hold->item_level_hold, 1, 'Item-level hold placed' );
1495
1496
    # set hold as waiting and assign item
1497
    $hold->set_waiting;
1498
    $hold->set( { itemnumber => $item->itemnumber, priority => 0 } )->store;
1499
1500
    # mark item in biblio as lost
1501
    $item->itemlost(1);
1502
    is( $item->itemlost, 1, 'Item assigned to waiting hold has been marked lost' );
1503
1504
    # do test
1505
    t::lib::Mocks::mock_preference( 'RevertLostBibLevelHolds', 0 );
1506
    C4::Circulation::LostItem( $item->itemnumber, 'test', 0, { cancel_reserve => 0 } );
1507
    is(
1508
        $hold->found, 'W',
1509
        'Hold is still waiting even though the item is lost because RevertLostBibLevelHolds is disabled'
1510
    );
1511
1512
    # enable preference
1513
    t::lib::Mocks::mock_preference( 'RevertLostBibLevelHolds', 1 );
1514
1515
    # try again
1516
    is( $item->itemlost, 1, 'Item assigned to waiting hold has been marked lost' );
1517
    C4::Circulation::LostItem( $item->itemnumber, 'test', 0, { cancel_reserve => 0 } );
1518
    $hold = Koha::Holds->find($reserve_id);
1519
    is(
1520
        $hold->found, undef,
1521
        'Hold waiting status has been reverted because RevertLostBibLevelHolds is enabled, and we chose not to cancel'
1522
    );
1523
1524
    # clean up
1525
    $hold->cancel;
1526
    $item->itemlost(0);
1527
1528
    my $current_notice_count = Koha::Notice::Messages->search( { letter_code => "LOST_WAITING_HOLD" } )->count;
1529
    is( $current_notice_count, $original_notice_count, 'No notices enqueued because SendLostHoldNotices disabled' );
1530
1531
    # TEST 3: ITEM-LEVEL HOLD, CANCEL
1532
    t::lib::Mocks::mock_preference( 'SendLostHoldNotices', 1 );
1533
1534
    # place item-level hold
1535
    $reserve_id = AddReserve(
1536
        {
1537
            branchcode     => $item->homebranch,
1538
            borrowernumber => $patron->borrowernumber,
1539
            biblionumber   => $biblio->biblionumber,
1540
            itemnumber     => $item->itemnumber
1541
        }
1542
    );
1543
    $hold = Koha::Holds->find($reserve_id);
1544
1545
    is( $hold->item_level_hold, 1, 'Item-level hold placed' );
1546
1547
    # set hold as waiting and assign item
1548
    $hold->set_waiting;
1549
    $hold->set( { itemnumber => $item->itemnumber, priority => 0 } )->store;
1550
1551
    # mark item in biblio as lost
1552
    $item->itemlost(1);
1553
    is( $item->itemlost, 1, 'Item assigned to waiting hold has been marked lost' );
1554
1555
    # do test
1556
    t::lib::Mocks::mock_preference( 'RevertLostBibLevelHolds', 0 );
1557
    C4::Circulation::LostItem( $item->itemnumber, 'test', 0, { cancel_reserve => 1 } );
1558
    is(
1559
        $hold->found, 'W',
1560
        'Hold is still waiting even though the item is lost because RevertLostBibLevelHolds is disabled'
1561
    );
1562
1563
    # enable preference
1564
    t::lib::Mocks::mock_preference( 'RevertLostBibLevelHolds', 1 );
1565
1566
    # try again
1567
    is( $item->itemlost, 1, 'Item assigned to waiting hold has been marked lost' );
1568
    C4::Circulation::LostItem( $item->itemnumber, 'test', 0, { cancel_reserve => 1 } );
1569
    $hold = Koha::Holds->find($reserve_id);
1570
    is( Koha::Holds->find($reserve_id), undef, 'Hold has been cancelled with RevertLostBibLevelHolds enabled' );
1571
1572
    $current_notice_count = Koha::Notice::Messages->search( { letter_code => "LOST_WAITING_HOLD" } )->count;
1573
    is(
1574
        $current_notice_count, $original_notice_count + 2,
1575
        'LOST_WAITING_HOLD notice enqueued with each call to LostItem'
1576
    );
1577
};
1578
1424
sub count_hold_print_messages {
1579
sub count_hold_print_messages {
1425
    my $message_count = $dbh->selectall_arrayref(
1580
    my $message_count = $dbh->selectall_arrayref(
1426
        q{
1581
        q{
1427
- 

Return to bug 20844