Topic: Account & Account Type Ordering
I prefer to see accounts and account types ordered by ID, and not by type.
I've made the following modifications:
--- gl/includes/db/gl_db_account_types.inc.ORIGINAL 2010-12-10 14:12:42.000000000 +0100
+++ gl/includes/db/gl_db_account_types.inc 2010-12-14 12:04:16.000000000 +0100
@@ -71,7 +71,7 @@ function get_account_types($all=false, $
if (count($where))
$sql .= ' WHERE '.implode(' AND ', $where);
- $sql .= " ORDER BY class_id, id, parent";
+ $sql .= " ORDER BY id, parent";
return db_query($sql, "could not get account types");
}
@@ -128,7 +128,7 @@ function get_account_classes($all=false,
$sql .= " AND ctype>".CL_EQUITY." OR ctype=0";
elseif ($balance == 1)
$sql .= " AND ctype>0 AND ctype<".CL_INCOME;
- $sql .= " ORDER BY ctype, cid";
+ $sql .= " ORDER BY cid";
return db_query($sql, "could not get account classes");
}
--- includes/ui/ui_lists.inc.ORIGINAL 2010-12-10 14:12:42.000000000 +0100
+++ includes/ui/ui_lists.inc 2010-12-17 15:45:28.000000000 +0100
@@ -1547,7 +1547,7 @@ function gl_account_types_list($name, $s
return combo_input($name, $selected_id, $sql, 'id', 'name',
array(
'format' => '_format_account',
- 'order' => array('class_id', 'id', 'parent'),
+ 'order' => array('id', 'parent'),
'spec_option' =>$all_option,
'spec_id' => $all_items
) );
@@ -1592,7 +1592,7 @@ function gl_all_accounts_list($name, $se
'spec_option' => $all_option===true ? _("Use Item Sales Accounts") : $all_option,
'spec_id' => '',
'type' => 2,
- 'order' => array('type.class_id','type.id','account_code'),
+ 'order' => array('type.id','account_code'),
'search_box' => $cells,
'search_submit' => false,
'size' => 12,
@@ -1608,7 +1608,13 @@ function gl_all_accounts_list($name, $se
function _format_account($row)
{
- return $row[0] . " " . $row[1];
+ $return = $row[0];
+ $rlen = strlen($return);
+ if ($rlen > 6) $rlen = 6;
+ for ($i = $rlen; $i < 9; $i++) {
+ $return .= " ";
+ }
+ return $return . $row[1];
}
function gl_all_accounts_list_cells($label, $name, $selected_id=null,
Maybe it would be good to have a setting (option) about that - to display them ordered by type, or by ID (maybe even by name as well)?