function can_process()
{
global $use_oldstyle_convert;
- if (!is_numeric($_POST['id']))
+ /*if (!is_numeric($_POST['id']))
{
display_error( _("The account class ID must be numeric."));
set_focus('id');
return false;
- }
+ }*/
if (strlen($_POST['name']) == 0)
{
display_error( _("The account class name cannot be empty."));
{
if ($selected_id == -1)
return false;
- if (account_class_in_account_types($selected_id))
+ if (key_in_foreign_table($selected_id, 'chart_types', 'class_id'))
{
display_error(_("Cannot delete this account class because GL account types have been created referring to it."));
return false;
if ($selected_id != -1)
{
- if ($Mode == 'Edit') {
- //editing an existing status code
- $myrow = get_account_class($selected_id);
-
- $_POST['id'] = $myrow["cid"];
- $_POST['name'] = $myrow["class_name"];
- if (isset($use_oldstyle_convert) && $use_oldstyle_convert == 1)
- $_POST['ctype'] = ($myrow["ctype"] >= CL_ASSETS && $myrow["ctype"] < CL_INCOME ? 1 : 0);
- else
- $_POST['ctype'] = $myrow["ctype"];
- hidden('selected_id', $selected_id);
- }
+ if ($Mode == 'Edit') {
+ //editing an existing status code
+ $myrow = get_account_class($selected_id);
+
+ $_POST['id'] = $myrow["cid"];
+ $_POST['name'] = $myrow["class_name"];
+ if (isset($use_oldstyle_convert) && $use_oldstyle_convert == 1)
+ $_POST['ctype'] = ($myrow["ctype"] >= CL_ASSETS && $myrow["ctype"] < CL_INCOME ? 1 : 0);
+ else
+ $_POST['ctype'] = $myrow["ctype"];
+ hidden('selected_id', $selected_id);
+ }
hidden('id');
label_row(_("Class ID:"), $_POST['id']);