Modificação da Planilha baixarda para ficar 1 para 1
This commit is contained in:
@@ -74,13 +74,12 @@ class OperacoesDashboardController < ApplicationController
|
||||
end
|
||||
|
||||
planilha = Analytics::PlanilhaEntregas.new(tabela)
|
||||
linhas = planilha.linhas
|
||||
if linhas.empty?
|
||||
if planilha.linhas.empty?
|
||||
return redirect_to(operacoes_planilha_path(operacao: tabela),
|
||||
alert: "A operação #{planilha.label} não tem registros.")
|
||||
end
|
||||
|
||||
send_data Analytics::PlanilhaEntregasXlsx.new(linhas).gerar,
|
||||
send_data Analytics::PlanilhaEntregasXlsx.new(planilha).gerar,
|
||||
filename: "Entregas #{planilha.label} #{Date.current.strftime('%m.%Y')}.xlsx",
|
||||
type: XLSX_MIME,
|
||||
disposition: 'attachment'
|
||||
|
||||
Reference in New Issue
Block a user