components/FcrnRate.php
public function convertToBase($amt, $fcrn_id, $date,$round = 6) {
        $source = $this->getSysCcmpCurrencySource($date);
        $rate = $this->getCurrencyRate($fcrn_id, $date,$source);
        if ($rate === FALSE) {
            return FALSE;
        }
        
        /**
         * @todo add convert type to fcsr_courrency_source as definition
         */
        if ($source == 2){
            return round($rate * $amt, $round);
        }
        return round($amt/$rate, $round);

        
    }
public function convertToBase($amt, $fcrn_id, $date,$round = 6) {
        $source = $this->getSysCcmpCurrencySource($date);
        $rate = $this->getCurrencyRate($fcrn_id, $date,$source);
        if ($rate === FALSE) {
            return FALSE;
        }
        
        /**
         * @todo add convert type to fcsr_courrency_source as definition
         */
        if ($source == 2){
            return round($rate * $amt, $round);
        }
        return round($amt/$rate, $round);

        
    }
public function convertToBase ( $ amt , $ fcrn_id , $ date , $ round = 6 ) { $ source = $ this -> getSysCcmpCurrencySource ( $ date ) ; $ rate = $ this -> getCurrencyRate ( $ fcrn_id , $ date , $ source ) ; if ( $ rate === FALSE ) { return FALSE ; } /**
         * @todo add convert type to fcsr_courrency_source as definition
         */ if ( $ source == 2 ) { return round ( $ rate * $ amt , $ round ) ; } return round ( $ amt / $ rate , $ round ) ; }
convert to base currency
@param decimal $amt
@param int $fcrn_id
@param date $date
@return boolean/amt
convert to base currency