This commit is contained in:
pawan.sharma 2022-09-29 18:53:19 +05:30
commit 77216be798
2 changed files with 8 additions and 8 deletions

View File

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
from . import controllers
#from . import controllers

View File

@ -102,8 +102,8 @@ cons_data1 as (
date_trunc('month', min(PRO_EMP.start_date)) AS min,
date_trunc('month', coalesce(max(PRO_EMP.end_date), current_date AT TIME ZONE 'UTC')) AS max,
PRO_EMP.start_date as start_date,
PRO_EMP.end_date as end_date,
--coalesce(PRO_EMP.end_date, current_date AT TIME ZONE 'UTC') as end_date,
--PRO_EMP.end_date as end_date,
coalesce(PRO_EMP.end_date, current_date AT TIME ZONE 'UTC') as end_date,
PRO_EMP.project_id,
PRO_EMP.employee_id,
PRO_EMP.role,
@ -443,11 +443,11 @@ SELECT
FROM pro_data
left join account_analytic_line AAL on AAL.project_id=pro_data.pproject_id
left join cons_data1 on cons_data1.project_id=AAL.project_id and cons_data1.employee_id=AAL.employee_id
and (AAL.start_datetime, AAL.end_datetime) OVERLAPS (cons_data1.start_date::date, cons_data1.end_date::date)
--and AAL.start_datetime --at time zone 'utc' at time zone (select tz from res_partner where id=3)
-- >= cons_data1.start_date::date + '00:00:00'::time AT TIME ZONE 'UTC'
--and AAL.end_datetime --at time zone 'utc' at time zone (select tz from res_partner where id=3)
-- <= cons_data1.end_date::date + '23:59:59'::time AT TIME ZONE 'UTC'
--and (AAL.start_datetime, AAL.end_datetime) OVERLAPS (cons_data1.start_date::date, cons_data1.end_date::date)
and AAL.start_datetime --at time zone 'utc' at time zone (select tz from res_partner where id=3)
>= cons_data1.start_date::date + '00:00:00'::time AT TIME ZONE 'UTC'
and AAL.end_datetime --at time zone 'utc' at time zone (select tz from res_partner where id=3)
<= cons_data1.end_date::date + '23:59:59'::time AT TIME ZONE 'UTC'
where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant'
and COALESCE(pro_data.is_sub_project, FALSE) = False
group by