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

(-)a/C4/Reserves.pm (-13 / +7 lines)
Lines 737-747 sub CheckReserves { Link Here
737
    }
737
    }
738
    # note: we get the itemnumber because we might have started w/ just the barcode.  Now we know for sure we have it.
738
    # note: we get the itemnumber because we might have started w/ just the barcode.  Now we know for sure we have it.
739
    my ( $biblio, $bibitem, $notforloan_per_itemtype, $notforloan_per_item, $itemnumber, $damaged, $item_homebranch, $item_holdingbranch ) = $sth->fetchrow_array;
739
    my ( $biblio, $bibitem, $notforloan_per_itemtype, $notforloan_per_item, $itemnumber, $damaged, $item_homebranch, $item_holdingbranch ) = $sth->fetchrow_array;
740
741
    return if ( $damaged && !C4::Context->preference('AllowHoldsOnDamagedItems') );
740
    return if ( $damaged && !C4::Context->preference('AllowHoldsOnDamagedItems') );
742
741
743
    return unless $itemnumber; # bail if we got nothing.
742
    return unless $itemnumber; # bail if we got nothing.
744
745
    # if item is not for loan it cannot be reserved either.....
743
    # if item is not for loan it cannot be reserved either.....
746
    # except where items.notforloan < 0 :  This indicates the item is holdable.
744
    # except where items.notforloan < 0 :  This indicates the item is holdable.
747
    return if  ( $notforloan_per_item > 0 ) or $notforloan_per_itemtype;
745
    return if  ( $notforloan_per_item > 0 ) or $notforloan_per_itemtype;
Lines 979-985 sub ModReserveFill { Link Here
979
    my $reserve_id = $res->{'reserve_id'};
977
    my $reserve_id = $res->{'reserve_id'};
980
978
981
    my $hold = Koha::Holds->find($reserve_id);
979
    my $hold = Koha::Holds->find($reserve_id);
982
983
    # get the priority on this record....
980
    # get the priority on this record....
984
    my $priority = $hold->priority;
981
    my $priority = $hold->priority;
985
982
Lines 1795-1812 sub MoveReserve { Link Here
1795
        # The item is reserved by someone else.
1792
        # The item is reserved by someone else.
1796
        # Find this item in the reserves
1793
        # Find this item in the reserves
1797
1794
1798
        my $borr_res;
1795
        my $borr_res  = Koha::Holds->search({
1799
        foreach (@$all_reserves) {
1796
            borrowernumber => $borrowernumber,
1800
            $_->{'borrowernumber'} == $borrowernumber or next;
1797
            biblionumber   => $biblionumber,
1801
            $_->{'biblionumber'}   == $biblionumber   or next;
1798
        },{
1802
1799
            order_by       => 'priority'
1803
            $borr_res = $_;
1800
        })->next();
1804
            last;
1805
        }
1806
1801
1807
        if ( $borr_res ) {
1802
        if ( $borr_res ) {
1808
            # The item is reserved by the current patron
1803
            # The item is reserved by the current patron
1809
            ModReserveFill($borr_res);
1804
            ModReserveFill($borr_res->unblessed);
1810
        }
1805
        }
1811
1806
1812
        if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1
1807
        if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1
1813
- 

Return to bug 14549