Improved error handling.
[fa-stable.git] / gl / manage / currencies.php
index 856bc2b2f57b377c55ad64861506a0446db51342..b14b79fde4c4e7a4114a73e008a51b93fd107812 100644 (file)
@@ -101,7 +101,7 @@ function check_can_delete()
                return false;
        }
 
-       if (key_in_foreign_table($curr, 'company', 'curr_default', true))               
+       if ($curr == get_company_pref('curr_default'))
        {
                display_error(_("Cannot delete this currency, because the company preferences uses this currency."));
                return false;
@@ -134,12 +134,10 @@ function handle_delete()
 
 function display_currencies()
 {
-       global $table_style;
-
        $company_currency = get_company_currency();
        
     $result = get_currencies(check_value('show_inactive'));
-    start_table($table_style);
+    start_table(TABLESTYLE);
     $th = array(_("Abbreviation"), _("Symbol"), _("Currency Name"),
        _("Hundredths name"), _("Country"), _("Auto update"), "", "");
        inactive_control_column($th);
@@ -183,9 +181,9 @@ function display_currencies()
 
 function display_currency_edit($selected_id)
 {
-       global $table_style2, $Mode;
+       global $Mode;
        
-       start_table($table_style2);
+       start_table(TABLESTYLE2);
 
        if ($selected_id != '') 
        {