Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-core
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-core
Commits
2151f80f
Commit
2151f80f
authored
Mar 15, 2023
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Beautified matrix to create financial documents from other docs
parent
74fa3698
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
intranet-menu-procs.tcl
tcl/intranet-menu-procs.tcl
+17
-7
No files found.
tcl/intranet-menu-procs.tcl
View file @
2151f80f
...
...
@@ -448,6 +448,7 @@ ad_proc -public im_menu_invoice_creation_matrix {
ns_log Notice
"im_invoice_creation_link_matrix: name='
$name
'"
if
{[
regexp
-nocase
{
new
(
.*
)
from
(
.*
)
$
}
$name
match type source
]}
{
set source
[
string
totitle
$source
]
if
{
"scratch"
eq
$source
}
{
set source
"Scratch"
}
set type_hash
(
$type
)
$type
set source_hash
(
$source
)
$source
ns_log Notice
"im_invoice_creation_link_matrix: name='
$name
', type=
$type
, source=
$source
"
...
...
@@ -515,7 +516,7 @@ ad_proc -public im_menu_invoice_creation_matrix_sort_types {
Sorts the list of invoice types using some custom ordering.
This is not particularly pretty, but required for usability.
}
{
set order_list
[
list
"Customer Invoice"
"Quote"
"
Delivery Note"
"Provider Bill"
"Purchase Order
"
]
set order_list
[
list
"Customer Invoice"
"Quote"
"
Budgeted Purchase"
"Purchase Order"
"Provider Purchase Order"
"Delivery Note"
"Goods Received"
"Goods Accepted"
"Provider Bill"
"Purchase ETC
"
]
set result
[
list
]
foreach term
$order
_list
{
...
...
@@ -533,14 +534,23 @@ ad_proc -public im_menu_invoice_creation_matrix_sort_sources {
Sorts the list of invoice types using some custom ordering.
This is not particularly pretty, but required for usability.
}
{
set order_list
[
list
"Scratch"
"Timesheet tasks"
"Invoice"
"Quote"
"
Delivery note"
"Provider Bill"
"Purchase Order
"
]
set order_list
[
list
"Scratch"
"Timesheet tasks"
"Invoice"
"Quote"
"
Budgeted Purchase"
"Purchase Order"
"Provider Purchase Order"
"Delivery note"
"Goods Received"
"Goods Accepted"
"Provider Bill"
"Purchase ETC
"
]
set order_list_lower
[
string
tolower
$order
_list
]
set list_lower
[
string
tolower
$list
]
set rest
[
string
tolower
$list
]
set result
[
list
]
foreach term
$order
_list
{
set rest
[
lsearch
-inline -all -not
$list
$term
]
if
{
$rest
ne
$list
}
{
lappend result
$term
}
set list
$rest
}
for
{
set
i 0
}
{
$i
<
[
llength
$order
_list_lower
]}
{
incr
i
}
{
set term_lower
[
lindex
$order
_list_lower
$i
]
set term
[
lindex
$order
_list
$i
]
set idx
[
lsearch
$list
_lower
$term
_lower
]
set term_org
[
lindex
$list
$idx
]
if
{
$idx
> -1
}
{
lappend result
$term
_org
set rest_idx
[
lsearch
$rest
$term
_lower
]
set rest
[
lreplace
$rest
$rest
_idx
$rest
_idx
]
}
}
return
[
concat
$result
$rest
]
}
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