[#4477] Scope fixed budget items by period too (for Retainers)
This commit is contained in:
@@ -15,6 +15,14 @@ class FixedBudget < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
named_scope :by_period, lambda {|date|
|
||||
if date
|
||||
{
|
||||
:conditions => {:year => date.year, :month => date.month}
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
def markup_value
|
||||
return 0 if budget.blank? || markup.blank?
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<td> TODO: Release 2 / TODO hrs </td>
|
||||
</tr>
|
||||
|
||||
<% deliverable.fixed_budgets.each do |fixed_budget| %>
|
||||
<% deliverable.fixed_budgets.by_period(period).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>
|
||||
|
||||
Reference in New Issue
Block a user