[#4477] Added the amounts spent for FixedBudgets
This commit is contained in:
@@ -23,6 +23,8 @@ class FixedBudget < ActiveRecord::Base
|
||||
end
|
||||
}
|
||||
|
||||
named_scope :paid, {:conditions => {:paid => true}}
|
||||
|
||||
def markup_value
|
||||
return 0 if budget.blank? || markup.blank?
|
||||
|
||||
@@ -38,6 +40,14 @@ class FixedBudget < ActiveRecord::Base
|
||||
|
||||
end
|
||||
|
||||
def budget_spent
|
||||
if paid?
|
||||
budget
|
||||
else
|
||||
0
|
||||
end
|
||||
end
|
||||
|
||||
def percent_markup?
|
||||
markup && markup.match(/%/)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user