Report issue fixed

This commit is contained in:
prakash 2022-03-09 21:32:38 +05:30
parent be95e4a0c7
commit f2d918eea8
1 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,7 @@ class BudgetAmtAnalysis(models.Model):
start_date = fields.Date(string='Start Date', readonly=True)
end_date = fields.Date(string='End Date', readonly=True)
timesheet_date = fields.Date(string='Timesheet Date', readonly=True)
timesheet_sdatetime = fields.Datetime(string='Timesheet Start Time', readonly=True)
#budgeted_revenue = fields.Float("Budgeted Revenue", digits=(16, 2), readonly=True, group_operator="sum")
#actual_revenue = fields.Float("Actual Revenue", digits=(16, 2), readonly=True, group_operator="sum")
@ -51,6 +52,7 @@ class BudgetAmtAnalysis(models.Model):
pro.pricing_type as pricing_type,
pro.project_type as project_type,
null::date AS timesheet_date,
null::timestamp with time zone AS timesheet_sdatetime,
pro_emp.cost AS revenue
FROM project_project pro
Left JOIN project_sale_line_employee_map pro_emp ON pro_emp.project_id = pro.id
@ -66,14 +68,15 @@ class BudgetAmtAnalysis(models.Model):
'Actual Cost' as amount_type,
pro.pricing_type as pricing_type,
pro.project_type as project_type,
null::date AS timesheet_date,
AAL.date AS timesheet_date,
AAL.start_datetime AS timesheet_sdatetime,
(sum(AAL.unit_amount) * pro_emp.employee_price) 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 and AAL.employee_id = pro_emp.employee_id
WHERE PRO.active = 't' and AAL.employee_id is not null and PRO.pricing_type = 'employee_rate' and PRO.project_type = 'hours_in_consultant'
group by pro.id, aal.employee_id, aal.start_datetime, pro_emp.employee_price
group by pro.id, aal.employee_id, aal.date, aal.start_datetime, pro_emp.employee_price
union
SELECT
pro.id AS project_id,
@ -86,6 +89,7 @@ class BudgetAmtAnalysis(models.Model):
pro.pricing_type as pricing_type,
pro.project_type as project_type,
null::date AS timesheet_date,
null::timestamp with time zone AS timesheet_sdatetime,
pro.budgeted_revenue AS revenue
FROM project_project pro
--Left JOIN project_sale_line_employee_map pro_emp ON pro_emp.project_id = pro.id
@ -102,6 +106,7 @@ class BudgetAmtAnalysis(models.Model):
pro.pricing_type as pricing_type,
pro.project_type as project_type,
null::date AS timesheet_date,
null::timestamp with time zone AS timesheet_sdatetime,
(pro.hourly_rate * pro.timesheet_hour) AS revenue
FROM project_project PRO
--Left JOIN project_sale_line_employee_map pro_emp ON pro_emp.project_id = pro.id
@ -122,6 +127,7 @@ class BudgetAmtAnalysis(models.Model):
pro.pricing_type as pricing_type,
pro.project_type as project_type,
AAL.date AS timesheet_date,
AAL.start_datetime AS timesheet_sdatetime,
(sum(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
@ -142,6 +148,7 @@ class BudgetAmtAnalysis(models.Model):
pro.pricing_type as pricing_type,
pro.project_type as project_type,
AAL.date AS timesheet_date,
AAL.start_datetime AS timesheet_sdatetime,
(AAL.amount * -1) AS revenue
FROM project_project PRO
LEFT JOIN account_analytic_account AA ON PRO.analytic_account_id = AA.id