- $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];
-}
-
-//----------------------------------------------------------------------------------
-
-function get_bank_account_currency($id)
-{
- $sql= "SELECT bank_curr_code FROM ".TB_PREF."bank_accounts WHERE id='$id'";
- $result = db_query($sql, "retreive bank account currency");
-
- $myrow = db_fetch_row($result);
- return $myrow[0];
-}
-
-//----------------------------------------------------------------------------------
-
-function get_customer_currency($customer_id)
-{
- $sql = "SELECT curr_code FROM ".TB_PREF."debtors_master WHERE debtor_no = '$customer_id'";
-
- $result = db_query($sql, "Retreive currency of customer $customer_id");
-
- $myrow=db_fetch_row($result);
- return $myrow[0];
-}
-
-//----------------------------------------------------------------------------------
-
-function get_supplier_currency($supplier_id)
-{
- $sql = "SELECT curr_code FROM ".TB_PREF."suppliers WHERE supplier_id = '$supplier_id'";
-
- $result = db_query($sql, "Retreive currency of supplier $supplier_id");
-
- $myrow=db_fetch_row($result);
- return $myrow[0];