From 8cbee48947d738dd5f932fdbabf1f64f57757312 Mon Sep 17 00:00:00 2001 From: Administrator Date: Thu, 10 Sep 2026 13:28:53 -0500 Subject: [PATCH] Actualizar frontend/src/pages/Rentabilidad.jsx --- frontend/src/pages/Rentabilidad.jsx | 39 +++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/frontend/src/pages/Rentabilidad.jsx b/frontend/src/pages/Rentabilidad.jsx index 2764294..f38a2f4 100644 --- a/frontend/src/pages/Rentabilidad.jsx +++ b/frontend/src/pages/Rentabilidad.jsx @@ -546,7 +546,9 @@ export default function Rentabilidad() { })} + onClick={()=>setModalVer({programa:f[0], + ventaIni:f[7], costoIni:f[8], mbIni:f[9], + ventaAct:f[10], costoAct:f[11], mbAct:f[12]})}>👁️ @@ -569,7 +571,7 @@ export default function Rentabilidad() { } - {modalVer && setModalVer(null)} />} + {modalVer && setModalVer(null)} />} {modalCostos && setModalCostos(null)} onGuardado={cargar} />} ); @@ -691,7 +693,7 @@ function MesesMulti({ label, meses, onChange }) { ); } -function ModalVerDetalle({ programa, ano, mes, onClose }) { +function ModalVerDetalle({ programa, ano, mes, resumen, onClose }) { const [filas, setFilas] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { @@ -702,23 +704,38 @@ function ModalVerDetalle({ programa, ano, mes, onClose }) { return ()=>{activo=false;}; }, [programa, ano, mes]); - const COLS_DET = ["VENDEDOR","ALUMNO","F. MATRÍCULA","F. CANCELACIÓN","TIPO","VALOR CUOTA","PROM. DESC. E.","VALOR VENTA"]; + const COLS_DET = ["VENDEDOR","ALUMNO","F. MATRÍCULA","F. CANCELACIÓN","TIPO","VALOR CUOTA","PROM. DESC. E.","VALOR VENTA","ESTADO"]; return ( - + + {resumen && ( +
+ + +
+ )} {loading ? : filas.length===0 ?
Sin alumnos.
: -
- - {COLS_DET.map((c)=>)} +
+
{c}
+ {COLS_DET.map((c)=>)} - {filas.map((f,i)=>( + {filas.map((f,i)=>{ + const esTot = String(f[0]).toUpperCase()==="TOTAL GENERAL"; + const stTot = esTot ? {position:"sticky",bottom:0,zIndex:9, + backgroundColor:"#dbeafe",fontWeight:700,color:"#1e3a5f", + boxShadow:"inset 0 1px 0 0 #93c5fd"} : {}; + return ( {f.map((v,j)=>( - + ))} - ))} + ); + })}
{c}
=5?"right":(j===1?"left":"center")}}>{v}{v}
}