fix: Corregir parámetros incorrectos en generación de PDF
- generar_reporte_diario() y generar_reporte_ejecutivo() esperan (ventas, stats) pero se estaba pasando (ventas, ranking, stats) - Esto causaba error "'list' object has no attribute 'get'" - También pasar vendedor al reporte diario cuando aplique Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1008,10 +1008,10 @@ def comando_reporte():
|
|||||||
}
|
}
|
||||||
|
|
||||||
if tipo == 'ejecutivo':
|
if tipo == 'ejecutivo':
|
||||||
pdf_content = generar_reporte_ejecutivo(ventas, ranking, stats)
|
pdf_content = generar_reporte_ejecutivo(ventas, stats)
|
||||||
filename = f"reporte_ejecutivo_{datetime.now(TZ_MEXICO).strftime('%Y%m%d')}.pdf"
|
filename = f"reporte_ejecutivo_{datetime.now(TZ_MEXICO).strftime('%Y%m%d')}.pdf"
|
||||||
else:
|
else:
|
||||||
pdf_content = generar_reporte_diario(ventas, ranking, stats)
|
pdf_content = generar_reporte_diario(ventas, stats)
|
||||||
filename = f"reporte_{tipo}_{datetime.now(TZ_MEXICO).strftime('%Y%m%d')}.pdf"
|
filename = f"reporte_{tipo}_{datetime.now(TZ_MEXICO).strftime('%Y%m%d')}.pdf"
|
||||||
|
|
||||||
# Subir PDF a Mattermost
|
# Subir PDF a Mattermost
|
||||||
@@ -1074,9 +1074,9 @@ def api_reports_generate():
|
|||||||
|
|
||||||
# Generar PDF
|
# Generar PDF
|
||||||
if tipo == 'executive':
|
if tipo == 'executive':
|
||||||
pdf_content = generar_reporte_ejecutivo(ventas, ranking, stats)
|
pdf_content = generar_reporte_ejecutivo(ventas, stats)
|
||||||
else:
|
else:
|
||||||
pdf_content = generar_reporte_diario(ventas, ranking, stats)
|
pdf_content = generar_reporte_diario(ventas, stats, vendedor)
|
||||||
|
|
||||||
# Guardar temporalmente y devolver ID
|
# Guardar temporalmente y devolver ID
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|||||||
Reference in New Issue
Block a user