Marged fixes from ain trunk up to 2.2.11
[fa-stable.git] / gl / manage / bank_accounts.php
index 64a96f8f0f5245c36a141378ec3c7f57ff3a5c81..fa441ef09435628b56a9e24924f7540971b92e33 100644 (file)
@@ -66,13 +66,13 @@ elseif( $Mode == 'Delete')
        $acc = db_escape($selected_id);
        // PREVENT DELETES IF DEPENDENT RECORDS IN 'bank_trans'
 
-       if (bank_account_in_transactions($acc))
+       if (key_in_foreign_table($acc, 'bank_trans', 'bank_act', true))
        {
                $cancel_delete = 1;
                display_error(_("Cannot delete this bank account because transactions have been created using this account."));
        }
 
-       if (bank_account_in_sales_pos($acc))
+       if (key_in_foreign_table($acc, 'sales_pos', 'pos_account', true))
        {
                $cancel_delete = 1;
                display_error(_("Cannot delete this bank account because POS definitions have been created using this account."));
@@ -97,7 +97,7 @@ if ($Mode == 'RESET')
 $result = get_bank_accounts(check_value('show_inactive'));
 
 start_form();
-start_table("$table_style width='80%'");
+start_table(TABLESTYLE, "width='80%'");
 
 $th = array(_("Account Name"), _("Type"), _("Currency"), _("GL Account"), 
        _("Bank"), _("Number"), _("Bank Address"), _("Dflt"), '','');
@@ -133,7 +133,7 @@ end_table(1);
 
 $is_editing = $selected_id != -1; 
 
-start_table($table_style2);
+start_table(TABLESTYLE2);
 
 if ($is_editing) 
 {