@@ -1,17 +1,17 | |||||
1 | <% @available_criterias[criterias[level]][:values].each do |value| %> |
|
1 | <% @available_criterias[criterias[level]][:values].each do |value| %> | |
2 | <tr class="<%= cycle('odd', 'even') if criterias.length < level + 2 %>"> |
|
2 | <tr class="<%= cycle('odd', 'even') if criterias.length < level + 2 %>"> | |
3 | <%= '<td></td>' * level %> |
|
3 | <%= '<td></td>' * level %> | |
4 | <td><%= value.name %></td> |
|
4 | <td><%= value.name %></td> | |
5 | <%= '<td></td>' * (criterias.length - level - 1) %> |
|
5 | <%= '<td></td>' * (criterias.length - level - 1) %> | |
6 | <% hours_for_value = select_hours(hours, criterias[level], value.id) %> |
|
6 | <% hours_for_value = select_hours(hours, criterias[level], value.id) %> | |
7 | <% @periods.each do |period| %> |
|
7 | <% @periods.each do |period| %> | |
8 | <% sum = sum_hours(select_hours(hours_for_value, @columns, period.to_s)) %> |
|
8 | <% sum = sum_hours(select_hours(hours_for_value, @columns, period.to_s)) %> | |
9 | <td align="center"><%= sum > 0 ? sum : "-" %></td> |
|
9 | <td align="center"><%= sum > 0 ? "%.2f" % sum : "-" %></td> | |
10 | <% end %> |
|
10 | <% end %> | |
11 | </tr> |
|
11 | </tr> | |
12 | <% if criterias.length > level+1 %> |
|
12 | <% if criterias.length > level+1 %> | |
13 | <%= render(:partial => 'report_criteria', :locals => {:criterias => criterias, :hours => hours_for_value, :level => (level + 1)}) %> |
|
13 | <%= render(:partial => 'report_criteria', :locals => {:criterias => criterias, :hours => hours_for_value, :level => (level + 1)}) %> | |
14 | <% end %> |
|
14 | <% end %> | |
15 |
|
15 | |||
16 | <% end %> |
|
16 | <% end %> | |
17 | <% reset_cycle %> |
|
17 | <% reset_cycle %> |
General Comments 0
You need to be logged in to leave comments.
Login now