% content_for :head do %>
<%= javascript_include_tag "table2CSV" , :media => "all"%>
<% end %>
<% form_tag pricelist_index_path(), :method =>:get do -%>
<%= select_tag :section_id, options_for_select(@sections.collect{ |c| [c.name, c.id]}.sort.insert(0, ['--- Все ---', ""]), params[:section_id].to_i)%>
<%= select_tag :active_hidden, options_for_select([['--- Все работы ---', ""], ['Только активные', "N"], ['Скрытые', "Y"]], params[:active_hidden])%>
<%= select_tag(:legal_entity_id, options_for_select(LegalEntity.all.map{|c| [c.name, c.id]}.insert(0, ['--- Юр. лицо ---', ""]), params[:legal_entity_id].to_i)) %>
<%= select_tag("category", options_for_select(Category.find(:all, :order =>"department").map{|i| [i.name, i.id]}.insert(0, ['--- Категория ---', ""]), params[:category].to_i)) %>
<%= submit_tag "Выбрать"%>
<% end -%>
| № |
Наименование |
Подразделение |
Тип клиента |
Юр. лицо |
Ед. измерения |
Стоимость для клиента |
З/П мастера |
Сортировка |
Отображать |
<% sec_id = ''%>
<% for item in @pl_items do %>
<% if item.section_id != sec_id %>
| <%= link_to item.section_name, edit_section_path(:id => item.section_id) if item.section_id%> |
<% sec_id = item.section_id%>
<% end -%>
| <%= item.id %> |
<%= link_to item.name, edit_pricelist_path(item, :section_id => params[:section_id], :active_hidden => params[:active_hidden]) %> |
<%= item.pricelist_divisions.map{|i| i.division.name if i.division}.join(", ")%> |
<%= item.client_type_name%> |
<%= item.legal_entity_code %> |
<%= item.measure.name if item.measure%> |
<%= item.price %> |
<%= item.rate.to_i > 0? item.rate : item.price.to_f / 2 %> |
<%= item.ordered %> |
<%= item.is_display? %> |
<% end %>