Rerun. Stuff forgotten.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 4 Feb 2010 11:41:57 +0000 (11:41 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 4 Feb 2010 11:41:57 +0000 (11:41 +0000)
CHANGELOG.txt
gl/includes/db/gl_db_account_types.inc
gl/manage/gl_account_classes.php
gl/manage/gl_account_types.php
gl/manage/gl_accounts.php

index 93efc65f3ac8eebbe45623249819dfd970a1edcc..201c16b04b5e4fceeb410a53c3e3320f98478ebb 100644 (file)
@@ -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
index 0ea366ecd7fd16a93dbc8594849648c8dcf14c4c..94d27fccffb0028e25c2149a56a6b3f9c2d02208 100644 (file)
@@ -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");
 }
index fc617c079813ddd8b46e774364b697d8aa72fd6e..1ec62b88431965f4ab37d643fbcac3af19dfb1cf 100644 (file)
@@ -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."));
index ef8207b1728afe9d969e19727afa7c8ec9d3c997..171bf83f6504758b982d7352774830538fc6b953 100644 (file)
@@ -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 = "";
        } 
index 7b1937fdbc1f7a79c3d62d9c98580a13e105cfdf..96ba6529d046f326cbb7f832b1fdd4be885a43d2 100644 (file)
@@ -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);