components/FcrnRate.php
public function getSysCcmpBaseCurrency($date){
        if(!preg_match('#\A\d\d\d\d#',$date,$match)){
            throw new CHttpException(400, 'invalid date in getSysCcmpBaseCurrency(): ' . $date);
        }
        $year = (int)$match[0];
        foreach($this->_base_currencies as $bc){
            if($bc['fcbc_year_from'] <= $year 
                    && (empty($bc['fcbc_year_to']) || $bc['fcbc_year_to'] >= $year) ){
                return $bc['fcbc_fcrn_id'];
            }
        }
        
        throw new CHttpException(400, 'Please define for ' . $date . ' base currency! SysCcmpId = ' . Yii::app()->sysCompany->getActiveCompany());
    }
public function getSysCcmpBaseCurrency($date){
        if(!preg_match('#\A\d\d\d\d#',$date,$match)){
            throw new CHttpException(400, 'invalid date in getSysCcmpBaseCurrency(): ' . $date);
        }
        $year = (int)$match[0];
        foreach($this->_base_currencies as $bc){
            if($bc['fcbc_year_from'] <= $year 
                    && (empty($bc['fcbc_year_to']) || $bc['fcbc_year_to'] >= $year) ){
                return $bc['fcbc_fcrn_id'];
            }
        }
        
        throw new CHttpException(400, 'Please define for ' . $date . ' base currency! SysCcmpId = ' . Yii::app()->sysCompany->getActiveCompany());
    }
public function getSysCcmpBaseCurrency ( $ date ) { if ( ! preg_match ( '#\A\d\d\d\d#' , $ date , $ match ) ) { throw new CHttpException ( 400 , 'invalid date in getSysCcmpBaseCurrency(): ' . $ date ) ; } $ year = ( int ) $ match [ 0 ] ; foreach ( $ this -> _base_currencies as $ bc ) { if ( $ bc [ 'fcbc_year_from' ] <= $ year && ( empty ( $ bc [ 'fcbc_year_to' ] ) || $ bc [ 'fcbc_year_to' ] >= $ year ) ) { return $ bc [ 'fcbc_fcrn_id' ] ; } } throw new CHttpException ( 400 , 'Please define for ' . $ date . ' base currency! SysCcmpId = ' . Yii :: app ( ) -> sysCompany -> getActiveCompany ( ) ) ; }
Look for base currency on date
@param char $date YYYY.....
@return int
@throws CHttpException
Look for base currency on date