_report_criteria.html.erb
19 lines
| 983 B
| text/plain
|
TextLexer
|
r7906 | <% @report.hours.collect {|h| h[criterias[level]].to_s}.uniq.each do |value| %> | ||
|
r1162 | <% hours_for_value = select_hours(hours, criterias[level], value) -%> | ||
<% next if hours_for_value.empty? -%> | ||||
|
r7974 | <tr class="<%= cycle('odd', 'even') %> <%= criterias.length > level+1 ? 'subtotal' : 'last-level' %>"> | ||
|
r569 | <%= '<td></td>' * level %> | ||
|
r7906 | <td><%= h(format_criteria_value(@report.available_criteria[criterias[level]], value)) %></td> | ||
|
r1162 | <%= '<td></td>' * (criterias.length - level - 1) -%> | ||
|
r1311 | <% total = 0 -%> | ||
|
r7906 | <% @report.periods.each do |period| -%> | ||
<% sum = sum_hours(select_hours(hours_for_value, @report.columns, period.to_s)); total += sum -%> | ||||
|
r1162 | <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td> | ||
<% end -%> | ||||
|
r1311 | <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td> | ||
|
r569 | </tr> | ||
|
r1162 | <% if criterias.length > level+1 -%> | ||
|
r569 | <%= render(:partial => 'report_criteria', :locals => {:criterias => criterias, :hours => hours_for_value, :level => (level + 1)}) %> | ||
|
r1162 | <% end -%> | ||
|
r569 | |||
<% end %> | ||||