X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Fmanage%2Fbank_accounts.php;h=ae1dc41e6f8cc7e924b4a1bc0ef88397afa17286;hb=df444f84379276fbc46eddca894ed3529120b2bb;hp=09f07b04b91121b9d1f1d9409ceca0f77c01316c;hpb=1b1cd2a1d25f90b1b19aaf5b0383e7afb63a3e41;p=fa-stable.git diff --git a/gl/manage/bank_accounts.php b/gl/manage/bank_accounts.php index 09f07b04..ae1dc41e 100644 --- a/gl/manage/bank_accounts.php +++ b/gl/manage/bank_accounts.php @@ -25,21 +25,9 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') //initialise no input errors assumed initially before we test $input_error = 0; - $curr = get_company_currency(); - $sql = "SELECT account_code FROM ".TB_PREF."bank_accounts - WHERE account_code = '".$_POST['account_code']."'"; - if ($curr == $_POST['BankAccountCurrency']) - $sql .= " AND bank_curr_code <> '".$_POST['BankAccountCurrency']."'"; - $sql .= " AND id <> $selected_id"; - $result = db_query($sql,"could not get bank accounts"); - if (db_num_rows($result) > 0) - { - $input_error = 1; - display_error(_("The GL account is already in use.")); - set_focus('account_code'); - } + //first off validate inputs sensible - if ($input_error == 0 && strlen($_POST['bank_account_name']) == 0) + if (strlen($_POST['bank_account_name']) == 0) { $input_error = 1; display_error(_("The bank account name cannot be empty.")); @@ -202,10 +190,9 @@ else yesno_list_row(_("Default currency account:"), 'dflt_curr_act'); -$curr = get_company_currency(); -if ($is_editing && $curr == $_POST['BankAccountCurrency']) +if($is_editing) label_row(_("Bank Account GL Code:"), $_POST['account_code']); -else +else gl_all_accounts_list_row(_("Bank Account GL Code:"), 'account_code', null); text_row(_("Bank Name:"), 'bank_name', null, 50, 60);