[#4477] Scope fixed budget items by period too (for Retainers)
This commit is contained in:
1 parent
67dd75a980
commit
d78e7b1dc3
2 files changed
+9
-1
No files matched your search
@@ -15,6 +15,14 @@ class FixedBudget < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
named_scope :by_period, lambda {|date|
|
||||||
|
if date
|
||||||
|
{
|
||||||
|
:conditions => {:year => date.year, :month => date.month}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
def markup_value
|
def markup_value
|
||||||
return 0 if budget.blank? || markup.blank?
|
return 0 if budget.blank? || markup.blank?
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<td> TODO: Release 2 / TODO hrs </td>
|
<td> TODO: Release 2 / TODO hrs </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% deliverable.fixed_budgets.each do |fixed_budget| %>
|
<% deliverable.fixed_budgets.by_period(period).each do |fixed_budget| %>
|
||||||
<% next if fixed_budget.blank_record? %>
|
<% next if fixed_budget.blank_record? %>
|
||||||
<tr id="fixed_budget_<%= fixed_budget.id %>">
|
<tr id="fixed_budget_<%= fixed_budget.id %>">
|
||||||
<td class="l fixed_title"><%= h(fixed_budget.title) %></td>
|
<td class="l fixed_title"><%= h(fixed_budget.title) %></td>
|
||||||
|
|||||||
Reference in new issue
Block a user