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:
@@ -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 %
|
||||
#
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user