/* eslint-disable */ /* © 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. */ // K2B Network Solutions — full Sales menu. Every item routes somewhere // (so the kit feels alive). Also publishes a tiny `K2BRouter` so other // screens can call `go("payroll")`. // ONE PATH: CRM — Leads is the front door (customers + deals are born // there); "Deal Pipeline" only views deals by stage. const SALES_MENU = [ { label: "CRM — Leads", target: "crm" }, { label: "Deal Pipeline", target: "deal" }, { label: "Customers", target: "customers" }, { label: "Inventory", target: "inventory" }, { label: "Trade Appraisal", target: "appraisal" }, { label: "Desking", target: "desking" }, { label: "Credit App", target: "creditapp" }, { label: "Worksheets", target: "worksheets" }, { label: "Forms", target: "forms" }, { label: "Service", target: "service" }, { label: "Parts", target: "parts" }, { label: "Accounting", target: "accounting" }, { label: "Accounts Receivable", target: "armenu" }, { label: "GM Accounting", target: "gmacct" }, { label: "Payroll", target: "payroll" }, { label: "Import / Export", target: "uploadtool" }, { label: "GMDS Export", target: "gmds" }, { label: "Controls", target: "controls" }, { label: "Setup", target: "settings" }, { label: "Back", target: "back" }, ]; const SalesMenu = ({ onPick, onClose }) => { const [focused, setFocused] = React.useState(0); React.useEffect(() => { const h = (e) => { // Audit A-08: ignore keys typed into any form field (e.g. the JB Helper // chat box) and keys pressed while a dialog is open. This component is // only mounted while the Sales menu is the active screen. if (window.jbKeyFromField && window.jbKeyFromField(e)) return; if (window.jbAnyModalOpen && window.jbAnyModalOpen()) return; if (e.altKey || e.ctrlKey || e.metaKey) return; if (e.key === "ArrowDown") { e.preventDefault(); setFocused(f => Math.min(SALES_MENU.length - 1, f + 1)); } else if (e.key === "ArrowUp") { e.preventDefault(); setFocused(f => Math.max(0, f - 1)); } else if (e.key === "Enter") { const it = SALES_MENU[focused]; if (it.target === "back") onClose(); else onPick(it.target); } else if (e.key === "Escape") onClose(); else if (/^[a-z]$/i.test(e.key)) { const idx = SALES_MENU.findIndex((it, k) => k > focused && it.label[0].toLowerCase() === e.key.toLowerCase()); const found = idx >= 0 ? idx : SALES_MENU.findIndex(it => it.label[0].toLowerCase() === e.key.toLowerCase()); if (found >= 0) setFocused(found); } }; window.addEventListener("keydown", h); return () => window.removeEventListener("keydown", h); }); return (
Sales
({ ...it, accelIdx: 0 }))} focused={focused} onFocus={setFocused} onPick={(it) => it.target === "back" ? onClose() : onPick(it.target)} />
); }; // Worksheets sub-picker — Cash Deal or Finance Deal (the desk pushes the // deal to one of these; both Post to Accounting from there). const WorksheetsMenu = ({ onPick, onClose }) => { const [focused, setFocused] = React.useState(0); const items = [ { label: "Cash Deal", target: "cashworksheet", accelIdx: 0 }, { label: "Finance Deal", target: "finance", accelIdx: 0 }, { label: "Buyer's Order", target: "buyersorder", accelIdx: 0 }, { label: "Back", target: "back", accelIdx: 0 }, ]; React.useEffect(() => { const h = (e) => { if (window.jbKeyFromField && window.jbKeyFromField(e)) return; // audit A-08 if (window.jbAnyModalOpen && window.jbAnyModalOpen()) return; if (e.altKey || e.ctrlKey || e.metaKey) return; if (e.key === "ArrowDown") setFocused(f => Math.min(items.length - 1, f + 1)); else if (e.key === "ArrowUp") setFocused(f => Math.max(0, f - 1)); else if (e.key === "Enter") { const it = items[focused]; if (it.target === "back") onClose(); else onPick(it.target); } else if (e.key === "Escape") onClose(); }; window.addEventListener("keydown", h); return () => window.removeEventListener("keydown", h); }); return (
Worksheets
it.target === "back" ? onClose() : onPick(it.target)} />
); }; // The tiny mini-menu used at the bottom-right of PayrollProcess (unchanged) const PayrollMiniMenu = ({ focused = 0 }) => { const items = ["Employees", "Payrolls", "Reports", "Processing", "Setup", "Back"]; return (
Employee Payroll
{items.map((it, i) => (
{it}
))}
); }; Object.assign(window, { SalesMenu, WorksheetsMenu, PayrollMiniMenu });