From 02dd4aefa3e3babb64d61140bb7f7de14e37f755 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Thu, 4 Feb 2010 11:41:57 +0000 Subject: [PATCH] Rerun. Stuff forgotten. --- CHANGELOG.txt | 1 + gl/includes/db/gl_db_account_types.inc | 6 +++--- gl/manage/gl_account_classes.php | 4 ++-- gl/manage/gl_account_types.php | 8 ++++---- gl/manage/gl_accounts.php | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 93efc65f..201c16b0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -24,6 +24,7 @@ $ -> Affected files 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 diff --git a/gl/includes/db/gl_db_account_types.inc b/gl/includes/db/gl_db_account_types.inc index 0ea366ec..94d27fcc 100644 --- a/gl/includes/db/gl_db_account_types.inc +++ b/gl/includes/db/gl_db_account_types.inc @@ -12,7 +12,7 @@ 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); } @@ -57,7 +57,7 @@ function get_account_types($all=false) $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"); } @@ -108,7 +108,7 @@ function get_account_classes($all=false) { $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"); } diff --git a/gl/manage/gl_account_classes.php b/gl/manage/gl_account_classes.php index fc617c07..1ec62b88 100644 --- a/gl/manage/gl_account_classes.php +++ b/gl/manage/gl_account_classes.php @@ -25,12 +25,12 @@ simple_page_mode(true); 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.")); diff --git a/gl/manage/gl_account_types.php b/gl/manage/gl_account_types.php index ef8207b1..171bf83f 100644 --- a/gl/manage/gl_account_types.php +++ b/gl/manage/gl_account_types.php @@ -26,12 +26,12 @@ function can_process() { 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.")); @@ -120,7 +120,7 @@ $result = get_account_types(check_value('show_inactive')); 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); @@ -132,7 +132,7 @@ while ($myrow = db_fetch($result)) $bs_text = get_account_class_name($myrow["class_id"]); - if ($myrow["parent"] == ANY_NUMERIC) + if ($myrow["parent"] == '0' || $myrow["parent"] == '-1') { $parent_text = ""; } diff --git a/gl/manage/gl_accounts.php b/gl/manage/gl_accounts.php index 7b1937fd..96ba6529 100644 --- a/gl/manage/gl_accounts.php +++ b/gl/manage/gl_accounts.php @@ -234,10 +234,10 @@ else $_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); -- 2.30.2