add changes in report

This commit is contained in:
pawan.sharma 2022-03-25 15:18:17 +05:30
parent 53fc6ccd52
commit 56fc43ade1
2 changed files with 15 additions and 4 deletions

View File

@ -15,10 +15,13 @@ class CorProjectReport(models.Model):
#hours_type = fields.Char(string="Hours Type", readonly=True)
price_unit = fields.Float("Hourly Rate")
budgeted_qty = fields.Float(string='Budgeted Hours', digits=(16, 2))
hours = fields.Float("Number of Hours", digits=(16, 2), readonly=True, group_operator="sum")
cost = fields.Float("Budgeted Revenue", default=0.0, store=True)
hours = fields.Float("Timesheet Hour", digits=(16, 2), readonly=True, group_operator="sum")
employee_price = fields.Float(string="Consultant Price")
consultant_cost = fields.Float("Actual Cost")
actual_revenue = fields.Float("Actual Revenue")
profit = fields.Float('Profit', digits=(16, 2))
profit_per = fields.Float('Porfit(%)', digits=(16, 2))
# pricing_type = fields.Selection([
# ('fixed_rate', 'Fixed rate'),
# ('employee_rate', 'Consultant rate')
@ -38,11 +41,14 @@ class CorProjectReport(models.Model):
aa.employee_id AS employee_id,
bb.price_unit AS price_unit,
bb.budgeted_qty AS budgeted_qty,
bb.cost AS cost,
bb.employee_price AS employee_price,
SUM(aa.unit_amount) AS hours,
bb.consultant_cost AS consultant_cost
(SUM(aa.unit_amount) * bb.employee_price) AS consultant_cost,
(SUM(aa.unit_amount) * bb.price_unit) AS actual_revenue,
((SUM(aa.unit_amount) * bb.price_unit)- (SUM(aa.unit_amount) * bb.employee_price)) AS profit,
((((SUM(aa.unit_amount) * bb.price_unit)- (SUM(aa.unit_amount) * bb.employee_price))/(SUM(aa.unit_amount) * bb.price_unit))*100) AS profit_per
FROM account_analytic_line aa
Left JOIN project_sale_line_employee_map bb ON bb.project_id = aa.project_id and bb.employee_id = aa.employee_id
where aa.project_id = 21
GROUP BY aa.project_id, aa.employee_id,bb.price_unit,bb.budgeted_qty,bb.employee_price,bb.consultant_cost
GROUP BY aa.project_id, aa.employee_id,bb.price_unit,bb.budgeted_qty,bb.cost,bb.employee_price
)""" % (self._table,))

View File

@ -34,8 +34,13 @@
<field name="employee_id"/>
<field name="price_unit"/>
<field name="budgeted_qty"/>
<field name="cost"/>
<field name="employee_price"/>
<field name="hours"/>
<field name="consultant_cost"/>
<field name="actual_revenue"/>
<field name="profit"/>
<field name="profit_per"/>
</tree>
</field>
</record>