Report updated

This commit is contained in:
projectsodoo 2021-01-27 12:40:19 +05:30
parent 2825443359
commit acbb48375c
1 changed files with 5 additions and 4 deletions

View File

@ -104,16 +104,17 @@ class BudgetAmtAnalysis(models.Model):
pro.pricing_type as pricing_type,
pro.project_type as project_type,
null::date AS timesheet_date,
(pro.hourly_rate * sum(AAL.unit_amount)) AS revenue
(pro.hourly_rate * pro.timesheet_hour) AS revenue
--(pro.hourly_rate * sum(AAL.unit_amount)) AS revenue
--(AAL.unit_amount) AS revenue
--(AAL.unit_amount * pro_emp.price_unit) AS revenue
FROM project_project PRO
--Left JOIN project_sale_line_employee_map pro_emp ON pro_emp.project_id = pro.id
LEFT JOIN account_analytic_account AA ON PRO.analytic_account_id = AA.id
LEFT JOIN account_analytic_line AAL ON AAL.account_id = AA.id and AAL.project_id = PRO.id
--LEFT JOIN account_analytic_account AA ON PRO.analytic_account_id = AA.id
--LEFT JOIN account_analytic_line AAL ON AAL.account_id = AA.id and AAL.project_id = PRO.id
--and AAL.employee_id = pro_emp.employee_id
WHERE PRO.active = 't' and PRO.pricing_type = 'employee_rate' and PRO.project_type = 'hours_no_limit'
group by pro.id
--group by pro.id
union
SELECT
pro.id AS project_id,