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 963-968 sub CheckReserves { Link Here
963
                # See if this item is more important than what we've got so far
963
                # See if this item is more important than what we've got so far
964
                if ( ( $res->{'priority'} && $res->{'priority'} < $priority ) || $local_hold_match ) {
964
                if ( ( $res->{'priority'} && $res->{'priority'} < $priority ) || $local_hold_match ) {
965
                    $item ||= Koha::Items->find($itemnumber);
965
                    $item ||= Koha::Items->find($itemnumber);
966
                    next if $res->{item_group_id} && ( !$item->item_group || $item->item_group->id != $res->{item_group_id} );
966
                    next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype;
967
                    next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype;
967
                    $patron ||= Koha::Patrons->find( $res->{borrowernumber} );
968
                    $patron ||= Koha::Patrons->find( $res->{borrowernumber} );
968
                    my $branch = GetReservesControlBranch( $item->unblessed, $patron->unblessed );
969
                    my $branch = GetReservesControlBranch( $item->unblessed, $patron->unblessed );
Lines 1758-1764 sub _Findgroupreserve { Link Here
1758
               reserves.itemnumber          AS itemnumber,
1759
               reserves.itemnumber          AS itemnumber,
1759
               reserves.reserve_id          AS reserve_id,
1760
               reserves.reserve_id          AS reserve_id,
1760
               reserves.itemtype            AS itemtype,
1761
               reserves.itemtype            AS itemtype,
1761
               reserves.non_priority        AS non_priority
1762
               reserves.non_priority        AS non_priority,
1763
               reserves.item_group_id           AS item_group_id
1762
        FROM reserves
1764
        FROM reserves
1763
        JOIN biblioitems USING (biblionumber)
1765
        JOIN biblioitems USING (biblionumber)
1764
        JOIN hold_fill_targets USING (reserve_id)
1766
        JOIN hold_fill_targets USING (reserve_id)
Lines 1794-1809 sub _Findgroupreserve { Link Here
1794
               reserves.itemnumber          AS itemnumber,
1796
               reserves.itemnumber          AS itemnumber,
1795
               reserves.reserve_id          AS reserve_id,
1797
               reserves.reserve_id          AS reserve_id,
1796
               reserves.itemtype            AS itemtype,
1798
               reserves.itemtype            AS itemtype,
1797
               reserves.non_priority        AS non_priority
1799
               reserves.non_priority        AS non_priority,
1800
               reserves.item_group_id           AS item_group_id
1798
        FROM reserves
1801
        FROM reserves
1799
        JOIN biblioitems USING (biblionumber)
1802
        JOIN biblioitems USING (biblionumber)
1800
        JOIN hold_fill_targets USING (reserve_id)
1803
        JOIN hold_fill_targets USING (reserve_id)
1804
        LEFT JOIN item_group_items ON ( item_group_items.item_id = hold_fill_targets.itemnumber )
1801
        WHERE found IS NULL
1805
        WHERE found IS NULL
1802
        AND priority > 0
1806
        AND priority > 0
1803
        AND item_level_request = 0
1807
        AND item_level_request = 0
1804
        AND hold_fill_targets.itemnumber = ?
1808
        AND hold_fill_targets.itemnumber = ?
1805
        AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY)
1809
        AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY)
1806
        AND suspend = 0
1810
        AND suspend = 0
1811
        AND reserves.item_group_id = item_group_items.item_group_id
1807
        ORDER BY priority
1812
        ORDER BY priority
1808
    };
1813
    };
1809
    $sth = $dbh->prepare($title_level_target_query);
1814
    $sth = $dbh->prepare($title_level_target_query);
Lines 1829-1835 sub _Findgroupreserve { Link Here
1829
               reserves.itemnumber                 AS itemnumber,
1834
               reserves.itemnumber                 AS itemnumber,
1830
               reserves.reserve_id                 AS reserve_id,
1835
               reserves.reserve_id                 AS reserve_id,
1831
               reserves.itemtype                   AS itemtype,
1836
               reserves.itemtype                   AS itemtype,
1832
               reserves.non_priority        AS non_priority
1837
               reserves.non_priority               AS non_priority,
1838
               reserves.item_group_id              AS item_group_id
1833
        FROM reserves
1839
        FROM reserves
1834
        WHERE reserves.biblionumber = ?
1840
        WHERE reserves.biblionumber = ?
1835
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
1841
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
1836
- 

Return to bug 24860