[#5442] Add contract totals for labor and overhead hours spent and budgeted

This commit is contained in:
Eric Davis
2011-02-17 11:30:40 -08:00
parent af0eecb6dc
commit a92559c133
4 changed files with 51 additions and 7 deletions
+26
View File
@@ -55,6 +55,19 @@ class Contract < ActiveRecord::Base
end
memoize :labor_spent
# OPTIMIZE: N+1
def labor_hour_budget
summarize_associated_values(deliverables, :labor_budget_hours)
end
memoize :labor_hour_budget
# OPTIMIZE: N+1
# OPTIMIZE: also hits redmine_overhead which is known to be slow
def labor_hour_spent
summarize_associated_values(deliverables, :labor_hours_spent_total)
end
memoize :labor_hour_spent
# OPTIMIZE: N+1
def overhead_budget
summarize_associated_values(deliverables, :overhead_budget_total)
@@ -68,6 +81,19 @@ class Contract < ActiveRecord::Base
end
memoize :overhead_spent
# OPTIMIZE: N+1
def overhead_hour_budget
summarize_associated_values(deliverables, :overhead_budget_hours)
end
memoize :overhead_hour_budget
# OPTIMIZE: N+1
# OPTIMIZE: also hits redmine_overhead which is known to be slow
def overhead_hour_spent
summarize_associated_values(deliverables, :overhead_hours_spent_total)
end
memoize :overhead_hour_spent
# OPTIMIZE: N+1
def estimated_hour_budget
summarize_associated_values(deliverables, :estimated_hour_budget_total)