Cegid Y2 → D365 POS export loading…
saved

Edit mode is on. Click any cell to correct it, use the row controls to add / delete / reorder fields, then Export JSON to save the corrected database. Edits autosave to this browser.

The five record types

Every row starts with its record tag. The composite key (entity · transaction · store · terminal) repeats on every row; T and D point back to their S line, P is sequential.

SKU + batch consolidation.

Batch & SKU logic

How one Cegid line becomes one or several exported lines, and how every amount is prorated across them. Worked examples with figures.

One receipt, end to end

Selection & scope

ConditionWhy
Idempotent by design.

Sign conventions

Cegid stores sale quantities positive and returns negative; D365 expects the opposite on sales lines. Amounts and quantities are flipped uniformly; unit price stays positive.

Price invariant.

Lookups & codes

All crosswalks resolve through store free-fields and extended code tables — no hard-coded values in the query body, so new stores and entities onboard through reference data.

PurposeCegid sourceResolves to
Batch precondition.

Cegid tables used

Standard Y2 tables plus custom tables for QR-to-batch resolution.

TablePrefixRoleOrigin

SQL generator

Builds the five-branch UNION ALL statement from the field list above — one branch per record type, every branch emitting the same ordered column list with '' wherever a column does not apply. Edit a field above and regenerate: the SQL follows the contract.

Press “Generate SQL”.
Draft, not a delivered query. The consolidation sequence is synthesised with a correlated COUNT(DISTINCT …) because window functions are banned, and it is repeated identically in the S, T and D branches. Run it against a real dossier and reconcile row counts before shipping.

File validation

Load the file Cegid produced and check it against this contract — column alignment, fixed constants, sign conventions, cardinality, consolidation and header control totals. Nothing leaves the browser.

no file loaded
Drop the exported file here

AI analysis

Sends the contract, the loaded export file, and any project files you attach to the Claude API, and streams the answer back. Your key is used from this page only.

Your API key stays in this browser tab. It is held in sessionStorage, cleared when the tab closes, and is never written into content.json or the exported HTML. It is sent to api.anthropic.com from the page, so use a key scoped to a workspace you're willing to spend from — anyone who can open this tab can spend it. If the request is blocked by CORS, put a small server-side proxy in front instead of pasting the key here.
no files attached
Paste a key, pick a preset or type a question, then Run.