|
Lines 157-163
$sth->execute(@query_params);
Link Here
|
| 157 |
my @reservedata; |
157 |
my @reservedata; |
| 158 |
while ( my $data = $sth->fetchrow_hashref ) { |
158 |
while ( my $data = $sth->fetchrow_hashref ) { |
| 159 |
my $thisratio = $data->{reservecount} / $data->{itemcount}; |
159 |
my $thisratio = $data->{reservecount} / $data->{itemcount}; |
| 160 |
my $ratiocalc = $data->{reservecount}/$ratio - $data->{itemcount}; |
160 |
my $ratiocalc = ceil($data->{reservecount}/$ratio - $data->{itemcount}); |
| 161 |
$ratiocalc >= 0 or next; # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause |
161 |
$ratiocalc >= 0 or next; # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause |
| 162 |
push( |
162 |
push( |
| 163 |
@reservedata, |
163 |
@reservedata, |
| 164 |
- |
|
|