Revenue report updated all the lines
This commit is contained in:
parent
af77ddde0a
commit
9d050f312a
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue