Compare commits
2 Commits
24c1457c18
...
f447e0d214
Author | SHA1 | Date |
---|---|---|
|
f447e0d214 | |
|
7eaca8ceab |
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="13e6133c-1ece-492a-a052-ede888fe6af9" name="Changes" comment="" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo"><![CDATA[{
|
||||
"associatedIndex": 1
|
||||
}]]></component>
|
||||
<component name="ProjectId" id="2yeESQA6CGAVvX0x7oadWK3oLjJ" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"git-widget-placeholder": "master",
|
||||
"last_opened_file_path": "D:/odoo-14.0/cor-odoo"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-python-sdk-890ed5b35930-d9c5bdb153f4-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-251.23774.444" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
|
@ -45,6 +45,7 @@ class ProjectRevenueCustomReport3(models.Model):
|
|||
role = fields.Selection([('Manager', 'Manager'), ('Employee', 'Employee')], string="Role")
|
||||
#is_sub_project = fields.Boolean("Is Sub Project")
|
||||
sub_project = fields.Many2one('project.project', string='Sub Project')
|
||||
fixed_amount_date = fields.Date('Fixed Amount Date', readonly=True)
|
||||
|
||||
|
||||
def init(self):
|
||||
|
@ -169,7 +170,8 @@ data1 as (
|
|||
(sum(AAL.amount) * -1) as actual_cost,
|
||||
0.0 AS expenses_amt,
|
||||
(0.0 - (sum(AAL.amount) * -1)) AS profit_amt,
|
||||
0.0 AS profit_per
|
||||
0.0 AS profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM pro_data
|
||||
right 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
|
||||
|
@ -222,7 +224,8 @@ data1_sub as (
|
|||
(sum(AAL.amount) * -1) as actual_cost,
|
||||
0.0 AS expenses_amt,
|
||||
(0.0 - (sum(AAL.amount) * -1)) AS profit_amt,
|
||||
0.0 AS profit_per
|
||||
0.0 AS profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM sub_pro_data
|
||||
right join account_analytic_line AAL on AAL.sub_project=sub_pro_data.sub_project
|
||||
LEFT JOIN cons_data1 ON cons_data1.project_id = AAL.project_id
|
||||
|
@ -274,7 +277,8 @@ data2 as (
|
|||
0 as actual_cost,
|
||||
pro_data.expenses_amt,
|
||||
0.0 AS profit_amt,
|
||||
0.0 AS profit_per
|
||||
0.0 AS profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM pro_data
|
||||
WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit'
|
||||
and COALESCE(pro_data.is_sub_project, FALSE) = False
|
||||
|
@ -320,7 +324,8 @@ SELECT
|
|||
(AAL.amount * -1) as actual_cost,
|
||||
0 AS expenses_amt,
|
||||
((AAL.unit_amount * pro_data.pro_hourly_rate) - (AAL.amount * -1)) AS profit_amt,
|
||||
((AAL.unit_amount * pro_data.pro_hourly_rate) - (AAL.amount * -1))/NULLIF((AAL.unit_amount * pro_data.pro_hourly_rate),0) AS profit_per
|
||||
((AAL.unit_amount * pro_data.pro_hourly_rate) - (AAL.amount * -1))/NULLIF((AAL.unit_amount * pro_data.pro_hourly_rate),0) AS profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM pro_data
|
||||
right join account_analytic_line AAL on AAL.project_id=pro_data.pproject_id
|
||||
WHERE pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_no_limit'
|
||||
|
@ -375,7 +380,8 @@ data2_sub_project as (
|
|||
0 as actual_cost,
|
||||
sub_pro_data.expenses_amt,
|
||||
0.0 AS profit_amt,
|
||||
0.0 AS profit_per
|
||||
0.0 AS profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM sub_pro_data
|
||||
WHERE sub_pro_data.pricing_type='employee_rate' and sub_pro_data.project_type='hours_no_limit'
|
||||
and sub_pro_data.is_sub_project = TRUE
|
||||
|
@ -421,7 +427,8 @@ SELECT
|
|||
(AAL.amount * -1) as actual_cost,
|
||||
0 AS expenses_amt,
|
||||
((AAL.unit_amount * sub_pro_data.pro_hourly_rate) - (AAL.amount * -1)) AS profit_amt,
|
||||
((AAL.unit_amount * sub_pro_data.pro_hourly_rate) - (AAL.amount * -1))/NULLIF((AAL.unit_amount * sub_pro_data.pro_hourly_rate),0) AS profit_per
|
||||
((AAL.unit_amount * sub_pro_data.pro_hourly_rate) - (AAL.amount * -1))/NULLIF((AAL.unit_amount * sub_pro_data.pro_hourly_rate),0) AS profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM sub_pro_data
|
||||
right join account_analytic_line AAL on AAL.sub_project=sub_pro_data.sub_project
|
||||
WHERE sub_pro_data.pricing_type='employee_rate' and sub_pro_data.project_type='hours_no_limit'
|
||||
|
@ -476,7 +483,8 @@ SELECT
|
|||
0.0 as actual_cost,
|
||||
pro_data.expenses_amt,
|
||||
0.0 as profit_amt,
|
||||
0.0 as profit_per
|
||||
0.0 as profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM pro_data
|
||||
right join account_analytic_line AAL on AAL.project_id=pro_data.pproject_id
|
||||
where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant'
|
||||
|
@ -523,7 +531,8 @@ SELECT
|
|||
0 as actual_cost,
|
||||
0 as expenses_amt,
|
||||
0 as profit_amt,
|
||||
0 as profit_per
|
||||
0 as profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM pro_data
|
||||
left join cons_data1 on cons_data1.project_id = pro_data.pproject_id
|
||||
where pro_data.pricing_type='employee_rate' and pro_data.project_type='hours_in_consultant'
|
||||
|
@ -573,7 +582,8 @@ SELECT
|
|||
(AAL.unit_amount * COALESCE(cons_data1.cons_hourly_cost, 0)) - case when cons_data1.cons_timesheet_cost is null
|
||||
then (AAL.amount * -1) else (AAL.unit_amount * cons_data1.cons_timesheet_cost) end as profit_amt,
|
||||
(((AAL.unit_amount * COALESCE(cons_data1.cons_hourly_cost, 0)) - case when cons_data1.cons_timesheet_cost is null then (AAL.amount * -1)
|
||||
else (AAL.unit_amount * cons_data1.cons_timesheet_cost) end) / NULLIF((AAL.unit_amount * COALESCE(cons_data1.cons_hourly_cost, 0)), 0)) * 100 as profit_per
|
||||
else (AAL.unit_amount * cons_data1.cons_timesheet_cost) end) / NULLIF((AAL.unit_amount * COALESCE(cons_data1.cons_hourly_cost, 0)), 0)) * 100 as profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM pro_data
|
||||
right 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
|
||||
|
@ -633,7 +643,8 @@ SELECT
|
|||
0.0 as actual_cost,
|
||||
sub_pro_data.expenses_amt,
|
||||
0.0 as profit_amt,
|
||||
0.0 as profit_per
|
||||
0.0 as profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM sub_pro_data
|
||||
where sub_pro_data.pricing_type='employee_rate' and sub_pro_data.project_type='hours_in_consultant'
|
||||
and sub_pro_data.is_sub_project = True
|
||||
|
@ -679,7 +690,8 @@ SELECT
|
|||
0 as actual_cost,
|
||||
0 as expenses_amt,
|
||||
0 as profit_amt,
|
||||
0 as profit_per
|
||||
0 as profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM sub_pro_data
|
||||
left join cons_data1 on cons_data1.project_id = sub_pro_data.sub_project
|
||||
where sub_pro_data.pricing_type='employee_rate' and sub_pro_data.project_type='hours_in_consultant'
|
||||
|
@ -730,7 +742,8 @@ SELECT
|
|||
(AAL.unit_amount * COALESCE(cons_data1.cons_hourly_cost, 0)) - case when cons_data1.cons_timesheet_cost is null
|
||||
then (AAL.amount * -1) else (AAL.unit_amount * cons_data1.cons_timesheet_cost) end as profit_amt,
|
||||
(((AAL.unit_amount * COALESCE(cons_data1.cons_hourly_cost, 0)) - case when cons_data1.cons_timesheet_cost is null then (AAL.amount * -1)
|
||||
else (AAL.unit_amount * cons_data1.cons_timesheet_cost) end) / NULLIF((AAL.unit_amount * COALESCE(cons_data1.cons_hourly_cost, 0)), 0)) * 100 as profit_per
|
||||
else (AAL.unit_amount * cons_data1.cons_timesheet_cost) end) / NULLIF((AAL.unit_amount * COALESCE(cons_data1.cons_hourly_cost, 0)), 0)) * 100 as profit_per,
|
||||
null::date as fixed_amount_date
|
||||
FROM sub_pro_data
|
||||
right join account_analytic_line AAL on AAL.sub_project=sub_pro_data.sub_project
|
||||
left join cons_data1 on cons_data1.project_id=AAL.sub_project and cons_data1.employee_id=AAL.employee_id
|
||||
|
@ -788,7 +801,8 @@ invoice_data as (SELECT
|
|||
0 as actual_cost,
|
||||
0.0 AS expenses_amt,
|
||||
invoice_date.fixed_amount AS profit_amt,
|
||||
0.0 AS profit_per
|
||||
0.0 AS profit_per,
|
||||
invoice_date.date as fixed_amount_date
|
||||
from invoice_date
|
||||
left join pro_data on pro_data.pproject_id = invoice_date.project_id --and pro_data.employee_id = invoice_date.employee_id
|
||||
where COALESCE(pro_data.is_sub_project, FALSE) = False
|
||||
|
@ -820,7 +834,8 @@ invoice_data_sub as (SELECT
|
|||
0 as actual_cost,
|
||||
0.0 AS expenses_amt,
|
||||
invoice_date.fixed_amount AS profit_amt,
|
||||
0.0 AS profit_per
|
||||
0.0 AS profit_per,
|
||||
invoice_date.date as fixed_amount_date
|
||||
from invoice_date
|
||||
left join sub_pro_data on sub_pro_data.sub_project = invoice_date.project_id
|
||||
where sub_pro_data.is_sub_project = True
|
||||
|
@ -870,7 +885,8 @@ select
|
|||
actual_cost,
|
||||
expenses_amt,
|
||||
profit_amt,
|
||||
profit_per
|
||||
profit_per,
|
||||
fixed_amount_date
|
||||
from res
|
||||
group by
|
||||
start_date,
|
||||
|
@ -899,7 +915,8 @@ group by
|
|||
actual_cost,
|
||||
expenses_amt,
|
||||
profit_amt,
|
||||
profit_per
|
||||
profit_per,
|
||||
fixed_amount_date
|
||||
)""" % (self._table,))
|
||||
|
||||
@api.model
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
<field name="profit_per" optional="show" sum="Total Of profit Percentage"/>
|
||||
<field name="unit_amount" widget="float_time" optional="show" sum="Total Of Timesheet Hours"/>
|
||||
<field name="timesheet_cost" optional="show" sum="Total Of Hourly Cost"/>
|
||||
<field name="fixed_amount_date" optional="show"/>
|
||||
<field name="start_date" optional="show"/>
|
||||
<field name="end_date" optional="show"/>
|
||||
<field name="timesheet_sdatetime" widget="date" optional="show"/>
|
||||
|
@ -82,6 +83,7 @@
|
|||
<filter string="Total hours are budgeted without division to consultant" name="limit" domain="[('pricing_type','=','employee_rate'),('project_type','=','hours_no_limit')]"/>
|
||||
<filter string="Start Date" name="filter_start_date" date="start_date"/>
|
||||
<filter string="Timesheet Start Time" name="filter_timesheet_sdatetime" date="timesheet_sdatetime"/>
|
||||
<filter string="Fixed Amount Date" name="filter_fixed_amount_date" date="fixed_amount_date"/>
|
||||
<filter name="group_by_day" string="Timesheet Start Time" context="{'group_by': 'timesheet_sdatetime:day'}"/>
|
||||
<filter string="Actual/Budgeted" name="custom_bhrs" domain="['|','|',('overall_budgeted_revenue','>',0),('budgeted_hours','>',0),('budgeted_revenue','>',0)]"/>
|
||||
<!-- <filter string="Actual/Budgeted" name="custom_bhrs" domain="[('timesheet_sdatetime','=',False)]"/>-->
|
||||
|
|
Loading…
Reference in New Issue