<% content_for :head do %> <%= javascript_include_tag "table2CSV"%> <% end %> <% form_tag "" do %> <%= stylesheet_link_tag "filters" , :media => "all"%>
Категория работ: <%= select_tag(:filter_worktype, options_for_select(Category.construction.collect{ |c| [c.name, c.id]}.sort.insert(0, ['--- Все ---', ""]), params[:filter_worktype].to_i)) %> <% if @reports %> Статус: <%= select_tag(:filter_status, options_for_select(Report.statuss.insert(0, ['--- Все ---', 5]), params[:filter_status].nil? ? '' : params[:filter_status].to_i)) -%> <% end %> Сотрудник: <%= select_tag(:filter_empl, options_for_select(@employees.map{|i| [i.nic, i.id]}.insert(0, ['--- Все ---', '']), params[:filter_empl].to_i)) %> Месяц: <%= select_tag(:filter_month, options_for_select(Report.months, @date.month.to_i)) -%> Год: <%= select_tag(:filter_year, options_for_select((2010..Date.today.year+1).to_a, @date.year.to_i)) -%>    <%= button_to "Фильтр" %>

<%= Russian::strftime(@date, "%B %Y") %>
(рабочих дней: <%= @working_days %>)

<% all_oklad = 0 -%> <% @d_employees.sort_by{|i| i.nic.downcase}.each do |e| %> <% all_oklad += a %> <% end %>
Сотрудник Должность Оклад в месяц Стоимость смены Количество смен За смены/Оклад Количество отчетов По отчетам за работы (руб.) Итого
<%=e.nic%> <%=e.position_name%> <%=c=e.oklad%> <%=n_c e.shift_wage if e.static_sum != 1%> <%= e.shifts_size %> ><%=n_c a = (if e.static_sum == 1 then e.oklad else e.shift_wage.to_f * e.shifts_size end) %> <%=e.report_size.to_s%> <%=e.sum.to_f.round()%> <%=(e.sum.to_f + a.to_f).round()%>
Итого: <%=@d_employees.sum{|i| i.oklad.to_f}.round %> <%=@d_employees.sum{|i| i.shift_wage.to_f}.round %> <%=@d_employees.sum{|i| i.shifts_size.to_i}.round %> <%=all_oklad.round %> <%=@d_employees.sum{|i| i.report_size.to_i}.round %> <%=all_sum = @d_employees.sum{|i| i.sum.to_f}.round %> <%=(all_oklad.to_i + all_sum).round %>
<% end %>