Refactor: pull up method
This commit is contained in:
@@ -69,8 +69,11 @@ class Deliverable < ActiveRecord::Base
|
|||||||
overhead_budgets.sum(:budget)
|
overhead_budgets.sum(:budget)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# The amount of profit that is budgeted for this deliverable.
|
||||||
|
# Profit = Total - ( Labor + Overhead + Fixed + Markup )
|
||||||
def profit_budget(date=nil)
|
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
|
end
|
||||||
|
|
||||||
def labor_budget_hours(date=nil)
|
def labor_budget_hours(date=nil)
|
||||||
|
|||||||
@@ -20,13 +20,6 @@ class FixedDeliverable < Deliverable
|
|||||||
total
|
total
|
||||||
end
|
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
|
# The amount of money remaining after expenses have been taken out
|
||||||
# Profit left = Total - Labor spent - Overhead spent - Fixed - Markup
|
# Profit left = Total - Labor spent - Overhead spent - Fixed - Markup
|
||||||
def profit_left(date=nil)
|
def profit_left(date=nil)
|
||||||
|
|||||||
@@ -50,13 +50,6 @@ class HourlyDeliverable < Deliverable
|
|||||||
write_attribute(:total, nil)
|
write_attribute(:total, nil)
|
||||||
end
|
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
|
# The amount of money remaining after expenses have been taken out
|
||||||
# Profit left = Total - Labor spent - Overhead spent - Fixed - Markup
|
# Profit left = Total - Labor spent - Overhead spent - Fixed - Markup
|
||||||
def profit_left(date=nil)
|
def profit_left(date=nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user