[#4420] Use empty budgets for Retainers that are missing them so they appear on the form.
This commit is contained in:
1 parent
abc4d30346
commit
dfab7b5714
2 files changed
+62
-2
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user