2011-12-02 22:46:43 +04:00
|
|
|
<% @report.hours.collect {|h| h[criterias[level]].to_s}.uniq.each do |value| %>
|
2008-02-27 23:50:19 +03:00
|
|
|
<% hours_for_value = select_hours(hours, criterias[level], value) -%>
|
|
|
|
<% next if hours_for_value.empty? -%>
|
2011-12-05 22:40:52 +04:00
|
|
|
<tr class="<%= cycle('odd', 'even') %> <%= criterias.length > level+1 ? 'subtotal' : 'last-level' %>">
|
2007-06-24 20:07:06 +04:00
|
|
|
<%= '<td></td>' * level %>
|
2011-12-02 22:46:43 +04:00
|
|
|
<td><%= h(format_criteria_value(@report.available_criteria[criterias[level]], value)) %></td>
|
2008-02-27 23:50:19 +03:00
|
|
|
<%= '<td></td>' * (criterias.length - level - 1) -%>
|
2008-04-05 20:40:26 +04:00
|
|
|
<% total = 0 -%>
|
2011-12-02 22:46:43 +04:00
|
|
|
<% @report.periods.each do |period| -%>
|
|
|
|
<% sum = sum_hours(select_hours(hours_for_value, @report.columns, period.to_s)); total += sum -%>
|
2008-02-27 23:50:19 +03:00
|
|
|
<td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td>
|
|
|
|
<% end -%>
|
2008-04-05 20:40:26 +04:00
|
|
|
<td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td>
|
2007-06-24 20:07:06 +04:00
|
|
|
</tr>
|
2008-02-27 23:50:19 +03:00
|
|
|
<% if criterias.length > level+1 -%>
|
2007-06-24 20:07:06 +04:00
|
|
|
<%= render(:partial => 'report_criteria', :locals => {:criterias => criterias, :hours => hours_for_value, :level => (level + 1)}) %>
|
2008-02-27 23:50:19 +03:00
|
|
|
<% end -%>
|
2007-06-24 20:07:06 +04:00
|
|
|
|
|
|
|
<% end %>
|