<% cat = Category.find category %> <%= link_to_function(""+ employee.login, "show_hide(#{employee.id.to_s})") %> <%= (button_to_function "Снять материал с объекта сети", "materials_from_login("+employee.id.to_s+")") if cat && cat.demounting == true && cat.id != 97 %> <%= (button_to_function "Заменить материал на объекте сети", "materials_from_login_to_login("+employee.id.to_s+")") if cat && cat.change == true && cat.id != 97 %> <% if cat && cat.inst == true %> <% mats = employee.materials(@report_date) %> <% for material in mats do %> <%= hidden_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][material_id]", material[:id].strip %> <%= hidden_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][ens_code]", material[:ens_code] %> <%= hidden_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][employee_id]", employee.id %> <%= hidden_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][preowned]", (if material[:preowned].class.to_s == "Hash" then nil else material[:preowned] end) %> <%= hidden_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][employee_name]", employee.login %> <%= hidden_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][material_name]", material_name(material) %> <%= hidden_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][price_from_store]", material[:price] %> <%= hidden_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][purchase_price]", material[:purchase_price] %> <%= material_name(material) %>
<%= link_to_function "Копировать", "copy_string($(this).parents('tr'))" %> <%= preowned(material) %> <% if cat && cat.department == 'soft'%> <%= text_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][bonus_sale]", material[:bonus], :size => 4, :class => 'number bonus', :onchange => "getSum()" %>
Бонус
<% end %> <%= text_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][price]", material[:price], :size => 4, :class => 'number price', :onchange => "getSum()" %>
Цена (руб.)
<%= text_field_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][count]", nil, :size => 4, :class => 'number count', :max => material[:count], :onchange => "getSum()" %>
На руках: <%= material[:count]%>
<%= select_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][pay_type]", options_for_select(pay_types_for_category(cat), selected_pay_type(cat, material)), :onchange => "changePrice(this); getSum()", :class => "inst_type" %> <% if cat && cat.department == 'private'%> <%= check_box_tag "report[done_materials_attributes][#{material[:id].strip}_#{employee.id}_#{material[:preowned].to_s}][bonus_sale]", 1, false, :class => "bonus"%>
Продал я
<% end -%> <%= button_to_function '+', "setCountNew($(this), '1', 'plus')", :class => "b_plus" %> <%= button_to_function '-', "setCountNew($(this), '1', 'minus')", :class => "b_minus" %> <% end %> <% end %>