Merge branch 'copy_master' into 'master'

Report project revenue null blank cell to 0

See merge request prakash.jain/cor-odoo!230
This commit is contained in:
prakash.jain 2022-06-16 14:29:38 +00:00
commit 78010ed9df
1 changed files with 4 additions and 4 deletions

View File

@ -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