Topic: Changing sorting of Accounts list

Hi guys,

  Sorry if this isn't the right forum for this question - I wasn't sure where else to put it.

  Is it possible to modify the sorting of the accounts list (such as on the "Chart of Accounts" page, "Journal Entry" page, and so on) to be by Account Group ID instead of Account Group name?

  If not, could that be added as a configuration option?  Our accountants set up the Account Groups in such a way as to group things logically by ID rather than name, so that would be a big boost in productivity.

  I could probably add this tweak myself if you could point me in the right direction.

  Thanks very much for such a great product!

~Tom

Re: Changing sorting of Accounts list

Unfortunately this is not possible at present. I know of people who has put the id in front of the name to solve it.

/Joe

Re: Changing sorting of Accounts list

Hi Joe,

  Okay, that's a possible workaround.

  It sounds like others have requested this feature.  So, if I offered to make it an option that people could select, would that be something you'd be interested in incorporating?  I don't think it would be hard; just a flag in the user's preferences or possibly in the company setup?  Then the code that generates the accounts list would just check the flag and call a SQL query that does a different sort.  (At least that seems right to me.)  What do you think?

~Tom

Re: Changing sorting of Accounts list

Hello,
Janusz has built our ui_lists and he is out of office at present. This will be a change in db structure, so we have to wait until 2.2 release.
I guess he can fix that for us.

/Joe

Re: Changing sorting of Accounts list

Hi Joe,

  Thanks for the thoughts.

  When Janusz returns, I'd love to have his insight.  If this is something I can help with, please let me know.  It would make our accounting folks very happy smile

~Tom

Re: Changing sorting of Accounts list

If you want to order account list by account group id apply following changes to gl_all_accounts_list() function code:

diff -r1.23 ui_lists.inc
1498c1498
<         $sql = "SELECT chart.account_code, chart.account_name, type.name
---
>         $sql = "SELECT chart.account_code, chart.account_name, type.name, type.id
1505c1505
<         $sql = "SELECT chart.account_code, chart.account_name, type.name
---
>         $sql = "SELECT chart.account_code, chart.account_name, type.name, type.id
1514c1514
<         'order' => array('name','account_code'),
---
>         'order' => array('type.id','account_code'),

That's all folks wink.
Janusz

Re: Changing sorting of Accounts list

Whoa!  Nice smile  Thanks!

Will you be able to get this set up as a preference in the 2.2 release?

Re: Changing sorting of Accounts list

I will consult this with Joe, why not.

Janusz

Re: Changing sorting of Accounts list

Thanks Janusz!  How exciting smile