function get_company_currency()
{
- $sql= "SELECT curr_default FROM ".TB_PREF."company";
- $result = db_query($sql, "retreive company currency");
-
- if (db_num_rows($result) == 0)
- display_db_error("Could not find the requested currency. Fatal.", $sql);
-
- $myrow = db_fetch_row($result);
- return $myrow[0];
+ return get_company_pref('curr_default');
}
//----------------------------------------------------------------------------------
function get_exchange_rate_from_home_currency($currency_code, $date_)
{
- if ($currency_code == get_company_currency())
+ if ($currency_code == get_company_currency() || $currency_code == null)
return 1.0000;
$date = date2sql($date_);