[#4477] Added the amounts spent for FixedBudgets

This commit is contained in:
Eric Davis
2010-09-22 11:27:42 -07:00
parent d4de581b3c
commit 4a7484e1ea
9 changed files with 168 additions and 13 deletions
+10
View File
@@ -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