Refactor: pull up method

This commit is contained in:
Eric Davis
2010-09-23 10:16:53 -07:00
parent ed9f73e8a0
commit b8d7c15b39
3 changed files with 4 additions and 15 deletions

View File

@@ -69,8 +69,11 @@ class Deliverable < ActiveRecord::Base
overhead_budgets.sum(:budget)
end
# The amount of profit that is budgeted for this deliverable.
# Profit = Total - ( Labor + Overhead + Fixed + Markup )
def profit_budget(date=nil)
nil
budgets = labor_budget_total(date) + overhead_budget_total(date) + fixed_budget_total(date) + fixed_markup_budget_total(date)
(total(date) || 0.0) - budgets
end
def labor_budget_hours(date=nil)

View File

@@ -20,13 +20,6 @@ class FixedDeliverable < Deliverable
total
end
# The amount of profit that is budgeted for this deliverable.
# Profit = Total - ( Labor + Overhead + Fixed + Markup )
def profit_budget(date=nil)
budgets = labor_budget_total(date) + overhead_budget_total(date) + fixed_budget_total(date) + fixed_markup_budget_total(date)
(total(date) || 0.0) - budgets
end
# The amount of money remaining after expenses have been taken out
# Profit left = Total - Labor spent - Overhead spent - Fixed - Markup
def profit_left(date=nil)

View File

@@ -50,13 +50,6 @@ class HourlyDeliverable < Deliverable
write_attribute(:total, nil)
end
# The amount of profit that is budgeted for this deliverable
# Profit = Total - ( Labor + Overhead + Fixed + Markup )
def profit_budget(date=nil)
budgets = labor_budget_total(date) + overhead_budget_total(date) + fixed_budget_total(date) + fixed_markup_budget_total(date)
(total(date) || 0.0) - budgets
end
# The amount of money remaining after expenses have been taken out
# Profit left = Total - Labor spent - Overhead spent - Fixed - Markup
def profit_left(date=nil)