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

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 1685-1691 sub _Findgroupreserve { Link Here
1685
        FROM reserves
1685
        FROM reserves
1686
        JOIN biblioitems USING (biblionumber)
1686
        JOIN biblioitems USING (biblionumber)
1687
        JOIN hold_fill_targets USING (biblionumber, borrowernumber)
1687
        JOIN hold_fill_targets USING (biblionumber, borrowernumber)
1688
        WHERE ( ( found IS NULL AND priority > 0 ) OR found='T' )
1688
        WHERE ( ( found IS NULL AND priority > 0 ) OR found IN ('T','W') )
1689
        AND item_level_request = 0
1689
        AND item_level_request = 0
1690
        AND hold_fill_targets.itemnumber = ?
1690
        AND hold_fill_targets.itemnumber = ?
1691
        AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY)
1691
        AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY)
(-)a/t/db_dependent/Reserves.t (-2 / +11 lines)
Lines 1080-1086 subtest 'RevertWaitingStatus' => sub { Link Here
1080
1080
1081
subtest 'CheckReserves additional test' => sub {
1081
subtest 'CheckReserves additional test' => sub {
1082
1082
1083
    plan tests => 3;
1083
    plan tests => 6;
1084
1084
1085
    my $biblio = $builder->build_sample_biblio();
1085
    my $biblio = $builder->build_sample_biblio();
1086
    my $itype = $builder->build_object({ class => "Koha::ItemTypes", value => { notforloan => 0 } });
1086
    my $itype = $builder->build_object({ class => "Koha::ItemTypes", value => { notforloan => 0 } });
Lines 1134-1139 subtest 'CheckReserves additional test' => sub { Link Here
1134
        }
1134
        }
1135
    });
1135
    });
1136
1136
1137
     # We set one reserve in transit - equivalent to checking it in at another branch and confirming transfer
1137
     ModReserveAffect( $item_1->itemnumber, $reserve1->borrowernumber, 1, $reserve1->reserve_id );
1138
     ModReserveAffect( $item_1->itemnumber, $reserve1->borrowernumber, 1, $reserve1->reserve_id );
1138
     my ($status, $matched_reserve, $possible_reserves) = CheckReserves($item_1->itemnumber);
1139
     my ($status, $matched_reserve, $possible_reserves) = CheckReserves($item_1->itemnumber);
1139
1140
Lines 1141-1146 subtest 'CheckReserves additional test' => sub { Link Here
1141
     is( $matched_reserve->{reserve_id}, $reserve1->reserve_id, "We got the Transit reserve");
1142
     is( $matched_reserve->{reserve_id}, $reserve1->reserve_id, "We got the Transit reserve");
1142
     is( scalar @$possible_reserves, 1, 'We only get the one matched');
1143
     is( scalar @$possible_reserves, 1, 'We only get the one matched');
1143
1144
1145
1146
     # We set the reserve to waiting - equivalent to checking it in at pickup location and confirming
1147
     ModReserveAffect( $item_1->itemnumber, $reserve1->borrowernumber, 0, $reserve1->reserve_id );
1148
     ($status, $matched_reserve, $possible_reserves) = CheckReserves($item_1->itemnumber);
1149
1150
     is( $status, 'Waiting', "We found a reserve" );
1151
     is( $matched_reserve->{reserve_id}, $reserve1->reserve_id, "We got the Waiting reserve");
1152
     is( scalar @$possible_reserves, 1, 'We only get the one matched');
1153
1144
};
1154
};
1145
1155
1146
sub count_hold_print_messages {
1156
sub count_hold_print_messages {
1147
- 

Return to bug 18958