From 9d050f312a7dc801471bd343cfc6e36795314390 Mon Sep 17 00:00:00 2001 From: prakash Date: Wed, 27 Apr 2022 17:31:14 +0530 Subject: [PATCH] Revenue report updated all the lines --- .../report/project_revenue_custom_report.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/project_report/report/project_revenue_custom_report.py b/project_report/report/project_revenue_custom_report.py index b1cc71e..e77ac2b 100755 --- a/project_report/report/project_revenue_custom_report.py +++ b/project_report/report/project_revenue_custom_report.py @@ -237,25 +237,25 @@ class ProjectRevenueCustomReport(models.Model): actual_cost = line['actual_cost'] if 'actual_cost' in line: hourly_rate = line['pro_hourly_rate'] - if 'unit_amount' in line and 'pro_hourly_rate' in line and 'id' in line: + if 'unit_amount' in line and 'pro_hourly_rate' in line: # and 'id' in line if hourly_rate != 0: line['actual_revenue'] = hourly_rate * line['unit_amount'] - if 'unit_amount' in line and 'timesheet_cost' in line and 'id' in line: + if 'unit_amount' in line and 'timesheet_cost' in line: line['actual_cost'] = line['timesheet_cost'] * line['unit_amount'] - if 'overall_budgeted_revenue' in line and 'budgeted_hours' in line and 'id' in line: + if 'overall_budgeted_revenue' in line and 'budgeted_hours' in line: if line['budgeted_hours'] > 0: line['overall_hourly_rate'] = line['overall_budgeted_revenue'] / line['budgeted_hours'] - if 'pro_hourly_rate' in line and 'budgeted_hours' in line and 'id' in line: + if 'pro_hourly_rate' in line and 'budgeted_hours' in line: if line['budgeted_hours'] > 0: line['pro_hourly_rate'] = line['budgeted_revenue'] / line['budgeted_hours'] - if 'actual_revenue' in line and 'actual_cost' in line and 'expenses_amt' in line and 'id' in line: + if 'actual_revenue' in line and 'actual_cost' in line and 'expenses_amt' in line: line['profit_amt'] = line['actual_revenue'] - line['actual_cost'] - line['expenses_amt'] - if 'profit_amt' in line and 'actual_revenue' in line and 'id' in line: + if 'profit_amt' in line and 'actual_revenue' in line: try: line['profit_per'] = (line['profit_amt'] / line['actual_revenue']) * 100 except ZeroDivisionError: pass - if 'unit_amount' in line and 'id' in line: + if 'unit_amount' in line: try: line['timesheet_cost'] = actual_cost / line['unit_amount'] except ZeroDivisionError: