/* © 2026 K2B NETWORK SOLUTIONS LLC. All rights reserved. Proprietary and confidential. Unauthorized copying, distribution, or use of this file, via any medium, is strictly prohibited. Original work product. */ /* eslint-disable */ // JBREWS DMS — RouteOne (F&I credit-application gateway). // The dealership-facing RouteOne workspace: editable connection settings up // front, every submission tracked with its reference #, lender decisions // recorded per deal, and one-click submit for any working deal. The live wire // to RouteOne's network runs through the server tier (INTEGRATIONS_SPEC.md); // everything here is functional now and switches to live with zero UI changes. const r1Money = (n) => "$" + (Number(n) || 0).toLocaleString("en-US", { maximumFractionDigits: 0 }); const R1_TONE = { Submitted: { bg: "var(--jb-blue-tint,#E5EFFA)", fg: "var(--jb-blue,#1B66A8)" }, Approved: { bg: "var(--jb-green-tint,#E6F7EC)", fg: "#0E7A37" }, Conditioned: { bg: "#FBF3E0", fg: "#9A6700" }, Declined: { bg: "#FBE9E7", fg: "#B23A2E" }, }; const R1Badge = ({ s }) => { const t = R1_TONE[s] || R1_TONE.Submitted; return {s}; }; const RouteOne = ({ onClose, go }) => { const D = window.DMS; const [, force] = React.useReducer(n => n + 1, 0); React.useEffect(() => (D && D.subscribe) ? D.subscribe(force) : undefined, []); const act = (r) => { window.k2bToast && window.k2bToast(r.msg, r.ok ? "ok" : "warn", 4200); return r; }; const deals = (D && D.deals) ? D.deals() : []; const submitted = deals.filter(d => d.routeOne); const eligible = deals.filter(d => !d.routeOne && d.buyer); const [cfg, setCfg] = React.useState(() => (D && D.routeOneConfig) ? D.routeOneConfig() : {}); const [cfgOpen, setCfgOpen] = React.useState(false); // Deal in focus for the "Open RouteOne ▸" launch (the F&I hand-off pointer). const focusDealId = (() => { try { return localStorage.getItem("jb_fw_deal") || ""; } catch (e) { return ""; } })(); const focusDeal = focusDealId ? deals.find(d => d.id === focusDealId) : null; const [pickOpen, setPickOpen] = React.useState(false); const connected = !!(cfg.dealerId && cfg.user); const set = (k, v) => setCfg(c => ({ ...c, [k]: v })); const saveCfg = () => { D.setRouteOneConfig(cfg); act({ ok: true, msg: "RouteOne settings saved — Send to RouteOne is live on the Finance Worksheet and Credit App too." }); setCfgOpen(false); force(); }; const inp = { width: "100%", boxSizing: "border-box", padding: "7px 9px", border: "1px solid #C8CCD2", borderRadius: 4, fontSize: 13 }; return (
| {h} | )}||||||||
|---|---|---|---|---|---|---|---|---|
| {ro.ref} | {d.id} | {d.buyer} | {ro.lender || d.lender || "—"} | {r1Money(ro.amount || d.amtFinanced)} | {ro.sentAt ? new Date(ro.sentAt).toLocaleDateString() : "—"} | {ro.status === "Submitted" ? ( {["Approved", "Conditioned", "Declined"].map(dec => ( ))} ) : {ro.note || (ro.decidedAt ? new Date(ro.decidedAt).toLocaleString() : "")}} |
{window.AppLaunchButton && |