Ties to the general ledger — every import{glTie.live ? " (the books today)" : glTie.staged ? " (as if approved)" : ""}as of {glTie.asOf} · per import, each GL account it touches: the list next to the ledger, the difference and what it most likely means. Balance-sheet differences may be ticked (posted against the conversion clearing account{glTie.conversionAcct ? " " + glTie.conversionAcct : ""}); profit & loss lines are year-to-date information.
… {d.more} more account{d.more === 1 ? "" : "s"} differ (the first {d.lines.length} are shown, largest first).
: null}
)}
))}
{!dests.length &&
No import part to tie.
}
);
};
/* ── Reconcile Inventory: the same lines from the live books ── */
const ImpGlLive = ({ asOf }) => {
const [t, setT] = React.useState(null); const [err, setErr] = React.useState("");
React.useEffect(() => { let on = true; (async () => { try { const r = await D()._apiGet("/import/gl-tie" + (asOf ? "?asOf=" + encodeURIComponent(asOf) : "")); if (on) { setT(r.glTie); setErr(""); } } catch (e) { if (on) setErr(errText(e)); } })(); return () => { on = false; }; }, [asOf]);
if (err) return
Ties to the GL — every import: {err}
;
if (!t) return
Loading the tie-out by import…
;
return
;
};
/* ── the template page: every import's CSV, sheet, sample row and meaning ── */
let _tpl = null;
const loadTemplates = async () => { if (_tpl) return _tpl; const r = await fetch("templates/templates.json", { cache: "no-cache" }); if (!r.ok) throw new Error("templates/templates.json: " + r.status); _tpl = await r.json(); return _tpl; };
const ImpTemplateGuide = ({ onClose, focus }) => {
const n = useNarrow();
const [t, setT] = React.useState(null); const [err, setErr] = React.useState(""); const [q, setQ] = React.useState("");
React.useEffect(() => { loadTemplates().then(setT).catch((e) => setErr(errText(e))); }, []);
React.useEffect(() => { if (t && focus) { const el = document.querySelector('[data-testid="tg-dest-' + focus + '"]'); if (el) el.scrollIntoView({ block: "start" }); } }, [t, focus]);
const list = t ? t.templates.filter((x) => !q || (x.title + " " + x.sheet + " " + x.dest + " " + x.ties).toLowerCase().indexOf(q.toLowerCase()) !== -1) : [];
return (
Import templates — what each column means and which GL account it ties to
setQ(e.target.value)} style={{ font: "inherit", padding: "3px 6px", width: 170 }} />
Whole workbook (.xlsx)
{g.file ? (g.agrees ? "✓ agrees" : `⚠ file ${g.file.deals} · ${money(g.file.salesCents || 0)}`) : "— not in the file"}
: null}
))}
The deals' GL tie-out (open items vs 205 / 303 / 324A / 302, sales and cost of sales year to date) is on Accounting › Reconcile Inventory and on each deal import's review.