|
From: Pierre-Alexandre L. <sql...@th...> - 2001-12-18 21:42:18
|
I modified the list_accounts method to sort the records from the chart
table "lexically" on the accno instead of numerically.
In Belgium, we have accno that are hierarchical eg
710 AAA (heading)
-- 710000 AAA.BBBB (account)
-- 710100 AAA.CCCC (account)
and 710 is not the same as 710000
But when sorted numerically all headers are returned first since they
have the lowest accno value. So I resorted the hash before printing it
using (in [form]/cp.pl)
# sort $form->{CA}
my @sorted_ca = sort { $a->{accno} cmp $b->{accno} } @{$form->{CA}};
# loop around
foreach $ca (@sorted_ca) {
...
}
This change still works for fixed length or zero padded account numbers
of course so I thought it might be of interest.
Since I don't know (yet) all the other places where this type of list or
query is made I thought I would drop this on the mailing list and call
for comments :-)
Pierre
|