diff --git a/project_report/report/project_revenue_custom_report3.py b/project_report/report/project_revenue_custom_report3.py index cf9a0be..dd9044d 100644 --- a/project_report/report/project_revenue_custom_report3.py +++ b/project_report/report/project_revenue_custom_report3.py @@ -263,6 +263,7 @@ data2 as ( WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit' and AAL.sub_project is null and COALESCE(pro_data.is_sub_project, FALSE) = False + and (pro_data.budgeted_revenue>0 or pro_data.budgeted_hours>0) group by pro_data.pproject_id, pro_data.project_active, @@ -359,6 +360,7 @@ data2_sub_project as ( FROM sub_pro_data WHERE sub_pro_data.pricing_type='employee_rate' and sub_pro_data.project_type='hours_no_limit' and sub_pro_data.is_sub_project = TRUE + and (sub_pro_data.budgeted_revenue>0 or sub_pro_data.budgeted_hours>0) group by sub_pro_data.parent_project, sub_pro_data.project_active, @@ -457,6 +459,7 @@ SELECT where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant' and AAL.sub_project is null and COALESCE(pro_data.is_sub_project, FALSE) = False + and (pro_data.budgeted_revenue>0 or pro_data.pro_hourly_rate>0 or pro_data.expenses_amt>0) group by pro_data.pproject_id, pro_data.project_active, @@ -502,6 +505,7 @@ SELECT 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' and COALESCE(pro_data.is_sub_project, FALSE) = False + and (cons_data1.budgeted_revenue>0 or cons_data1.budgeted_hours>0) group by drange_data2.start_date, drange_data2.end_date, @@ -610,6 +614,7 @@ SELECT FROM sub_pro_data where sub_pro_data.pricing_type='employee_rate' and sub_pro_data.project_type='hours_in_consultant' and sub_pro_data.is_sub_project = True + and (sub_pro_data.budgeted_revenue>0 or sub_pro_data.pro_hourly_rate>0 or sub_pro_data.expenses_amt>0) group by sub_pro_data.pproject_id, sub_pro_data.project_active, @@ -661,6 +666,7 @@ SELECT --and drange_data2.end_date <= cons_data1.end_date where sub_pro_data.pricing_type='employee_rate' and sub_pro_data.project_type='hours_in_consultant' and sub_pro_data.is_sub_project = True + and (cons_data1.budgeted_revenue>0 or cons_data1.budgeted_hours>0) group by drange_data2.start_date, drange_data2.end_date,