Commit c451cd47 authored by Frank Bergmann's avatar Frank Bergmann

-- allow grouped invoice items

parent 6096752b
......@@ -872,32 +872,32 @@ if { 0 == $item_list_type } {
incr ctr
}
} elseif { 100 == $item_list_type } {
# item_list_type: Translation Project Hirarchy
set invoice_items_sql "
select
ii.project_id as parent_id,
ii.item_source_project_id as parent_id,
p.project_id as project_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
trunc((price_per_unit * item_units) :: numeric, 2) as line_total,
(select category from im_categories where category_id = item_uom_id) as item_uom
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) )
left outer join im_projects p on (p.project_id in (select c.project_id from im_costs c where cost_id=:invoice_id) )
where
invoice_id=:invoice_id
order by
ii.project_id;
ii.item_source_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
......@@ -940,6 +940,7 @@ if { 0 == $item_list_type } {
} 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 "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment