[#4420] Use empty budgets for Retainers that are missing them so they appear on the form.

This commit is contained in:
Eric Davis
2010-09-01 19:28:18 -07:00
parent abc4d30346
commit dfab7b5714
2 changed files with 62 additions and 2 deletions
+6 -2
View File
@@ -58,11 +58,15 @@ class RetainerDeliverable < HourlyDeliverable
end
def labor_budgets_for_date(date)
labor_budgets.all(:conditions => {:year => date.year, :month => date.month})
budgets = labor_budgets.all(:conditions => {:year => date.year, :month => date.month})
budgets = [labor_budgets.build(:year => date.year, :month => date.month)] if budgets.empty?
budgets
end
def overhead_budgets_for_date(date)
overhead_budgets.all(:conditions => {:year => date.year, :month => date.month})
budgets = overhead_budgets.all(:conditions => {:year => date.year, :month => date.month})
budgets = [overhead_budgets.build(:year => date.year, :month => date.month)] if budgets.empty?
budgets
end
def create_budgets_for_periods