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

(-)a/circ/reserveratios.pl (-2 / +2 lines)
Lines 22-27 use Modern::Perl; Link Here
22
22
23
use CGI qw ( -utf8 );
23
use CGI qw ( -utf8 );
24
use Date::Calc qw/Today Add_Delta_YM/;
24
use Date::Calc qw/Today Add_Delta_YM/;
25
use POSIX qw( ceil );
25
26
26
use C4::Context;
27
use C4::Context;
27
use C4::Output;
28
use C4::Output;
Lines 154-160 $sth->execute(@query_params); Link Here
154
my @reservedata;
155
my @reservedata;
155
while ( my $data = $sth->fetchrow_hashref ) {
156
while ( my $data = $sth->fetchrow_hashref ) {
156
    my $thisratio = $data->{reservecount} / $data->{itemcount};
157
    my $thisratio = $data->{reservecount} / $data->{itemcount};
157
    my $ratiocalc = $data->{reservecount}/$ratio - $data->{itemcount};
158
    my $ratiocalc = ceil($data->{reservecount}/$ratio - $data->{itemcount});
158
    $ratiocalc >= 1 or next;  # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause
159
    $ratiocalc >= 1 or next;  # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause
159
    push(
160
    push(
160
        @reservedata,
161
        @reservedata,
161
- 

Return to bug 15422