= javascript_include_tag 'patrimonio/recebimentos_de_bens/form' .alert.alert-warning[role="alert" id="alert-content" style="display: none;"] span#alert-message = simple_form_for(@recebimento_de_bem) do |f| = f.error_notification = f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? fieldset legend strong = @recebimento_de_bem.new_record? ? 'Cadastrar' : 'Editar' ' Registro de Bem .form-inputs .row .col-sm-2 = f.input :data_do_recebimento, label: 'Data do Registro', as: :string, wrapper: :calendar_field, input_html: { class: 's2', autocomplete: "off" } - if @recebimento_de_bem.recebimento_de_material.present? .col-sm-3 = f.input :classificacao, label: 'Classificação', collection: Patrimonio::RecebimentoDeBem.classificacoes_i18n, disabled: true .col-sm-3 = f.input :sub_elemento_de_despesa_id, label: 'Detalhamento', collection: @sub_elementos_de_despesa_permanente, label_method: :codigo_formatado_e_descricao, disabled: true .col-sm-3 = f.input :unidade_orcamentaria_id, label: 'Unidade Orçamentária', collection: @unidades_orcamentarias, label_method: :codigo_e_nome_e_exercicio, disabled: true - else .col-sm-3 = f.input :classificacao, label: 'Classificação', collection: Patrimonio::RecebimentoDeBem.classificacoes_i18n, include_blank: 'Selecione...', input_html: { class: 'form-control s2', id: 'classificacao' } .col-sm-3 = f.input :sub_elemento_de_despesa_id, label: 'Detalhamento', collection: @sub_elementos_de_despesa_permanente, label_method: :codigo_formatado_e_descricao, include_blank: 'Selecione...', input_html: { class: 'form-control s2'} .col-sm-3 = f.input :unidade_orcamentaria_id, label: 'Unidade Orçamentária', collection: @unidades_orcamentarias, label_method: :codigo_e_nome_e_exercicio, include_blank: 'Selecione...', input_html: { class: 'form-control s2'} .row .col-sm-3 = f.input :numero_da_nota, label: 'Nº da Nota' .col-sm-3 = f.input :serie, label: 'Série' .col-sm-2 = f.input :data_de_emissao, label: 'Data da Emissão', as: :string, wrapper: :calendar_field, input_html: { class: 's2', autocomplete: "off" } .div id="section_fornecedor" style="display: none;" legend strong ' Dados do Fornecedor .form-group .row .col-sm-8 label Fornecedor = popup_pesquisa_pessoa_com_id_button id: "busca_fornecedor", module: "patrimonio_recebimento_de_bem", field: "fornecedor_id", url: pesquisa_base_pessoas_path, show_value: @recebimento_de_bem.fornecedor.try(:cpf_ou_cnpj_e_nome), hidden_value: @recebimento_de_bem.fornecedor_id, title: "Pesquisar Fornecedor" = error_for @recebimento_de_bem, :fornecedor_id .div id="section_doador" style="display: none;" legend strong ' Dados do Doador .form-group .row .col-sm-8 label Doador = popup_pesquisa_pessoa_com_id_button id: "busca_doador", module: "patrimonio_recebimento_de_bem", field: "doador_id", url: pesquisa_base_pessoas_path, show_value: @recebimento_de_bem.doador.try(:cpf_ou_cnpj_e_nome), hidden_value: @recebimento_de_bem.doador_id, title: "Pesquisar Doador" = error_for @recebimento_de_bem, :doador_id .form-group .row .col-sm-12 = f.input :observacao, label: 'Observação', as: :text, input_html: { rows: '5' } .form-actions .row .col-sm-12 - if @recebimento_de_bem.new_record? = f.submit 'Salvar e ir para itens', class: "btn btn-success" = link_to "Cancelar", patrimonio_recebimentos_de_bens_path, class: "btn btn-default" - else = f.submit "Salvar", class: "btn btn-primary" = link_to "Cancelar", patrimonio_recebimentos_de_bens_path, class: "btn btn-default" = popup_pesquisa_pessoa title: "Pesquisa Pessoa"