Minor bug
[fa-stable.git] / gl / manage / exchange_rates.php
index 493509f9d7a339eb3da2c23638b11b05972984db..528b42030d6a74fde6a1c196f37c6e13a6cb22f9 100644 (file)
@@ -34,13 +34,7 @@ function check_data()
                set_focus('date_');
                return false;
        }
-       if (!check_num('BuyRate', 0))
-       {
-               display_error( _("The exchange rate must be numeric and greater than zero."));
-               set_focus('BuyRate');
-               return false;
-       }
-       if ($_POST['BuyRate'] <= 0)
+       if (input_num('BuyRate') <= 0)
        {
                display_error( _("The exchange rate cannot be zero or a negative number."));
                set_focus('BuyRate');
@@ -134,7 +128,8 @@ function display_rate_edit()
        }
        if (isset($_POST['get_rate']))
        {
-               $_POST['BuyRate'] = exrate_format(get_ecb_rate($_POST['curr_abrev']));
+               $_POST['BuyRate'] = 
+                       exrate_format(retrieve_exrate($_POST['curr_abrev'], $_POST['date_']));
                $Ajax->activate('BuyRate');
        }
        small_amount_row(_("Exchange Rate:"), 'BuyRate', null, '',
@@ -143,7 +138,7 @@ function display_rate_edit()
 
        end_table(1);
 
-       submit_add_or_update_center($selected_id == '', '', true);
+       submit_add_or_update_center($selected_id == '', '', 'both');
 
        display_note(_("Exchange rates are entered against the company currency."), 1);
 }
@@ -170,7 +165,7 @@ if ($Mode == 'Delete')
 
 //---------------------------------------------------------------------------------------------
 
-start_form(false, true);
+start_form();
 
 if (!isset($_POST['curr_abrev']))
        $_POST['curr_abrev'] = get_global_curr_code();