Ui/DataProvider/Downline/Grid.php
private function getCalcId($dsBegin, $treeType)
    {
        $codeRegular = $codeForecast = '';
        if ($treeType == OptionTreeType::VAL_PLAIN) {
            $codeRegular = Cfg::CODE_TYPE_CALC_PV_WRITE_OFF;
            $codeForecast = Cfg::CODE_TYPE_CALC_FORECAST_PLAIN;
        } elseif ($treeType == OptionTreeType::VAL_COMPRESS) {
            $codeRegular = Cfg::CODE_TYPE_CALC_COMPRESS_PHASE1;
            $codeForecast = Cfg::CODE_TYPE_CALC_FORECAST_PHASE1;
        }
        $query = $this->qGetId->build();
        $conn = $query->getConnection();
        $bind = [
            QGetId::BND_DS_BEGIN => $dsBegin,
            QGetId::BND_TYPE_CODE_REGULAR => $codeRegular,
            QGetId::BND_TYPE_CODE_FORECAST => $codeForecast
        ];
        $result = $conn->fetchOne($query, $bind);
        return $result;
    }
private function getCalcId($dsBegin, $treeType)
    {
        $codeRegular = $codeForecast = '';
        if ($treeType == OptionTreeType::VAL_PLAIN) {
            $codeRegular = Cfg::CODE_TYPE_CALC_PV_WRITE_OFF;
            $codeForecast = Cfg::CODE_TYPE_CALC_FORECAST_PLAIN;
        } elseif ($treeType == OptionTreeType::VAL_COMPRESS) {
            $codeRegular = Cfg::CODE_TYPE_CALC_COMPRESS_PHASE1;
            $codeForecast = Cfg::CODE_TYPE_CALC_FORECAST_PHASE1;
        }
        $query = $this->qGetId->build();
        $conn = $query->getConnection();
        $bind = [
            QGetId::BND_DS_BEGIN => $dsBegin,
            QGetId::BND_TYPE_CODE_REGULAR => $codeRegular,
            QGetId::BND_TYPE_CODE_FORECAST => $codeForecast
        ];
        $result = $conn->fetchOne($query, $bind);
        return $result;
    }
Get calculation ID for given period & tree type.

@param string $dsBegin YYYYMMDD period's begin datestamp
@param string $treeType [compressed|plain]
@return int