.widget header h5 ' Lista de span.fw-semi-bold Empenhos enviados para Contabilidade .widget-body - if @empenhos.empty? h6 Nenhum registro encontrado. - else .table-responsive.font-small table.table.table-hover thead tr th Número th Exercício th Modalidade th Proj/Ativ th Fornecedor th UO th Fonte th width="80" Valor th Receber? th - unless logado_na_licitacao? th width="40" tbody - @empenhos.each do |empenho| tr td style="font-weight: 600" = empenho.numero_do_empenho td.center = empenho.orcamento.exercicio td.center =< modalidade_label empenho.localizar(:modalidade), empenho.modalidade td.center = empenho.try(:orcamento_da_despesa).try(:elemento_de_despesa_por_subacao).try(:subacao).try(:acao).try(:codigo_completo) td = empenho.try(:pessoa).try(:nome_e_cpf_ou_cnpj) td = empenho.unidade_orcamentaria.try(:sigla) td.center span.fa.fa-question-circle data-toggle="tooltip" data-placement="bottom" title="#{empenho.orcamento_da_despesa.codigo_e_descricao_fonte}" td = empenho.definir_valor_do_empenho.to_f.real_contabil td.text-center .btn.btn-default.btn-sm.mb-xs.marcador_de_recebimento id="marcador_#{empenho.id}" i.fa.fa-square-o id="caixa_#{empenho.id}" - if empenho.possui_anulacoes_confirmadas? td.center span.label.label-danger data-toggle="tooltip" data-placement="bottom" title="Empenho possui um valor de #{empenho.valor_anulado.real_contabil} em anulações confirmadas" A - else td - unless logado_na_licitacao? td = link_to empenho_path(empenho), class: "btn btn-default btn-sm mb-xs", title: "Ver Detalhes" do i.icone-detalhar - if session[:modulo] == 'administrativo' && empenho.solicitado? = botao_com_permissao edit_empenho_path(empenho), {acao: :update}, { \ class_icone:'icone-editar', params: {class: 'btn btn-default btn-sm mb-xs', title: "Editar"}, } = botao_com_permissao empenho_path(empenho), {acao: :destroy}, { \ class_icone:'icone-excluir', params: { \ method: :delete, data: { confirm: 'Tem certeza?' }, class: 'btn btn-default btn-sm mb-xs', title: "Excluir", }, } - unless @empenhos.empty? = form_with(model: @modelo_empenho, url: empenho_receber_multiplos_empenhos_path, method: "post") do |f| - @empenhos.each do |empenho| = f.hidden_field empenho.id, value: 0, id: "empenho_#{empenho.id}" .btn.btn-primary.btn-sm#selecionar_todos | Selecionar Todos =< submit_tag "Receber selecionados", class: "btn btn-success btn-sm", id: "receber_selecionados" br = will_paginate @empenhos, previous_label: "<", next_label: ">" javascript: $(function() { selecionador = 0; $( ".marcador_de_recebimento" ).each(function() { $( this ).on("click", function() { var id = $( this ).attr('id').split("marcador_"); id = id[1]; if( $("#empenho_"+id).val().localeCompare("1") == 0 ){ $("#empenho_"+id).val("0"); $("#caixa_"+id).removeClass("fa-check-square-o"); $("#caixa_"+id).addClass("fa-square-o"); } else { $("#empenho_"+id).val("1"); $("#caixa_"+id).removeClass("fa-square-o"); $("#caixa_"+id).addClass("fa-check-square-o"); } }); }); $("#selecionar_todos").on("click", function(){ if(selecionador == 0){ selecionador = 1; } else { selecionador = 0; } $( ".marcador_de_recebimento" ).each(function() { var id = $( this ).attr('id').split("marcador_"); id = id[1]; if( $("#caixa_"+id).hasClass("fa-square-o") == true && selecionador == 1){ $("#caixa_"+id).removeClass("fa-square-o"); $("#caixa_"+id).addClass("fa-check-square-o"); $("#empenho_"+id).val("1"); } else if($("#caixa_"+id).hasClass("fa-check-square-o") == true && selecionador == 0){ $("#caixa_"+id).removeClass("fa-check-square-o"); $("#caixa_"+id).addClass("fa-square-o"); $("#empenho_"+id).val("0"); } }); }); });