Exchange Rates: removed sparse home currency from selector.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 11 Dec 2015 10:42:44 +0000 (11:42 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 11 Dec 2015 11:59:56 +0000 (12:59 +0100)
gl/manage/exchange_rates.php
includes/ui/ui_lists.inc

index 05953c04bd452d77714077edc71d386fe1b7cc18..6d13b06bf90f3bd77b712eed49eaff45115ea39f 100644 (file)
@@ -178,7 +178,7 @@ if (!isset($_POST['curr_abrev']))
 
 echo "<center>";
 echo _("Select a currency :") . "  ";
-echo currencies_list('curr_abrev', null, true);
+echo currencies_list('curr_abrev', null, true, true);
 echo "</center>";
 
 // if currency sel has changed, clear the form
index a82e9d3a64f4fdc4f497b0437d8f0ca8d415ff04..0d3b1ecf84e8f4e7089b2132e8b73b7f242012cf 100644 (file)
@@ -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
                ) );
 }