Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
Accounting Setup Wizard (cutover activation)
Last tested: 2026-10-09 (steps 1–3 PASS on "Company Without Accounting"; the legacy-window procedure below PASS end to end on "Legacy Window Test"). Section G and the "Active" period check in section F are not run in the browser yet; they come from the code. Route: /x/settings/accounting → /x/accounting/activation/readiness
Prerequisites
- A company with no
companySettings.accountingCutoverDate. Once the cutover is set, every/x/accounting/activation/*URL redirects to/x/accounting/periods. - Log in as [email protected]. The login lands on
/select-company; pick the company by its button. - DB access: no host
psql. Use the stack's container:docker exec -i carbon-carbon-<branch>-postgres-1 psql -U postgres -d postgres -c "…". - Run alone. The agent-browser "default" session and the test company are shared with other sessions. Another actor enabled accounting during the 2026-10-09 run.
Steps
1. Invoice before enable — /x/sales-invoice//details
No journal panel and no badge on the invoice. Post is disabled. Status reads "Submitted".
2. Settings → Accounting — /x/settings/accounting
The General Ledger card reads "Accounting is not set up" with a "Set up accounting" link.
The link has no button role, so click it with eval by its text.
It opens /x/accounting/activation/readiness. The breadcrumb reads "Accounting / Setup / Readiness".
3. Readiness
- The cutover date picker defaults to the first day of the current month.
- If "Every account default is set" fails, the item name (for example "Migration Clearing")
is a link to
/x/accounting/defaults. It does not scroll to the field. - Migration Clearing needs an Equity account. The defaults combobox cannot create one.
Create it at
/x/accounting/charts→ "Add Account": Parent Group "Equity", number "3400", name "Migration Clearing".requestSubmitthe form whose button reads "Save". - On Default Accounts, find the combobox in the card whose
h3reads "Migration Clearing". Pick "3400 Migration Clearing".requestSubmit"Save". The toast reads "Updated default accounts". - Return to the readiness page. All 6 checks show "Passed" and "Next" becomes a link.
4–10. Inventory, Fixed assets, Trial balance, Enable, Journals, Payment
Verified by the legacy-window procedure below. Void is not verified yet.
Legacy-window procedure (documents posted before journals existed)
Use this to test the enable on documents that are posted, dated on or after the cutover, and have no journal. Work on a NEW company. Never use an existing company.
A. Make the company (app)
- Pick any company on
/select-company. Open the company switcher in the breadcrumb. - Click the menu item "Add Company". A modal opens: "Let's set up your new company".
- Fill "Company Name", the address line (a combobox —
fillworks), city, state and postal code. requestSubmitthe modal form (the form that holdsinput[name=addressLine1]).- The app switches to the new company. It does not apply a demo template.
- Read the company id:
select id from company where name = '<name>'.
B. Clear the cutover (DB, local only)
A new company gets a cutover at creation (seed-company). The trigger
companySettings_accounting_config_locked (function check_accounting_config_locked)
refuses a change once accountingActivatedAt is set. Disable only that trigger:
BEGIN;
ALTER TABLE "companySettings" DISABLE TRIGGER "companySettings_accounting_config_locked";
UPDATE "companySettings" SET "accountingCutoverDate" = NULL, "accountingActivatedAt" = NULL,
"accountingActivatedBy" = NULL WHERE id = '<companyId>';
ALTER TABLE "companySettings" ENABLE TRIGGER "companySettings_accounting_config_locked";
COMMIT;
Check that pg_trigger.tgenabled is O for that trigger after the commit.
A new company already has every account default, Migration Clearing included.
C. Post the documents (app) — each posts a Provisional journal
- Part:
/x/part/new. Fill ID, name, and the unit cost field (fill + blur). Costing is FIFO by default. - PO:
/x/purchase-order/new. The supplier combobox shows "Add your first supplier" on a new company. Click it, fill the name,requestSubmitthe modal form. Pick the new supplier from the open list. - PO line: "Add Line Item". Pick the part. Fill quantity 10 and unit price 8 (fill + blur).
requestSubmit. - Click "Finalize", then "Finalize" in the dialog. Click "Receive". On the receipt click "Post", then "Post Receipt".
- Back on the PO, click "Invoice". On the invoice click "Post", then "Post Invoice". Status becomes "Open".
- SO:
/x/sales-order/new. Use "Add your first customer" the same way as the supplier. - SO line: pick the part, quantity 2. Click the unit price field,
fill50, press Tab. Checkinput[name=unitPrice]. - "Confirm" twice. "Ship". On the shipment "Post", then "Post Shipment".
- Back on the SO, "Invoice". On the invoice "Post", then "Post Invoice". Status becomes "Submitted".
D. Simulate the reset (DB)
Delete the Provisional journals of THIS company only:
BEGIN;
SET LOCAL "app.sync_in_progress" = 'true';
DELETE FROM "journalLine" WHERE "companyId" = '<companyId>' AND "journalId" IN (<ids>);
DELETE FROM journal WHERE "companyId" = '<companyId>' AND id IN (<ids>);
COMMIT;
Keep the costLedger rows. If you made payments, memos or charges, set their journalId to NULL.
E. Run the wizard (app)
- Readiness: cutover = first day of the current month. All 6 checks pass. Click "Next".
- Inventory: "No item has stock on hand at the cutover date." (the stock came in after the cutover).
- Fixed assets: "No fixed asset was acquired before the cutover date."
- Trial balance: no entry is needed. "Migration Clearing" at the bottom reads $0.00. "Save Trial Balance" stays disabled, and "Next" works without a save.
- Enable: the Summary lists "Documents posted before Carbon kept journals" with one row per family (Sales invoices, Purchase invoices, Purchase receipts, Sales shipments).
- Fill
input[name=confirmation]with the company name.requestSubmitits form ("Enable accounting"). - The app redirects to
/x/accounting/periods.
F. Verify
- DB: every journal of the company is
Posted. Each legacy document has one journal with a period. - DB balances (sum of
journalLine.amountper account; amounts are signed by natural balance): AR = sales invoice total, AP = purchase invoice total, GR/IR = 0, inventory = on-hand × cost, no line on the Migration Clearing account. - Sales invoice → "Payment" link →
/x/payments/new?...&amount=<balance>. The bank account is prefilled.requestSubmit"Save". Click "Post". Status becomes "Posted" and the invoice "Paid". AR = 0. - The purchase invoice has the same "Payment" link. It opens
/x/payments/new?supplierId=…&invoiceId=…&amount=<balance>. Save and post the payment the same way. AP = 0. /x/accounting/journalslists the rebuilt journals as Posted./x/accounting/periods: the period that holds today shows Status "Active" right after the enable. No posting is needed first. The enable runsgetCurrentAccountingPeriod(step 10a inapps/erp/app/modules/accounting/accounting.service.ts).
G. Write missing journals (a company that already has a cutover)
The enable writes the journals of legacy documents (step 1a). So a company that the current enable set up has none left. A company enabled before step 1a existed can still have them.
- Open Settings → Accounting (
/x/settings/accounting). - Find the warning alert in the "General Ledger" card. It shows only when the company has a cutover
and at least one posted document dated on or after the cutover with no journal (
hasLegacyDocuments). - Read the alert text: "N documents posted before Carbon kept journals have no journal." Until the streamed count loads, it reads "Documents posted before Carbon kept journals have no journal."
- Click the button "Write missing journals". It is disabled unless the user can update both settings and accounting.
- The toast reads "Wrote the missing journals of N documents" (or "Wrote the missing journal of 1 document").
What the button does: repairLegacyJournals (accounting.service.ts, ported from the journal-legacy-documents server function) runs the enable's step 1a again,
in one transaction. It writes each missing journal, gives it a period, re-points its stand-in lines
and promotes it to Posted. If one journal falls in a Closed or Locked period, the whole call fails
and the error names the period. It writes nothing in that case.
Selector Notes
- The wizard step tabs are links in
navigation "Accounting setup". - "Write missing journals" is a button (role
button) inside the warning alert of the "General Ledger" card. - The invoice "Payment" control is a link (role
link), on both the sales and the purchase invoice. - "Next" is a link (not a button) once every check passes. It is a disabled button before that.
- The hidden input for Migration Clearing is
input[name=migrationClearingAccount].
Common Failures
- The readiness checks do not list a posted document dated on or after the cutover that has no journal. The Enable step lists it under "Documents posted before Carbon kept journals", and the enable writes its journal (verified 2026-10-09).
agent-browser screenshotwith a RELATIVE path saves to a temp folder. Pass an absolute path.- The enable writes no opening journal when every opening balance is zero.
- Every page logs "Hydration failed" on a direct load in dev. This is app-wide, not the wizard.