Implemented more of the Deliverable calculations

* Added deliverable.score
* Added fixed_deliverable.score as 0
* Added deliverable.budget_ratio

  #1136
This commit is contained in:
Eric Davis
2008-05-23 16:38:27 -07:00
parent 9e743932d1
commit 1637e5cdd1
4 changed files with 38 additions and 3 deletions
+5 -1
View File
@@ -7,7 +7,7 @@ class Deliverable < ActiveRecord::Base
# TODO: mocked
def score
0
return self.progress - self.budget_ratio
end
# TODO: mocked
@@ -29,6 +29,10 @@ class Deliverable < ActiveRecord::Base
return (balance / total).round
end
def budget_ratio
return ((self.spent / self.budget) * 100).round
end
#
# These attributes can take a Dollar amount or a %
#
+5
View File
@@ -1,3 +1,8 @@
class FixedDeliverable < Deliverable
unloadable
# Fixed rate bids should always have a budget score of 0. This is because the budget is managed by the contractor.
def score
0
end
end