<% content_for :head do %> <%= javascript_include_tag 'jquery.dataTables' %> <%= stylesheet_link_tag "DataTables", :media => "all" %> <%= javascript_include_tag "table2CSV"%> <% end %>

Отчет

<%=render(:partial => "filters_stats") %> <% sum = 0; %> <% @d_employees.each do |e| %> <% c = 0 %> <% end %>
Сотрудник Количество отчетов Количество смен Стоимость смены За смены (руб.) По отчетам за работы (руб.) В том числе:
Бонус за закрытые заявки (руб.)
Бригадирские Итого
<%=e.nic%> <%=n e.de_count.to_i%> <%=n e.shifts.to_i%> <%=n e.oklad.to_f.round %>
(<%= (e.oklad.to_f / @working_days).round %> в день)
<%=n c=((e.oklad.to_f / @working_days).round * e.shifts.to_i) %> <%=n e.sum.to_f.round()%> <%=n e.bonus.to_f.round()%> <%=n @br=(@payrolls.select{|i| i.employee_id == e.empl_id}.sum{|i| i.sum})%> <%=n (e.sum.to_f + c + @br.to_f).round() %>
Итого: <%=n @reports.size %> <%=n @d_employees.sum{|i| i.shifts.to_i} %> <%=n @d_employees.first.oklad%> <%=n cc=@d_employees.sum{|e| ((e.oklad.to_f / @working_days).round * e.shifts.to_i)}.round() %> <%=n r=@d_employees.sum{|i| i.sum.to_f}.round()%> <%=n @d_employees.sum{|i| i.bonus.to_f}.round() %> <%=n @payrolls.sum{|i| i.sum} %> <%=n b=@d_employees.sum{|i| i.sum.to_f}.round() + cc.to_f.round() + @br%>