diff --git a/project_report/report/cor_project_report.py b/project_report/report/cor_project_report.py
index 49e9112..6dcb1cc 100755
--- a/project_report/report/cor_project_report.py
+++ b/project_report/report/cor_project_report.py
@@ -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,))
diff --git a/project_report/report/cor_project_report_views.xml b/project_report/report/cor_project_report_views.xml
index 8fb5459..3eefb93 100755
--- a/project_report/report/cor_project_report_views.xml
+++ b/project_report/report/cor_project_report_views.xml
@@ -34,8 +34,13 @@
+
+
+
+
+