Rerun
[fa-stable.git] / gl / manage / exchange_rates.php
index a22b71526814cb7dbb101ec1d4eba07c1172df1e..55259ff8fa4a16ef43956c0022264f5b958f58c6 100644 (file)
@@ -40,7 +40,12 @@ function check_data()
                set_focus('BuyRate');
                return false;
        }
-
+       if (get_date_exchange_rate($_POST['curr_abrev'], $_POST['date_']))
+       {
+               display_error( _("The exchange rate for the date is already there."));
+               set_focus('date_');
+               return false;
+       }
        return true;
 }
 
@@ -67,6 +72,7 @@ function handle_submit()
        }
 
        $selected_id = '';
+       clear_data();
 }
 
 //---------------------------------------------------------------------------------------------
@@ -79,6 +85,7 @@ function handle_delete()
                return;
        delete_exchange_rate($selected_id);
        $selected_id = '';
+       clear_data();
 }
 
 //---------------------------------------------------------------------------------------------
@@ -208,6 +215,8 @@ else
 
        br(1);
        $table->width = "40%";
+       if ($table->rec_count == 0)
+               $table->ready = false;
        display_db_pager($table);
        br(1);
     display_rate_edit();