Cached company currency retrieval.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 23 Jan 2010 18:21:25 +0000 (18:21 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 23 Jan 2010 18:21:25 +0000 (18:21 +0000)
includes/banking.inc

index 301a37299426edc85eba5b78edc634a9ec780068..6a0dee8342e2f0a68b439e53115c40bf588cdcd4 100644 (file)
@@ -41,14 +41,7 @@ function is_company_currency($currency)
 
 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');
 }
 
 //----------------------------------------------------------------------------------