From b4708f467e849d3b0a94bf67bc44331d0aa6827b Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Fri, 11 Dec 2015 11:42:44 +0100 Subject: [PATCH] Exchange Rates: removed sparse home currency from selector. --- gl/manage/exchange_rates.php | 2 +- includes/ui/ui_lists.inc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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 ) ); } -- 2.30.2