timeline report sql updated
This commit is contained in:
parent
b1c43e3780
commit
efb5cd0836
|
@ -69,7 +69,8 @@ class BudgetHrsAnalysis(models.Model):
|
|||
date AS enddate,
|
||||
'Budgeted' as hours_type,
|
||||
pro_emp.budgeted_qty as hours,
|
||||
(date - date_start) as timeline,
|
||||
pro_emp.budgeted_qty/8 as timeline,
|
||||
--(date - date_start) as timeline,
|
||||
pro.*
|
||||
FROM
|
||||
project_project PRO
|
||||
|
@ -86,7 +87,8 @@ class BudgetHrsAnalysis(models.Model):
|
|||
date AS enddate,
|
||||
'Budgeted' as hours_type,
|
||||
pro.budgeted_hours2 as hours,
|
||||
(date - date_start) as timeline,
|
||||
--(date - date_start) as timeline,
|
||||
pro.budgeted_hours2/8 as timeline,
|
||||
pro.*
|
||||
FROM
|
||||
project_project PRO
|
||||
|
@ -103,8 +105,9 @@ class BudgetHrsAnalysis(models.Model):
|
|||
(select max(al.end_datetime::date) from account_analytic_line as al) as enddate,
|
||||
'Actual' as hours_type,
|
||||
unit_amount as hours,
|
||||
(select max(al.end_datetime::date) from account_analytic_line as al) -
|
||||
coalesce(pro.date_start, (select min(al.start_datetime::date) from account_analytic_line as al where pro.id=al.project_id)) AS timeline,
|
||||
unit_amount/8 as timeline,
|
||||
--(select max(al.end_datetime::date) from account_analytic_line as al) -
|
||||
--coalesce(pro.date_start, (select min(al.start_datetime::date) from account_analytic_line as al where pro.id=al.project_id)) AS timeline,
|
||||
pro.*
|
||||
FROM project_project PRO
|
||||
Left JOIN project_sale_line_employee_map pro_emp ON pro_emp.project_id = pro.id
|
||||
|
@ -122,8 +125,9 @@ class BudgetHrsAnalysis(models.Model):
|
|||
(select max(al.end_datetime::date) from account_analytic_line as al) as enddate,
|
||||
'Actual' as hours_type,
|
||||
unit_amount as hours,
|
||||
(select max(al.end_datetime::date) from account_analytic_line as al) -
|
||||
(select min(al.start_datetime::date) from account_analytic_line as al where pro.id=al.project_id) AS timeline,
|
||||
unit_amount/8 as timeline,
|
||||
--(select max(al.end_datetime::date) from account_analytic_line as al) -
|
||||
--(select min(al.start_datetime::date) from account_analytic_line as al where pro.id=al.project_id) AS timeline,
|
||||
pro.*
|
||||
FROM project_project PRO
|
||||
LEFT JOIN account_analytic_account AA ON PRO.analytic_account_id = AA.id
|
||||
|
@ -140,7 +144,8 @@ class BudgetHrsAnalysis(models.Model):
|
|||
(select max(al.end_datetime::date) from account_analytic_line as al) as enddate,
|
||||
'Actual' as hours_type,
|
||||
unit_amount as hours,
|
||||
(select max(al.end_datetime::date) from account_analytic_line as al) - pro.date_start AS timeline,
|
||||
unit_amount/8 as timeline,
|
||||
--(select max(al.end_datetime::date) from account_analytic_line as al) - pro.date_start AS timeline,
|
||||
--DATE_PART('day', AGE(select max(al.end_datetime::date) from account_analytic_line, pro.date_start)) AS timeline,
|
||||
pro.*
|
||||
FROM project_project PRO
|
||||
|
|
|
@ -786,7 +786,7 @@ var MAX_LEGEND_LENGTH = 25 * (1 + config.device.size_class);
|
|||
dataset.stack = self.state.stacked ? self.state.origins[dataset.originIndex] : undefined;
|
||||
// set dataset color
|
||||
if (self.resModel == 'project.budget.hrs.report') {
|
||||
if (dataset.label.indexOf("Actual Hours") === -1 && dataset.label.toLowerCase().indexOf("Budgeted Hours") === -1) {
|
||||
if (dataset.label.indexOf("Actual") === -1 && dataset.label.toLowerCase().indexOf("Budgeted") === -1) {
|
||||
var color = self._getColor(index);
|
||||
dataset.backgroundColor = color;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue