profit amount calculation changes(CR)

This commit is contained in:
pawan.sharma 2022-03-11 14:21:29 +05:30
parent 879c275398
commit e7be0427e1
1 changed files with 9 additions and 4 deletions

View File

@ -134,10 +134,15 @@ class Project(models.Model):
record.timesheet_hour = timesheet_hour
total_exp = record.consultant_cost + record.expenses_amt
record.total_expenses = total_exp
profit_amt = record.budgeted_revenue - total_exp
record.profit_amt = profit_amt
if record.profit_amt > 0 and record.budgeted_revenue > 0:
record.profit_per = (record.profit_amt / record.budgeted_revenue) * 100
#record.profit_amt = record.budgeted_revenue - total_exp
# if record.profit_amt > 0 and record.budgeted_revenue > 0:
# record.profit_per = (record.profit_amt / record.budgeted_revenue) * 100
##### CR Changes
record.profit_amt = record.actual_revenue - record.consultant_cost
if record.profit_amt > 0:
record.profit_per = (record.profit_amt / record.actual_revenue) * 100
########################
if record.project_type == 'hours_in_consultant' and record.budgeted_hours > 0.0:
record.hourly_rate = (record.budgeted_revenue / record.budgeted_hours)
# if record.project_type == 'hours_no_limit' and record.budgeted_hours2 > 0.0: