import { DYN, money2 } from "../../lib/constants"; import PrioridadBadge from "./PrioridadBadge"; // Tabla de "palancas" del Informe de Previsión — puerto de accionRowInforme()/accionTable() // (App Informe/assets/js/modals.js). Sin columna Ejecutivo/Bloqueo/Agendar a propósito: el informe // ya es de un solo dueño (va en el encabezado), y no es interactivo (es un snapshot para 1:1). const PLAN_LETRA = { "Plan A - En firma": "A", "Plan B - En Negociación": "B", "Plan C - En seguimiento": "C", "Plan D - Recalificar": "D" }; const fechaTxt = (iso) => { if (!iso) return "—"; const [y, m, d] = iso.split("-"); return `${d}/${m}/${y.slice(2)}`; }; // `prevision`: columnas del informe imprimible de Previsión de Ventas (Cliente / Oportunidad, Plan, // Línea, MRR est., Prioridad, Nota de negociación, Fecha est. de cierre; sin Forecast ni Ejecutivo). export default function AccionTable({ list, prevision = false }) { if (!list.length) return

Ninguna oportunidad en esta categoría — bien ahí.

; const sorted = [...list].sort((a, b) => b.fc - a.fc); if (prevision) { return (
{sorted.map((o) => ( ))}
Cliente / Oportunidad Plan Línea MRR est. Prioridad Nota de negociación Fecha Est. de cierre
{o.name} {o.cliente || "—"} {PLAN_LETRA[o.plan] || "—"} {o.linea || "—"} {money2(o.est)} {(o.estado || "").slice(0, 110)} {(o.estado || "").length > 110 ? "…" : ""} {fechaTxt(o.close)}
Total ({sorted.length} oport.) {money2(sorted.reduce((a, o) => a + o.est, 0))}
); } return (
{sorted.map((o) => ( ))}
Cliente Oportunidad Prioridad MRR est. Forecast Nota de negociación
{o.cliente || "—"} {o.name} {money2(o.est)} {money2(o.fc)} {(o.estado || "").slice(0, 90)} {(o.estado || "").length > 90 ? "…" : ""}
Total ({sorted.length} oport.) {money2(sorted.reduce((a, o) => a + o.est, 0))} {money2(sorted.reduce((a, o) => a + o.fc, 0))}
); }