Added labor_budget virtual field and made that the Budget column. #1190

This commit is contained in:
Eric Davis committed 2008-06-09 15:31:57 -07:00
1 parent e691f4c2f0
commit 6c6f756de8
4 files changed
+17 -2

No files matched your search

+3
View File
@@ -117,6 +117,9 @@ class Deliverable < ActiveRecord::Base
end
end
def labor_budget
0
end
# Returns true if the deliverable can be edited by user, otherwise false
def editable_by?(user)
+5
View File
@@ -17,4 +17,9 @@ class FixedDeliverable < Deliverable
return (read_attribute(:profit_percent).to_f / 100.0) * read_attribute(:fixed_cost)
end
end
def labor_budget
return read_attribute(:fixed_cost)
end
end
+5
View File
@@ -30,5 +30,10 @@ class HourlyDeliverable < Deliverable
return (read_attribute(:profit_percent).to_f / 100.0) * (read_attribute(:cost_per_hour) * read_attribute(:total_hours))
end
end
def labor_budget
return read_attribute(:cost_per_hour).to_f * read_attribute(:total_hours).to_f
end
end