From 31be887882d1f2ed5c64dbd29a869174aa446c6b Mon Sep 17 00:00:00 2001 From: Horux Dev Date: Sun, 24 May 2026 02:17:06 +0000 Subject: [PATCH] feat(conciliacion): metricas I+P-E para montos conciliado y pendiente --- apps/web/app/(dashboard)/conciliacion/page.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/app/(dashboard)/conciliacion/page.tsx b/apps/web/app/(dashboard)/conciliacion/page.tsx index 57734f8..ef5be3b 100644 --- a/apps/web/app/(dashboard)/conciliacion/page.tsx +++ b/apps/web/app/(dashboard)/conciliacion/page.tsx @@ -178,7 +178,11 @@ export default function ConciliacionPage() { }; // Score cards — tipo P usa monto_pago_mxn, otros usan total_mxn - const getMonto = (c: any) => Number(c.montoMxn || c.totalMxn || 0); + // I+P-E: Ingresos y Pagos suman, Egresos restan + const getMonto = (c: any) => { + const monto = Number(c.montoMxn || c.totalMxn || 0); + return c.tipoComprobante === 'E' ? -monto : monto; + }; const montoConciliado = conciliadas.reduce((s, c) => s + getMonto(c), 0); const montoPendiente = pendientes.reduce((s, c) => s + getMonto(c), 0);