add a grouping table for single-group

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1630 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
t.felgentreff 14 years ago
parent 52991b8994
commit b0d0ac5f87
  1. 40
      app/views/cost_reports/_simple_cost_report_table.rhtml
  2. 3
      config/locales/de.yml
  3. 3
      config/locales/en.yml

@ -1 +1,39 @@
No groups selected for row or column. <%
list = @query.collect {|r| r.important_fields }.flatten.uniq
show_units = list.include? "cost_type_id"
%>
<table class="list">
<thead>
<% list.each do |field| %><th><%= label_for(field) %></th><% end %>
<th><%= label_for(:label_count) %></th>
<% if show_units %>
<th><%= label_for(:field_units) %></th>
<% end %>
<th><%= label_for(:label_sum) %></th>
</thead>
<tfoot>
<th colspan='<%= list.size + 3 %>'>
<%= show_result @query %>
</th>
</tfoot>
<tbody>
<% @query.each do |result| %>
<tr class='<%= cycle("odd", "even") %>'>
<td><%= show_row result %></td>
<td><%= result.count %></td>
<% if show_units %>
<td><%= show_result result, result.fields[:cost_type_id].to_i %></td>
<% end %>
<td><%= show_result result %></td>
</tr>
<% if params[:debug] %>
<tr>
<td colspan='<%= list.size + 3 %>'>
<%= result.fields.reject {|k,v| list.include? k.to_sym }.inspect %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>

@ -14,3 +14,6 @@ de:
label_money: "Geld" label_money: "Geld"
text_costs_are_rounded_note: "Die angezeigten Werte sind gerunded. Alle Berechnungen basieren auf ungerundete Werte." text_costs_are_rounded_note: "Die angezeigten Werte sind gerunded. Alle Berechnungen basieren auf ungerundete Werte."
label_count: Anzahl
label_sum: Summe

@ -13,3 +13,6 @@ en:
label_money: "Money" label_money: "Money"
text_costs_are_rounded_note: "Displayed values are rounded. All calculations are based on the non-rounded values." text_costs_are_rounded_note: "Displayed values are rounded. All calculations are based on the non-rounded values."
label_count: Count
label_sum: Sum
Loading…
Cancel
Save