Added labor_budget virtual field and made that the Budget column. #1190
This commit is contained in:
1 parent
e691f4c2f0
commit
6c6f756de8
4 files changed
+17
-2
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user