[#4477] Skip blank FixedBudget items in the deliverable details

This commit is contained in:
Eric Davis
2010-09-17 14:23:29 -07:00
parent 55c9f93c6c
commit 67dd75a980
2 changed files with 8 additions and 1 deletions

View File

@@ -37,5 +37,11 @@ class FixedBudget < ActiveRecord::Base
def straight_markup?
markup && markup.match(/\$/)
end
# Is this a blank budget item. Retainers will create blank ones when
# they are copied. (RetainerDeliverable#create_budgets_for_periods)
def blank_record?
return true if new_record?
return title.blank? && budget.blank? && markup.blank?
end
end

View File

@@ -64,6 +64,7 @@
</tr>
<% deliverable.fixed_budgets.each do |fixed_budget| %>
<% next if fixed_budget.blank_record? %>
<tr id="fixed_budget_<%= fixed_budget.id %>">
<td class="l fixed_title"><%= h(fixed_budget.title) %></td>
<td class="fixed_budget_spent">0</td>