se agrega el modulo de powerbi.py para enviar el primer printscreen del dashboard de Power Bi

This commit is contained in:
GEORGE committed 2026-05-28 16:13:04 -05:00
1 parent 9ceeee0be1
commit e31f2676a3
7 files changed
+45 -110

No files matched your search

+10 -2
View File
@@ -4,6 +4,7 @@ import clr
from datetime import datetime, timedelta, timezone
from pathlib import Path
import logger_utilities
import powerbi
# Importar configuración y utilidades personalizadas
from outlook import get_access_token, send_email
@@ -144,13 +145,18 @@ def main():
# 4. Generación de Reportes
rpt_file = "venta_presupuesto_linea.rpt"
adjuntos = []
# REPORTE DE POWER BI: Dashboard de Power BI
output_path = output_dir / f"dashboard_powerbi_{dt_previous_business_day.ToString('dd_MM_yyyy')}.png"
powerbi.get_default_page_title(output_path)
adjuntos.append(str(output_path))
# REPORTE 1: Venta del día de ayer
# REPORTE 2: Venta del día de ayer
pdf_yesterday = output_dir / f"venta_presupuesto_linea_{dt_previous_business_day.ToString('dd_MM_yyyy')}.pdf"
if ejecutar_reporte(rpt_file, pdf_yesterday, {"FecIni": dt_previous_business_day, "FecFin": dt_previous_business_day}):
adjuntos.append(str(pdf_yesterday))
# REPORTE 2: Acumulado del mes actual (MTD)
# REPORTE 3: Acumulado del mes actual (MTD)
pdf_mtd = output_dir / f"venta_presupuesto_linea_{dt_month_start.ToString('dd_MM_yyyy')}_al_{dt_previous_business_day.ToString('dd_MM_yyyy')}.pdf"
if ejecutar_reporte(rpt_file, pdf_mtd, {"FecIni": dt_month_start, "FecFin": dt_previous_business_day}):
adjuntos.append(str(pdf_mtd))
@@ -215,3 +221,5 @@ if __name__ == "__main__":
print("="*60)
except Exception as e:
print(f"FATAL MAIN ERROR: {e}")
########################################################