From: Janusz Dobrowolski Date: Fri, 11 Dec 2015 10:42:44 +0000 (+0100) Subject: Exchange Rates: removed sparse home currency from selector. X-Git-Tag: v2.4.2~19^2~98 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=b4708f467e849d3b0a94bf67bc44331d0aa6827b;p=fa-stable.git Exchange Rates: removed sparse home currency from selector. --- diff --git a/gl/manage/exchange_rates.php b/gl/manage/exchange_rates.php index 05953c04..6d13b06b 100644 --- a/gl/manage/exchange_rates.php +++ b/gl/manage/exchange_rates.php @@ -178,7 +178,7 @@ if (!isset($_POST['curr_abrev'])) echo "
"; echo _("Select a currency :") . " "; -echo currencies_list('curr_abrev', null, true); +echo currencies_list('curr_abrev', null, true, true); echo "
"; // if currency sel has changed, clear the form diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index a82e9d3a..0d3b1ecf 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -687,16 +687,18 @@ function locations_list_row($label, $name, $selected_id=null, $all_option=false, //----------------------------------------------------------------------------------------------- -function currencies_list($name, $selected_id=null, $submit_on_change=false) +function currencies_list($name, $selected_id=null, $submit_on_change=false, $exclude_home_curr=false) { $sql = "SELECT curr_abrev, currency, inactive FROM ".TB_PREF."currencies"; + if ($exclude_home_curr) + $sql .= " WHERE curr_abrev!='".get_company_currency()."'"; // default to the company currency return combo_input($name, $selected_id, $sql, 'curr_abrev', 'currency', array( 'select_submit'=> $submit_on_change, 'default' => get_company_currency(), - 'async' => false + 'async' => false ) ); }