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

(-)a/C4/Reserves.pm (-2 / +15 lines)
Lines 300-305 sub CanItemBeReserved { Link Here
300
    my $ruleitemtype;    # itemtype of the matching issuing rule
300
    my $ruleitemtype;    # itemtype of the matching issuing rule
301
    my $allowedreserves  = 0; # Total number of holds allowed across all records
301
    my $allowedreserves  = 0; # Total number of holds allowed across all records
302
    my $holds_per_record = 1; # Total number of holds allowed for this one given record
302
    my $holds_per_record = 1; # Total number of holds allowed for this one given record
303
    my $holds_per_day    = 0; # Total number of holds allowed per day for the given patron
303
304
304
    # we retrieve borrowers and items informations #
305
    # we retrieve borrowers and items informations #
305
    # item->{itype} will come for biblioitems if necessery
306
    # item->{itype} will come for biblioitems if necessery
Lines 350-355 sub CanItemBeReserved { Link Here
350
        $ruleitemtype     = $rights->{itemtype};
351
        $ruleitemtype     = $rights->{itemtype};
351
        $allowedreserves  = $rights->{reservesallowed};
352
        $allowedreserves  = $rights->{reservesallowed};
352
        $holds_per_record = $rights->{holds_per_record};
353
        $holds_per_record = $rights->{holds_per_record};
354
        $holds_per_day    = $rights->{holds_per_day};
353
    }
355
    }
354
    else {
356
    else {
355
        $ruleitemtype = '*';
357
        $ruleitemtype = '*';
Lines 367-372 sub CanItemBeReserved { Link Here
367
        return "tooManyHoldsForThisRecord";
369
        return "tooManyHoldsForThisRecord";
368
    }
370
    }
369
371
372
    my $today_holds = Koha::Holds->search({
373
        borrowernumber => $borrowernumber,
374
        reservedate    => dt_from_string->date
375
    });
376
377
    if ( defined $holds_per_day &&
378
          (   ( $holds_per_day > 0 && $today_holds->count() >= $holds_per_day )
379
           or ( $holds_per_day == 0 ) )
380
        )  {
381
        return "tooManyReservesToday";
382
    }
383
370
    # we retrieve count
384
    # we retrieve count
371
385
372
    $querycount .= "AND $branchfield = ?";
386
    $querycount .= "AND $branchfield = ?";
Lines 2068-2074 sub GetHoldRule { Link Here
2068
2082
2069
    my $sth = $dbh->prepare(
2083
    my $sth = $dbh->prepare(
2070
        q{
2084
        q{
2071
         SELECT categorycode, itemtype, branchcode, reservesallowed, holds_per_record
2085
         SELECT categorycode, itemtype, branchcode, reservesallowed, holds_per_record, holds_per_day
2072
           FROM issuingrules
2086
           FROM issuingrules
2073
          WHERE (categorycode in (?,'*') )
2087
          WHERE (categorycode in (?,'*') )
2074
            AND (itemtype IN (?,'*'))
2088
            AND (itemtype IN (?,'*'))
2075
- 

Return to bug 15486