if ($Mode=='ADD_ITEM' && (gl_account_in_bank_accounts(get_post('account_code'))
|| key_in_foreign_table(get_post('account_code'), 'gl_trans', 'account'))) {
$input_error = 1;
- display_error(_("The GL account selected is already in use. Select another GL account."));
+ display_error(_("The GL account selected is already in use or has transactions. Select another empty GL account."));
set_focus('account_code');
}
if ($input_error != 1)
$_POST['bank_charge_act'] = $myrow["bank_charge_act"];
}
hidden('selected_id', $selected_id);
- hidden('account_code');
- hidden('account_type');
- hidden('BankAccountCurrency', $_POST['BankAccountCurrency']);
set_focus('bank_account_name');
}
if ($is_used)
{
label_row(_("Account Type:"), $bank_account_types[$_POST['account_type']]);
+ hidden('account_type');
}
else
{
if ($is_used)
{
label_row(_("Bank Account Currency:"), $_POST['BankAccountCurrency']);
+ hidden('BankAccountCurrency', $_POST['BankAccountCurrency']);
}
else
{
yesno_list_row(_("Default currency account:"), 'dflt_curr_act');
if($is_used)
+{
label_row(_("Bank Account GL Code:"), $_POST['account_code']);
-else
+ hidden('account_code');
+} else
gl_all_accounts_list_row(_("Bank Account GL Code:"), 'account_code', null);
gl_all_accounts_list_row(_("Bank Charges Account:"), 'bank_charge_act', null, true);
end_form();
end_page();
-?>