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
6096752b
Commit
6096752b
authored
Jul 22, 2011
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-- added support for grouped invoice items
parent
6353f609
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
view.tcl
www/view.tcl
+69
-0
No files found.
www/view.tcl
View file @
6096752b
...
...
@@ -871,6 +871,75 @@ if { 0 == $item_list_type } {
incr ctr
}
}
else
if
{
100 ==
$item
_list_type
}
{
# item_list_type: Translation Project Hirarchy
set invoice_items_sql
"
select
ii.project_id as parent_id,
item_name as parent_name,
item_name as project_name,
item_units,
item_type_id,
item_uom_id,
price_per_unit,
trunc((price_per_unit * item_units) :: numeric, 2) as line_total
from
im_invoice_items ii
left outer join im_projects p on (p.project_id in (select c.project_id from im_costs c where cost_id=59729) )
where
invoice_id=:invoice_id
order by
ii.project_id;
"
set old_parent_id -1
set amount_total 0
set amount_sub_total 0
set item_uom
"s-words"
db_foreach related_projects
$invoice
_items_sql
{
# ad_return_complaint 1
"ctr:
$ctr
, old_parent_id:
$old
_parent_id, parent_id:
$parent
_id, level:
$level
, amount_sub_total:
$amount
_sub_total, task_id:
$task
_id"
# SUBTOTALS
if
{
(
"0"
!=$ctr &&
$old
_parent_id!=$parent_id && 0!=$amount_sub_total
)
}
{
append invoice_item_html
"
<tr><td class='invoiceroweven' colspan ='100' align='right'>
[
lc_numeric
[
im_numeric_add_trailing_zeros
[
expr
$amount
_sub_total+0
]
$rounding
_precision
]
""
$locale
]
$currency
</td></tr>
"
set amount_sub_total 0
}
if
{
$old
_parent_id !=
$parent
_id
}
{
set parent_project_name
[
db_string get_parent_project_name
"select project_name from im_projects where project_id =
$parent
_id"
-default 0
]
append invoice_item_html
"<tr><td class='invoiceroweven'></td></tr>"
append invoice_item_html
"<tr><td class='invoiceroweven'><b>
$parent
_project_name</b></td></tr>"
set old_parent_id
$parent
_id
}
set amount_pretty
[
lc_numeric
[
im_numeric_add_trailing_zeros
[
expr
$amount
+0
]
$rounding
_precision
]
""
$locale
]
set item_units_pretty
[
lc_numeric
[
expr
$item
_units+0
]
""
$locale
]
set price_per_unit_pretty
[
lc_numeric
[
im_numeric_add_trailing_zeros
[
expr
$price
_per_unit+0
]
$rounding
_precision
]
""
$locale
]
append invoice_item_html
"<tr>"
append invoice_item_html
"<td class='invoiceroweven'>
$parent
_name</td>"
if
{
$show
_qty_rate_p
}
{
append invoice_item_html
"
<td
$bgcolor
(
[
expr
$ctr
% 2
]
) align=right>
$item
_units_pretty</td>
<td
$bgcolor
(
[
expr
$ctr
% 2
]
) align=left>
[
lang::message::lookup
$locale
intranet-core.$item_uom
$item
_uom
]
</td>
<td
$bgcolor
(
[
expr
$ctr
% 2
]
) align=right>
$price
_per_unit_pretty
$currency
</td>
"
}
if
{
$show
_our_project_nr
}
{
append invoice_item_html
"
<td
$bgcolor
(
[
expr
$ctr
% 2
]
) align=left>
$project
_short_name</td>
\n
"
}
append invoice_item_html
"<td
$bgcolor
(
[
expr
$ctr
% 2
]
) align=right>
$line
_total
$currency
</td></tr>"
set amount_sub_total
[
expr
$amount
_sub_total +
$line
_total
]
set amount_total
[
expr
$amount
_sub_total +
$amount
_total
]
incr ctr
}
if_no_rows
{
append invoice_item_html
"<tr><td>
[
lang::message::lookup
$locale
intranet-timesheet2-invoices.No_Information
]
</td></tr>"
}
}
else
{
set indent_level
[
db_string get_view_id
"
...
...
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