Service/Calc/Bonus/Team/CalcDef.php
private function getLevelPercent($value, $levels)
    {
        $result = 0;
        foreach ($levels as $level => $percent) {
            if ($value < $level) {
                break;
            }
            $result = $percent;
        }
        return $result;
    }
private function getLevelPercent($value, $levels)
    {
        $result = 0;
        foreach ($levels as $level => $percent) {
            if ($value < $level) {
                break;
            }
            $result = $percent;
        }
        return $result;
    }
private function getLevelPercent ( $ value , $ levels ) { $ result = 0 ; foreach ( $ levels as $ level => $ percent ) { if ( $ value < $ level ) { break ; } $ result = $ percent ; } return $ result ; }
Get percent for the first level that is greater then given $value.

@param int $value PV/TV/... value to get level's percent
@param array $levels asc ordered array with levels & percents ([$level => $percent])

@return number
Get percent for the first level that is greater then given $value .