diff --git a/project_report/report/project_revenue_custom_report3.py b/project_report/report/project_revenue_custom_report3.py index c1048c0..d98df9e 100644 --- a/project_report/report/project_revenue_custom_report3.py +++ b/project_report/report/project_revenue_custom_report3.py @@ -59,6 +59,7 @@ with pro_data as ( PRO.active as project_active, PRO.project_type, PRO.pricing_type, + PRO.is_sub_project, (select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project, --(select PRO.id from project_subproject_rel as PAR where PRO.id=PAR.project_id limit 1) as parent_project, STRING_AGG(distinct tag_master.name, ', ') as tag_name, @@ -156,7 +157,7 @@ data1 as ( >= drange_data1.start_date::date + '00:00:00'::time and AAL.end_datetime at time zone 'utc' at time zone (select tz from res_partner where id=3) <= drange_data1.end_date::date + '23:59:59'::time - where pro_data.pricing_type = 'fixed_rate' + where pro_data.pricing_type = 'fixed_rate' and COALESCE(pro_data.is_sub_project, FALSE) = False group by drange_data1.start_date, drange_data1.end_date, @@ -202,7 +203,7 @@ data2 as ( 0.0 AS profit_per FROM pro_data left join account_analytic_line AAL on AAL.project_id=pro_data.pproject_id - WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit' + WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit' and COALESCE(pro_data.is_sub_project, FALSE) = False group by pro_data.pproject_id, pro_data.project_active, @@ -250,7 +251,7 @@ SELECT >= drange_data1.start_date::date + '00:00:00'::time and AAL.end_datetime at time zone 'utc' at time zone (select tz from res_partner where id=3) <= drange_data1.end_date::date + '23:59:59'::time - WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit' + WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit' and COALESCE(pro_data.is_sub_project, FALSE) = False group by drange_data1.start_date, drange_data1.end_date, @@ -303,7 +304,7 @@ SELECT 0.0 as profit_per FROM pro_data left join account_analytic_line AAL on AAL.project_id=pro_data.pproject_id - where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant' + where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant' and COALESCE(pro_data.is_sub_project, FALSE) = False group by pro_data.pproject_id, pro_data.project_active, @@ -348,7 +349,7 @@ SELECT left join pro_data on pro_data.pproject_id = drange_data2.project_id left join cons_data1 on cons_data1.project_id=drange_data2.project_id and cons_data1.employee_id=drange_data2.employee_id and drange_data2.start_date >= cons_data1.start_date and drange_data2.end_date <= cons_data1.end_date - where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant' + where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant' and COALESCE(pro_data.is_sub_project, FALSE) = False group by drange_data2.start_date, drange_data2.end_date, @@ -407,7 +408,7 @@ SELECT >= cons_data1.start_date::date + '00:00:00'::time and AAL.end_datetime at time zone 'utc' at time zone (select tz from res_partner where id=3) <= cons_data1.end_date::date + '23:59:59'::time - where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant' + where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant' and COALESCE(pro_data.is_sub_project, FALSE) = False group by drange_data1.start_date, drange_data1.end_date, diff --git a/project_report/report/project_revenue_custom_report3_views.xml b/project_report/report/project_revenue_custom_report3_views.xml index c8dfd2b..155dd93 100644 --- a/project_report/report/project_revenue_custom_report3_views.xml +++ b/project_report/report/project_revenue_custom_report3_views.xml @@ -89,10 +89,14 @@ + - --> + + +