% @outputs.each do |output| %>
<% output.output_products.each.with_index do |output_product, index| %>
<% if index == 0 %>
<%= best_in_place output, :date, :as => :date %> |
<%= best_in_place output, :employee_id, :as => :select, :collection => Employee.all.map {|i| [i.id, i.fio]} %> |
<%= best_in_place output.employee, :base_pay %> |
<% end %>
<%= best_in_place output_product.product, :id, :as => :select, :collection => Product.all.map {|i| [i.id, i.title]} %>
|
<%= best_in_place output_product.product.machine_output, :id, :as => :select, :collection => MachineOutput.all.map {|i| [i.id, i.prod]} %>
|
<%= best_in_place output_product, :work_time %>
|
<%= best_in_place output_product, :output_amount %>
|
<%= plan = output_product.product.machine_output.production / 12 * output_product.work_time %>
|
<%= output_product.output_amount * 100 / plan %>
|
<% if index == 0 %>
<%= output.salary %>
|
<% if current_user.has_role? :admin %>
<%= link_to image_tag('edit.png', size: "24x24", alt: "Редактировать"), edit_output_path(output), remote: true %>
|
<%= link_to image_tag('close.svg', size: "24x24", alt: "Удалить"), output, remote: true, method: :delete, data: { confirm: 'Are you sure?' } %>
|
<% end %>
<% end %>
<% end %>
<% end %>