From 75552a8e0e94c064e860199bfdbaa48426204c2b Mon Sep 17 00:00:00 2001 From: root Date: Thu, 16 Jun 2022 19:57:43 +0530 Subject: [PATCH] Report project revenue null blank cell to 0 --- project_report/report/project_revenue_custom_report2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/project_report/report/project_revenue_custom_report2.py b/project_report/report/project_revenue_custom_report2.py index fe75266..8da428d 100755 --- a/project_report/report/project_revenue_custom_report2.py +++ b/project_report/report/project_revenue_custom_report2.py @@ -198,13 +198,13 @@ class ProjectRevenueCustomReport2(models.Model): AAL.unit_amount, COALESCE(pro_emp.price_unit, 0) as pro_hourly_rate, case when pro_emp.employee_price is null then ((AAL.amount * -1)/NULLIF(AAL.unit_amount, 0)) else pro_emp.employee_price end as timesheet_cost, - (AAL.unit_amount * pro_emp.price_unit) AS actual_revenue, + (AAL.unit_amount * COALESCE(pro_emp.price_unit, 0)) AS actual_revenue, case when pro_emp.employee_price is null then (AAL.amount * -1) else (AAL.unit_amount * pro_emp.employee_price) end as actual_cost, 0.0 AS expenses_amt, - (AAL.unit_amount * pro_emp.price_unit) - case when pro_emp.employee_price is null then (AAL.amount * -1) else (AAL.unit_amount * pro_emp.employee_price) end + (AAL.unit_amount * COALESCE(pro_emp.price_unit, 0)) - case when pro_emp.employee_price is null then (AAL.amount * -1) else (AAL.unit_amount * pro_emp.employee_price) end as profit_amt, - (((AAL.unit_amount * pro_emp.price_unit) - case when pro_emp.employee_price is null then (AAL.amount * -1) else (AAL.unit_amount * pro_emp.employee_price) end) - / NULLIF((AAL.unit_amount * pro_emp.price_unit), 0)) * 100 as profit_per, + (((AAL.unit_amount * COALESCE(pro_emp.price_unit, 0)) - case when pro_emp.employee_price is null then (AAL.amount * -1) else (AAL.unit_amount * pro_emp.employee_price) end) + / NULLIF((AAL.unit_amount * COALESCE(pro_emp.price_unit, 0)), 0)) * 100 as profit_per, AAL.start_datetime AS timesheet_sdatetime FROM project_project PRO LEFT JOIN account_analytic_account AA ON PRO.analytic_account_id = AA.id