Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-invoices
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-invoices
Commits
4538c9a8
Commit
4538c9a8
authored
Oct 02, 2023
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosine #5704: Sorting list of successors based on name
parent
c79c996d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
dependency-tree.tcl
lib/dependency-tree.tcl
+32
-0
No files found.
lib/dependency-tree.tcl
View file @
4538c9a8
...
...
@@ -26,6 +26,36 @@ if {"" eq $locale} {
set locale
[
lang::user::locale
]
}
# -------------------------------------------------------------
# Sort a list of invoice_ids according to invoice name
# -------------------------------------------------------------
ad_proc im_invoice_dependency_tree_sort_invoices
{
list
name_hash_list
}
{
Sort a list of invoice_ids according to invoice name
(
or whatever array provided in 2nd argument
)
}
{
array set name_hash
$name
_hash_list
# ad_return_complaint 1
$name
_hash_list
set slist
[
list
]
foreach l
$list
{
lappend slist
[
list
$name
_hash
(
$l
)
$l
]
}
set slist
[
lsort
$slist
]
set list
[
list
]
foreach l
$slist
{
lappend list
[
lindex
$l
1
]
}
return
$list
}
# -------------------------------------------------------------
# Main project
# -------------------------------------------------------------
...
...
@@ -204,6 +234,7 @@ while {[llength $list] > 0 && $cnt < 10000} {
foreach id
[
array
names hash
]
{
lappend list
$id
}
set list
[
im_invoice_dependency_tree_sort_invoices
$list
[
array
get name_hash
]]
}
...
...
@@ -275,6 +306,7 @@ while {[llength $list] > 0 && $cnt < 10000} {
foreach id
[
array
names hash
]
{
lappend list
$id
}
set list
[
im_invoice_dependency_tree_sort_invoices
$list
[
array
get name_hash
]]
}
# Display the successors per cost type
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment