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

(-)a/C4/Reserves.pm (-5 / +10 lines)
Lines 163-169 BEGIN { Link Here
163
            itemnumber       => $itemnumber,
163
            itemnumber       => $itemnumber,
164
            found            => $found,
164
            found            => $found,
165
            itemtype         => $itemtype,
165
            itemtype         => $itemtype,
166
            item_gorup_id    => $item_group_id
166
            item_group_id    => $item_group_id
167
        }
167
        }
168
    );
168
    );
169
169
Lines 961-966 sub CheckReserves { Link Here
961
                # See if this item is more important than what we've got so far
961
                # See if this item is more important than what we've got so far
962
                if ( ( $res->{'priority'} && $res->{'priority'} < $priority ) || $local_hold_match ) {
962
                if ( ( $res->{'priority'} && $res->{'priority'} < $priority ) || $local_hold_match ) {
963
                    $item ||= Koha::Items->find($itemnumber);
963
                    $item ||= Koha::Items->find($itemnumber);
964
                    next if $res->{item_group_id} && ( !$item->item_group || $item->item_group->id != $res->{item_group_id} );
964
                    next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype;
965
                    next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype;
965
                    $patron ||= Koha::Patrons->find( $res->{borrowernumber} );
966
                    $patron ||= Koha::Patrons->find( $res->{borrowernumber} );
966
                    my $branch = GetReservesControlBranch( $item->unblessed, $patron->unblessed );
967
                    my $branch = GetReservesControlBranch( $item->unblessed, $patron->unblessed );
Lines 1756-1762 sub _Findgroupreserve { Link Here
1756
               reserves.itemnumber          AS itemnumber,
1757
               reserves.itemnumber          AS itemnumber,
1757
               reserves.reserve_id          AS reserve_id,
1758
               reserves.reserve_id          AS reserve_id,
1758
               reserves.itemtype            AS itemtype,
1759
               reserves.itemtype            AS itemtype,
1759
               reserves.non_priority        AS non_priority
1760
               reserves.non_priority        AS non_priority,
1761
               reserves.item_group_id           AS item_group_id
1760
        FROM reserves
1762
        FROM reserves
1761
        JOIN biblioitems USING (biblionumber)
1763
        JOIN biblioitems USING (biblionumber)
1762
        JOIN hold_fill_targets USING (reserve_id)
1764
        JOIN hold_fill_targets USING (reserve_id)
Lines 1792-1807 sub _Findgroupreserve { Link Here
1792
               reserves.itemnumber          AS itemnumber,
1794
               reserves.itemnumber          AS itemnumber,
1793
               reserves.reserve_id          AS reserve_id,
1795
               reserves.reserve_id          AS reserve_id,
1794
               reserves.itemtype            AS itemtype,
1796
               reserves.itemtype            AS itemtype,
1795
               reserves.non_priority        AS non_priority
1797
               reserves.non_priority        AS non_priority,
1798
               reserves.item_group_id           AS item_group_id
1796
        FROM reserves
1799
        FROM reserves
1797
        JOIN biblioitems USING (biblionumber)
1800
        JOIN biblioitems USING (biblionumber)
1798
        JOIN hold_fill_targets USING (reserve_id)
1801
        JOIN hold_fill_targets USING (reserve_id)
1802
        LEFT JOIN item_group_items ON ( item_group_items.item_id = hold_fill_targets.itemnumber )
1799
        WHERE found IS NULL
1803
        WHERE found IS NULL
1800
        AND priority > 0
1804
        AND priority > 0
1801
        AND item_level_request = 0
1805
        AND item_level_request = 0
1802
        AND hold_fill_targets.itemnumber = ?
1806
        AND hold_fill_targets.itemnumber = ?
1803
        AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY)
1807
        AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY)
1804
        AND suspend = 0
1808
        AND suspend = 0
1809
        AND reserves.item_group_id = item_group_items.item_group_id
1805
        ORDER BY priority
1810
        ORDER BY priority
1806
    };
1811
    };
1807
    $sth = $dbh->prepare($title_level_target_query);
1812
    $sth = $dbh->prepare($title_level_target_query);
Lines 1827-1833 sub _Findgroupreserve { Link Here
1827
               reserves.itemnumber                 AS itemnumber,
1832
               reserves.itemnumber                 AS itemnumber,
1828
               reserves.reserve_id                 AS reserve_id,
1833
               reserves.reserve_id                 AS reserve_id,
1829
               reserves.itemtype                   AS itemtype,
1834
               reserves.itemtype                   AS itemtype,
1830
               reserves.non_priority        AS non_priority
1835
               reserves.non_priority               AS non_priority,
1836
               reserves.item_group_id              AS item_group_id
1831
        FROM reserves
1837
        FROM reserves
1832
        WHERE reserves.biblionumber = ?
1838
        WHERE reserves.biblionumber = ?
1833
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
1839
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
1834
- 

Return to bug 24860