<% content_for :head do %> <%= stylesheet_link_tag "materialsTable" , :media => "all"%> <%= javascript_include_tag 'jrails.autocomplete', 'jquery.suggest' %> <%= javascript_include_tag 'jquery.validate', 'messages_ru', 'new_soft' %> <%= javascript_include_tag "jquery.meio.mask.min" %> <%= stylesheet_link_tag "messages" , :media => "all"%> <%= stylesheet_link_tag "index" , :media => "all"%> <%= stylesheet_link_tag "jquery.ui.theme" , :media => "all"%> <% end -%> <% form_for @report, :url => {:action => 'update'}, :html =>{:autocomplete => "off"} do |f| -%> <%= f.hidden_field :id %> <%= f.hidden_field :tracker_id %> <%= hidden_field_tag :f_name, 'Софтовая группа' %>
.

Основная информация

<% if @boss || @disp || @disp_fast %> <% else %> <% end %> <% if @boss || @disp || @disp_fast %> <% end %>
Категория: <%= f.select(:category, Category.soft.collect{ |c| [c.name, c.id]}, {}, :onchange => remote_function(:url => {:controller => 'soft', :action => 'change_price'}, :with => "'type=' + $(this).val() + '&price=' + $('#report_client_price_type').val() + '&id='+#{@report.id}", :method => :get)) %>
Введите ник или ФИО сотрудника: <%= f.text_field :nick, :id => "nick", :size => 20 %>
Наименование плательщика: <%= f.text_field :pay_name %>
ИНН: <%= f.text_field :inn, :class =>"number" %>
Дата: <%= calendar_field_tag "date", @report.date.to_time, {:name => 'report[date]', :class =>"required date_r", :alt => "d_r", :readonly => false, :change_materials => true} %>
Время: C: <%= f.text_field :time_start, :alt =>"time", :class => "required time", :style => "width:50px"%> По: <%= f.text_field :time_stop, :alt =>"time", :class => "required time", :style => "width:50px"%>
Диагноз из списка: <%= f.select(:diagnosis, Report.diagnos, {:include_blank => true}) %>
Тип клиента: <%= f.select(:client_type, Report.client_types, {}, :onchange => "getSum(); show_hide_req_button()") %>
Нал/Безнал: <%= f.radio_button :money_type, 0, :class => 'money_type', :onchange => "getSum()" %> Без денег
<%= f.radio_button :money_type, 2, :class => 'money_type', :onchange => "getSum()" %> Наличный расчет
<%= f.radio_button :money_type, 10, :class => 'money_type', :onchange => "getSum()" %> Безналичный расчет
<%= f.radio_button :money_type, 6, :class => 'money_type', :onchange => "getSum()" %> Онлайн касса
<%= f.radio_button :money_type, 11, :class => 'money_type', :onchange => "getSum()" %> Договор подряда
Оплачено: <%= @report.finn_money %>
Коммент. к оплате: <%= f.text_area :com_buh, :style =>"width: 317px; height: 53px;" %>
Документы: <%= f.select(:get_docs, Report.soft_get_docs) %>
Прайс клиента: <%= f.select :client_price_type, Report.price_types,{}, :onchange => remote_function(:url => {:controller => 'soft', :action => 'change_price'}, :with => "'price=' + $(this).val() + '&type=' + $('#report_category').val() + '&id='+#{@report.id}", :method => :get) %>
Тип заявки: <%= f.select(:weld, [["Обычная", 0], ["СГ-Фаст", 1]], {}, {:id => "weld"}) -%>
Статус:<%= f.select(:status, status_s(@current_user)) -%> <%= @report.status_name -%>
Статья движения средств: <%= f.select(:payment_detail, PaymentDetail.all, :include_blank => "Выберите статью") -%>
<%= render :partial => 'sum', :locals => {:report => @report} %>
.

Рабочая группа

<% for employee in @report.done_employees do %> <% f.fields_for :done_employees, employee do |e| -%> <%= render :partial => 'employee', :locals => {:employee => employee, :e => e} %> <% end -%> <% end -%>
СотрудникСумма <%= hidden_field_tag "all_hand", 1, :class => "required", :min =>1, :max=>1 %>
<%= link_to_add_fields "Добавить сотрудника", f, :done_employees %>

Работы / Материалы

<%= render :partial => "pricelist", :collection => @pricelist, :locals =>{:done_works => @report.done_works} %>

Нестандартная работа
<%= f.text_area :com_conflicts, :rows => 5, :style=> 'width: 400px;' %> <%= f.text_field :get_money_sum, :size => 5, :onchange => "getSum()" %>
<%= render :partial =>"/shared/done_materials", :locals => {:done_materials => @report.done_materials, :f => f}%>
<%= (link_to "Обновить закупочные цены", update_purchase_price_soft_path(@report.id), :method => :post) if @report.done_materials.size > 0%>
<% if @boss || @disp || @disp_fast || @report.status == 0 -%> <% for d_empl in @report.done_employees %> <%= render :partial =>"/shared/materials", :locals => {:employee => d_empl.employee, :category => @report.category}%> <% end %>
<% end %> <%= render :partial =>"/problems/problem.html.erb", :locals =>{:f => f} %>
Общий комментарий
<%= f.text_area :com_stay_work, :rows => 8, :style=> 'width: 500px;' %>



<% if @boss || @disp || @disp_fast || @report.status == 0 %> <%= f.submit 'Сохранить', :class => "controlButton" %> <% end %> <% end %> <%= render :partial => 'itog', :locals => {:report => @report} %>
<%= button_to 'Лог редактирования', audit_path(@report.id), :method => :get -%>
<% if @boss || @disp || @disp_fast || @report.status.to_i == 0 -%> <%= button_to 'Удалить', soft_path(@report), :method => :delete, :confirm => "Вы уверены?" -%> <% end -%>