<% content_for :head do %> <%= stylesheet_link_tag "materialsTable" , :media => "all"%> <%= javascript_include_tag 'jquery.validate', 'messages_ru', 'new_soft' %> <%= javascript_include_tag "jquery.meio.mask.min" %> <%= stylesheet_link_tag "index" , :media => "all"%> <% end -%> <% form_for @report, :url => {:action => 'create'}, :html =>{:autocomplete => "off"} do |f| -%> <%= f.hidden_field :trello_id %> <%= f.hidden_field :id %> <%= hidden_field_tag :f_name, 'Монтажные подряды' %>
.

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

<% for factor in Factor.all do %> <% end %> <% if @boss || @disp || @disp_fast %> <% else %> <% end %>
Категория: <%= f.select(:category, Category.construction.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"%>
<%= hidden_field_tag "report[report_factors_attributes][#{factor.id}][factor_id]", factor.id %> <%= hidden_field_tag "report[report_factors_attributes][#{factor.id}][id]", @factors.select{|i| i.factor_id == factor.id}.map{|i| i.id} %> <%= hidden_field_tag "report[report_factors_attributes][#{factor.id}][percent]", factor.percent %> <%= factor.name %>: <%= hidden_field_tag "report[report_factors_attributes][#{factor.id}][_destroy]", false %> <%= check_box_tag "report[report_factors_attributes][#{factor.id}][active]", true, checked = (@factors.select{|i| i.factor_id == factor.id}.size > 0), :onchange =>"if($(this).prop('checked') == true) { $(this).prev('input[type=hidden]').val('false');} else {$(this).prev('input[type=hidden]').val('1');}; getSum()" %>
Статус:<%= f.select(:status, status_s(@current_user)) -%> <%= @report.status_name -%> <%= f.hidden_field :status %>
<%#= 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 -%>
Сотрудник
<%= 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()" %>
<% for d_empl in @report.done_employees %> <%= render :partial =>"/shared/materials", :locals => {:employee => d_empl.employee, :category => @report.category}%> <% end %>
Общий комментарий
<%= f.text_area :com_stay_work, :rows => 8, :style=> 'width: 500px;' %>



<%= f.submit 'Сохранить', :onclick => validate_and_disable(), :id => "sbmt" %> <%= render :partial => 'itog', :locals => {:report => @report} %> <% end %>