and class id varchar(3). Ability to change account groups online.
$ /gl/manage/gl_account_classes.php
/gl/manage/gl_account_types.php
+ /gl/manage/gl_accounts.php
/gl/includes/db/gl_db_account_types.inc
/sql/alter2.3.sql
/sql/en_US-demo.sql
function add_account_type($id, $name, $class_id, $parent)
{
$sql = "INSERT INTO ".TB_PREF."chart_types (id, name, class_id, parent)
- VALUES ($id, ".db_escape($name).", ".db_escape($class_id).", ".db_escape($parent).")";
+ VALUES (".db_escape($id).", ".db_escape($name).", ".db_escape($class_id).", ".db_escape($parent).")";
return db_query($sql);
}
$sql = "SELECT * FROM ".TB_PREF."chart_types";
if (!$all) $sql .= " WHERE !inactive";
- $sql .= " ORDER BY class_id, id";
+ $sql .= " ORDER BY class_id, id, parent";
return db_query($sql, "could not get account types");
}
{
$sql = "SELECT * FROM ".TB_PREF."chart_class";
if (!$all) $sql .= " WHERE !inactive";
- $sql .= " ORDER BY cid";
+ $sql .= " ORDER BY ctype, cid";
return db_query($sql, "could not get account types");
}
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."));
{
global $selected_id;
- if (!input_num('id'))
+ /*if (!input_num('id'))
{
display_error( _("The account id must be an integer and cannot be empty."));
set_focus('id');
return false;
- }
+ }*/
if (strlen($_POST['name']) == 0)
{
display_error( _("The account group name cannot be empty."));
start_form();
start_table($table_style);
-$th = array(_("ID"), _("Name"), _("Subgroup Of"), _("Class Type"), "", "");
+$th = array(_("Group ID"), _("Group Name"), _("Subgroup Of"), _("Class Type"), "", "");
inactive_control_column($th);
table_header($th);
$bs_text = get_account_class_name($myrow["class_id"]);
- if ($myrow["parent"] == ANY_NUMERIC)
+ if ($myrow["parent"] == '0' || $myrow["parent"] == '-1')
{
$parent_text = "";
}
$_POST['account_name'] = $_POST['account_type'] = '';
$_POST['inactive'] = 0;
}
- text_row_ex(_("Account Code:"), 'account_code', 11);
+ text_row_ex(_("Account Code:"), 'account_code', 15);
}
-text_row_ex(_("Account Code 2:"), 'account_code2', 11);
+text_row_ex(_("Account Code 2:"), 'account_code2', 15);
text_row_ex(_("Account Name:"), 'account_name', 60);