- if @consumo.pode_editar? div style="margin: 20px !important" = link_to gestao_de_estoque_editar_itens_do_consumo_path(@consumo), class: "btn btn-default btn-sm" do i.icone-cadastrar ' Adicionar/Remover Itens .widget header> h5 ' Lista de span.fw-semi-bold - if logado_no_administrativo? span.active ' Itens da Req. de Materiais - else span.active ' Itens do Consumo .widget-body - if @consumo.itens_do_consumo.empty? h6 Nenhum registro encontrado. - else - if @consumo.separa_itens_por_setor - @consumo.itens_do_consumo.each do |item| .table-responsive style="overflow-y: auto; height: auto;" table.table.table-hover.table-bordered thead tr th Item th.text-center style="width: 10%" Unid. de medida th.text-center style="width: 10%" Quantidade Disponível th.text-center style="width: 10%" Quantidade Solicitada tbody tr td = item.try(:item).try(:codigo_e_descricao) td.text-center = item.try(:item).try(:unidade_de_medida).try(:descricao) td.text-center = item.saldo_atual_do_item.to_f.valor_contabil(minimum_precision: 4) td.text-center = item.try(:quantidade_consumida).to_f.valor_contabil(minimum_precision: 4) thead tr th colspan='3' Setor th.text-center style="width: 10%" Quantidade tbody - @consumo.itens_do_consumo.sum(&:setores).select{ |setor| setor.item_do_consumo_id == item.id }.each do |setor| tr td colspan='3' = setor.try(:nome) td.text-center = setor.try(:quantidade).to_f.valor_contabil(minimum_precision: 4) - else .table-responsive style="overflow-y: auto; height: 500px;" table.table.table-hover.table-bordered thead tr th Item th.text-center style="width: 10%" Unid. de medida th.text-center style="width: 10%" Quantidade Disponível th.text-center style="width: 10%" Quantidade Solicitada tbody - itens_do_consumo.each do |item_do_consumo| tr td = item_do_consumo.try(:item).try(:codigo_e_descricao) td.text-center = item_do_consumo.try(:item).try(:unidade_de_medida).try(:descricao) td.text-center = item_do_consumo.saldo_atual_do_item.to_f.valor_contabil(minimum_precision: 4) td.text-center = item_do_consumo.try(:quantidade_consumida).to_f.valor_contabil(minimum_precision: 4)