Modificação da Planilha baixarda para ficar 1 para 1

This commit is contained in:
2026-07-13 18:43:16 -03:00
parent 1d4bed785d
commit 04efe871f0
3 changed files with 277 additions and 38 deletions

View File

@@ -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'