Skip to content

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.

fix(accounting): Apply balances Migration Clearing on retained earnings; pull the trial balance from Rillet (#1915)

Brad Barbinaead6491df4c
diff --git a/apps/erp/app/modules/accounting/AGENTS.md b/apps/erp/app/modules/accounting/AGENTS.md
index b9090fd1bf..bb1ee551ac 100644
--- a/apps/erp/app/modules/accounting/AGENTS.md
+++ b/apps/erp/app/modules/accounting/AGENTS.md
@@ -16,7 +16,7 @@ The **Executive P&L** (`executive-pnl.tsx`) shares the income statement's loader
- **Journal status lists** (`@carbon/database/accounting-posting`) — every journal reader filters by one of three lists. `GL_JOURNAL_STATUSES` (Posted, Reversed): balances, trial balance, reports, period snapshots, tie-outs, provider sync. `DOCUMENT_JOURNAL_STATUSES` (Provisional, Posted, Reversed): a reader that follows one document's chain — void builders, GR/IR, WIP sums, intercompany lookups. `OPEN_ITEM_JOURNAL_STATUSES` (Provisional, Posted): payment control lookups and the memo, charge and reimbursement void checks. Superseded is in none. The `journal-status-filter` check (`@carbon/checks`) fails a `status <> 'Draft'` journal filter in TS and in migrations from `20261009005144`. The AR/AP readers (`get_ar_open_by_customer`, `get_ap_open_by_supplier`, `get_ar_tie_out`, `get_ap_tie_out`) keep `= 'Posted'` and also accept `sourceType 'Opening Balance'` (`20261009014620`).
- **Stand-in lines** — before the cutover, a posting that needs an empty nullable account default posts the line to `retainedEarningsAccount` and names the default it wanted in `journalLine.accountDefaultRole` (`resolveDefaultAccount`, `@carbon/database/journal-posting-status`). A Provisional journal counts nowhere, so the stand-in moves no balance. The enable re-points every stand-in line dated on or after the cutover to its default and clears the role. After the cutover an empty default fails the posting. See `packages/server-functions/AGENTS.md` → Journals and the accounting cutover.
- **Manual accounting work is refused before the cutover** with `ACCOUNTING_NOT_STARTED` ("Set up accounting before you post journals, runs or period closes."): `requireAccountingCutover` (`accounting.service.ts`) in `postJournalEntry`, `reverseJournalEntry`, `lockAccountingPeriod`, `closeAccountingPeriod` and `createDepreciationRun`; `requireGroupAccountingCutover` (every company of the group) in `runIntercompanyMatching` and `generateEliminations`; a `readAccountingCutoverDate` test (`@carbon/database/journal-posting-status`) at the top of `postDepreciationRun`, `postDisposal` and `postRevenueRecognitionRun` (`accounting.server.ts`); and `assertAccountingCutover` (`packages/server-functions/src/lib/require-accounting-cutover.ts`, the same read) in the `propose-revenue-recognition-run` and `recalculate-revenue-recognition-run` server functions.
-- **The enable wizard** — `x+/accounting+/activation.tsx` (layout, `view: accounting`, redirects to Periods once the company has a cutover; the cutover date rides the `?cutover=` search param (`ACTIVATION_CUTOVER_PARAM`), read by `getActivationCutover` in `accounting.server.ts`, which defaults to the first day of the current month) with six steps, each its own route: `activation.chart.tsx` (links to the chart of accounts import; Next keeps Carbon's chart), `activation.readiness.tsx` (the date picker — the first day of the current month or of one of the 3 before it, `CUTOVER_MAX_PERIODS_BACK` — and the six checks of `getActivationReadiness`: every `accountDefault` account column set to an active account, except a default with a fallback (`hasDefaultFallback`), which may stay empty, and `migrationClearingAccount` an Equity account that is not a group; fiscal year settings and base currency; a valid cutover date; no Draft or Pending receipt, shipment or invoice and no Draft payment or memo dated before the cutover; no open job created before the company's first Provisional or Superseded journal; no Posted `Opening Balance` journal. Each `ActivationCheck` carries `reasons`, codes (`ActivationCheckReason`: `no-fiscal-year-settings`, `no-base-currency`, `migration-clearing-wrong-kind` and the four `CutoverDateReason` codes) that `ReadinessChecklist` translates; `detail` says the same in English for the enable's refusal), `activation.inventory.tsx` (`getCutoverInventoryValuation`: on-hand at the cutover per item and its unit cost — the replayed layer value for FIFO / LIFO, standard cost for Standard, `itemCost.unitCost` for Average, which is the only one the user edits — with each item's value, the value per inventory account and the total, valued as the opening journal values them), `activation.fixed-assets.tsx` (`getCutoverFixedAssets`: the assets on the books the day before the cutover — acquired before it, and not disposed or disposed on or after it, except an asset whose disposal leaves the books with no journal (`getAssetsLeavingWithoutJournal`: a sale, return to inventory or lease commencement posted before the reset) — with accumulated depreciation as of that day, the asset's own less what Posted runs booked for months on or after the cutover (`getDepreciationAfterCutover`), since the enable writes those runs' journals again; intent `save-asset` writes the accumulated depreciation as of the day before the cutover through `updateCutoverAccumulatedDepreciation`, which stores it plus that later depreciation), `activation.trial-balance.tsx` (the prior system's trial balance as of the day before the cutover, kept as ONE Draft `Opening Balance` journal with no period by `saveOpeningTrialBalance`; one debit-signed balance per account in the editor (a credit is negative; the save still sends a debit and a credit); intents `save-tb` (the editor), `import-tb` (CSV `accountNumber, debit, credit`, saves nothing when a row has an error), `pull-tb` (only when the active accounting integration passes `isTrialBalanceProvider` — Xero, QuickBooks Online: `pullTrialBalanceFromProvider` (`@carbon/ee/accounting`) reads the provider's trial balance as of the day before the cutover and maps it through the account mappings, else by account number; it saves what maps and returns the rest, unmapped or mapped to several Carbon accounts, for the editor to list), `ignore-invoice` (`setCutoverInvoiceIgnored`) and `apply-carbon` (`applyCarbonToOpeningTrialBalance`: every control account set to Carbon's opening total, every other row kept). The CSV parser is the pure, tested `trial-balance-csv.ts` (`parseTrialBalanceCsv`, `mapTrialBalanceAccounts`): it returns error codes the editor translates, refuses a duplicate account number, and refuses an amount with a comma (`ambiguous-amount`) instead of stripping it, since `1,234` is a thousand in one convention and one and a fraction in another; `getMigrationClearing` shows, per control account, the trial balance, Carbon's opening total and the difference, and each account opens to the items behind its total. Before the cutover another system kept the books, so an invoice open in Carbon may be settled there: a sales or purchase invoice (`isIgnorableOpenItem`) can be ignored — unless Carbon itself settles it on or after the cutover (`settledFromCutoverIds`: a payment or memo application not in effect the day before, or a Paid status dated on or after it), whose journal credits the control account and needs the opening line — which stores it in `accountingCutoverIgnoredInvoice`, takes it out of `items` into `ignoredItems`, and has the enable mark it Paid the day before the cutover. No other item can be ignored: leaving it out of the opening journal would misstate what reads it later) and `activation.enable.tsx` (the summary and the typed company name; it invokes the `activate-accounting` server function and redirects to Periods). The summary lists, under "Documents posted before Carbon kept journals", each family with legacy documents and how many (`getLegacyDocumentCounts`): documents posted on or after the cutover that have no journal, which the enable journals with today's accounts and costs (see `packages/server-functions/AGENTS.md` → Legacy documents). The reads live once, in Kysely, in `@carbon/database/accounting-cutover-reads` (server-only; one module per step under `packages/database/src/accounting-cutover/`). The wizard routes import them from there directly and pass `getDatabaseClient()`; `activate-accounting` calls the same functions with its transaction. The pure planners (`planInventoryReset`, `recostOutbound`, `buildOpeningJournalLines`) are `@carbon/database/accounting-cutover`. Settings → Accounting (`x+/settings+/accounting.tsx`) shows "Accounting since {date}" or a "Set up accounting" button; there is no switch.
+- **The enable wizard** — `x+/accounting+/activation.tsx` (layout, `view: accounting`, redirects to Periods once the company has a cutover; the cutover date rides the `?cutover=` search param (`ACTIVATION_CUTOVER_PARAM`), read by `getActivationCutover` in `accounting.server.ts`, which defaults to the first day of the current month) with six steps, each its own route: `activation.chart.tsx` (links to the chart of accounts import; Next keeps Carbon's chart), `activation.readiness.tsx` (the date picker — the first day of the current month or of one of the 3 before it, `CUTOVER_MAX_PERIODS_BACK` — and the six checks of `getActivationReadiness`: every `accountDefault` account column set to an active account, except a default with a fallback (`hasDefaultFallback`), which may stay empty, and `migrationClearingAccount` an Equity account that is not a group; fiscal year settings and base currency; a valid cutover date; no Draft or Pending receipt, shipment or invoice and no Draft payment or memo dated before the cutover; no open job created before the company's first Provisional or Superseded journal; no Posted `Opening Balance` journal. Each `ActivationCheck` carries `reasons`, codes (`ActivationCheckReason`: `no-fiscal-year-settings`, `no-base-currency`, `migration-clearing-wrong-kind` and the four `CutoverDateReason` codes) that `ReadinessChecklist` translates; `detail` says the same in English for the enable's refusal), `activation.inventory.tsx` (`getCutoverInventoryValuation`: on-hand at the cutover per item and its unit cost — the replayed layer value for FIFO / LIFO, standard cost for Standard, `itemCost.unitCost` for Average, which is the only one the user edits — with each item's value, the value per inventory account and the total, valued as the opening journal values them), `activation.fixed-assets.tsx` (`getCutoverFixedAssets`: the assets on the books the day before the cutover — acquired before it, and not disposed or disposed on or after it, except an asset whose disposal leaves the books with no journal (`getAssetsLeavingWithoutJournal`: a sale, return to inventory or lease commencement posted before the reset) — with accumulated depreciation as of that day, the asset's own less what Posted runs booked for months on or after the cutover (`getDepreciationAfterCutover`), since the enable writes those runs' journals again; intent `save-asset` writes the accumulated depreciation as of the day before the cutover through `updateCutoverAccumulatedDepreciation`, which stores it plus that later depreciation), `activation.trial-balance.tsx` (the prior system's trial balance as of the day before the cutover, kept as ONE Draft `Opening Balance` journal with no period by `saveOpeningTrialBalance`; one debit-signed balance per account in the editor (a credit is negative; the save still sends a debit and a credit); intents `save-tb` (the editor), `import-tb` (CSV `accountNumber, debit, credit`, saves nothing when a row has an error), `pull-tb` (only when the active accounting integration passes `isTrialBalanceProvider` — Xero, QuickBooks Online, Rillet: `pullTrialBalanceFromProvider` (`@carbon/ee/accounting`) reads the provider's trial balance as of the day before the cutover and maps it through the account mappings, else by account number; it saves what maps and returns the rest, unmapped or mapped to several Carbon accounts, for the editor to list), `ignore-invoice` (`setCutoverInvoiceIgnored`) and `apply-carbon` (`applyCarbonToOpeningTrialBalance`: every control account set to Carbon's opening total, every other row kept, and what that leaves out of balance — the Migration Clearing total — added to the `retainedEarningsAccount` row, so Migration Clearing totals zero; the button is enabled while the total is not zero). The CSV parser is the pure, tested `trial-balance-csv.ts` (`parseTrialBalanceCsv`, `mapTrialBalanceAccounts`): it returns error codes the editor translates, refuses a duplicate account number, and refuses an amount with a comma (`ambiguous-amount`) instead of stripping it, since `1,234` is a thousand in one convention and one and a fraction in another; `getMigrationClearing` shows, per control account, the trial balance, Carbon's opening total and the difference, and each account opens to the items behind its total. Before the cutover another system kept the books, so an invoice open in Carbon may be settled there: a sales or purchase invoice (`isIgnorableOpenItem`) can be ignored — unless Carbon itself settles it on or after the cutover (`settledFromCutoverIds`: a payment or memo application not in effect the day before, or a Paid status dated on or after it), whose journal credits the control account and needs the opening line — which stores it in `accountingCutoverIgnoredInvoice`, takes it out of `items` into `ignoredItems`, and has the enable mark it Paid the day before the cutover. No other item can be ignored: leaving it out of the opening journal would misstate what reads it later) and `activation.enable.tsx` (the summary and the typed company name; it invokes the `activate-accounting` server function and redirects to Periods). The summary lists, under "Documents posted before Carbon kept journals", each family with legacy documents and how many (`getLegacyDocumentCounts`): documents posted on or after the cutover that have no journal, which the enable journals with today's accounts and costs (see `packages/server-functions/AGENTS.md` → Legacy documents). The reads live once, in Kysely, in `@carbon/database/accounting-cutover-reads` (server-only; one module per step under `packages/database/src/accounting-cutover/`). The wizard routes import them from there directly and pass `getDatabaseClient()`; `activate-accounting` calls the same functions with its transaction. The pure planners (`planInventoryReset`, `recostOutbound`, `buildOpeningJournalLines`) are `@carbon/database/accounting-cutover`. Settings → Accounting (`x+/settings+/accounting.tsx`) shows "Accounting since {date}" or a "Set up accounting" button; there is no switch.
- **Opening lines** — the enable posts one `Opening Balance` journal, dated the day before the cutover, against `accountDefault.migrationClearingAccount` (seeded as 3400 "Migration Clearing" for new companies). A control-account line copies the keys its chain reader matches (`documentType`, `documentId`, `documentLineReference`, description), so a payment, a purchase invoice's GR/IR walk or a job close after the cutover finds it as if the original posting had written it. A PO line invoiced before the cutover for more than it received opens its GR/IR accrual (`purchase-invoice:<poLineId>`, `accrual` true, the open quantity at the invoices' accrual unit cost), which a receipt after the cutover clears at the invoice's cost. A document partly settled before the cutover gets two lines: its original amount, and the amount settled before the cutover under "<description> (settled before cutover)", which the readers ignore. Every other account comes from the trial balance only. Deferred revenue opens from the Deferral rows dated on or after the cutover of invoices posted before it that were still deferred the day before (Planned, or Posted by a run whose journal the reset deleted, which the enable writes again), on each row's debit account. Lease net investment opens per rental agreement from the lease rows of each `Sale` line commenced before the cutover (the last `rentalLeaseScheduleLine.closingNetInvestment` before the cutover, else `initialNetInvestment`), not from a commencement journal, which a lease commenced before the reset does not have. Migration Clearing must total zero within 0.01 before the enable. A void of a document dated before the cutover is in `packages/server-functions/AGENTS.md`.
- **Fiscal Year Settings** — configurable start month for fiscal and tax years. Accounting periods auto-created via `getOrCreateAccountingPeriod`.
- **Dimensions** — analytical tags on journal lines (Location, Department, Project, etc.). Entity-type dimensions resolve values from their source table; Custom dimensions use `dimensionValue`.
diff --git a/apps/erp/app/modules/accounting/ui/Activation/ApplyCarbonButton.tsx b/apps/erp/app/modules/accounting/ui/Activation/ApplyCarbonButton.tsx
index 185d4ea3bb..637ac01412 100644
--- a/apps/erp/app/modules/accounting/ui/Activation/ApplyCarbonButton.tsx
+++ b/apps/erp/app/modules/accounting/ui/Activation/ApplyCarbonButton.tsx
@@ -10,9 +10,9 @@ import { usePermissions } from "~/hooks";
import { activationStepPath } from "./ActivationSteps";
/**
- * Sets every control account on the trial balance to Carbon's opening total.
- * What is left on Migration Clearing then shows as the trial balance being
- * out of balance, to put on a non-control account.
+ * Sets every control account on the trial balance to Carbon's opening total
+ * and puts what that leaves out of balance on Retained Earnings, so Migration
+ * Clearing totals zero. Enabled while it does not.
*/
export default function ApplyCarbonButton({
cutoverDate,
diff --git a/apps/erp/app/routes/x+/accounting+/activation.trial-balance.tsx b/apps/erp/app/routes/x+/accounting+/activation.trial-balance.tsx
index 07e6b4aa91..bdeccdfc96 100644
--- a/apps/erp/app/routes/x+/accounting+/activation.trial-balance.tsx
+++ b/apps/erp/app/routes/x+/accounting+/activation.trial-balance.tsx
@@ -491,15 +491,15 @@ export default function AccountingActivationTrialBalanceRoute() {
items, inventory and fixed assets. The trial balance must agree:
every difference stays on Migration Clearing, which must total
zero. Open an account to see its items, and ignore an invoice the
- prior system already settled.
+ prior system already settled. Apply to Trial Balance sets each
+ control account to Carbon's total and puts what is left on
+ Retained Earnings.
</Trans>
}
actions={
<ApplyCarbonButton
cutoverDate={cutoverDate}
- hasDifference={clearing.rows.some(
- (row) => !isMigrationClearingZero(row.difference)
- )}
+ hasDifference={!isMigrationClearingZero(clearing.total)}
/>
}
>
diff --git a/packages/database/src/accounting-cutover.test.ts b/packages/database/src/accounting-cutover.test.ts
index cb7f4a609b..d41a313e07 100644
--- a/packages/database/src/accounting-cutover.test.ts
+++ b/packages/database/src/accounting-cutover.test.ts
@@ -382,39 +382,48 @@ describe("isIgnorableOpenItem", () => {
});
describe("applyCarbonToTrialBalance", () => {
- it("sets each control account to Carbon's total and keeps every other row", () => {
+ const RETAINED = "acct-retained";
+ const classed = (
+ lines: { accountId: string; debit: number; credit: number }[]
+ ) =>
+ lines.map((line) => ({
+ ...line,
+ accountClass:
+ line.accountId === RETAINED
+ ? ("Equity" as const)
+ : (classOf[line.accountId] ?? "Asset")
+ }));
+
+ it("sets each control account to Carbon's total and balances on retained earnings", () => {
const items = [receivable("inv-1", 100), receivable("inv-2", 20)];
const trialBalance: TrialBalanceLine[] = [
{ accountId: AR, accountClass: "Asset", debit: 105, credit: 0 },
{ accountId: CASH, accountClass: "Asset", debit: 50, credit: 0 },
{ accountId: EQUITY, accountClass: "Equity", debit: 0, credit: 155 }
];
- const { rows } = migrationClearingByAccount(items, trialBalance, controls);
+ const before = migrationClearingByAccount(items, trialBalance, controls);
+ expect(before.total).toBe(-15);
- const applied = applyCarbonToTrialBalance(trialBalance, rows, controls);
+ const applied = applyCarbonToTrialBalance(
+ trialBalance,
+ before.rows,
+ controls,
+ RETAINED
+ );
expect(applied).toEqual([
{ accountId: CASH, debit: 50, credit: 0 },
{ accountId: EQUITY, debit: 0, credit: 155 },
- { accountId: AR, debit: 120, credit: 0 }
+ { accountId: AR, debit: 120, credit: 0 },
+ { accountId: RETAINED, debit: 0, credit: 15 }
]);
- const after = migrationClearingByAccount(
- items,
- applied.map((line) => ({
- ...line,
- accountClass: classOf[line.accountId] ?? "Asset"
- })),
- controls
- );
+ const after = migrationClearingByAccount(items, classed(applied), controls);
expect(after.rows.every((row) => row.difference === 0)).toBe(true);
- // The total only moves when the non-control rows change.
- expect(after.total).toBe(
- migrationClearingByAccount(items, trialBalance, controls).total
- );
+ expect(after.total).toBe(0);
});
- it("writes a credit-natured control account as a credit, and drops one Carbon has nothing on", () => {
- const payables = new Set([AP, AR]);
+ it("adds to a retained earnings row already there, and drops a control account Carbon has nothing on", () => {
+ const both = new Set([AP, AR]);
const payable: OpenItem = {
...receivable("pinv-1", 300),
openItemType: "Payable",
@@ -422,17 +431,31 @@ describe("applyCarbonToTrialBalance", () => {
accountClass: "Liability"
};
const trialBalance: TrialBalanceLine[] = [
- { accountId: AR, accountClass: "Asset", debit: 40, credit: 0 }
+ { accountId: AR, accountClass: "Asset", debit: 40, credit: 0 },
+ { accountId: RETAINED, accountClass: "Equity", debit: 0, credit: 40 }
];
- const { rows } = migrationClearingByAccount(
- [payable],
+ const { rows } = migrationClearingByAccount([payable], trialBalance, both);
+
+ const applied = applyCarbonToTrialBalance(
trialBalance,
- payables
+ rows,
+ both,
+ RETAINED
);
- expect(applyCarbonToTrialBalance(trialBalance, rows, payables)).toEqual([
+ expect(applied).toEqual([
+ { accountId: RETAINED, debit: 300, credit: 0 },
{ accountId: AP, debit: 0, credit: 300 }
]);
+ expect(
+ migrationClearingByAccount([payable], classed(applied), both).total
+ ).toBe(0);
+ });
+
+ it("refuses to balance on a control account", () => {
+ expect(() => applyCarbonToTrialBalance([], [], controls, AR)).toThrow(
+ /control account/
+ );
});
});
diff --git a/packages/database/src/accounting-cutover.ts b/packages/database/src/accounting-cutover.ts
index c42ff36c1e..9c665be6e5 100644
--- a/packages/database/src/accounting-cutover.ts
+++ b/packages/database/src/accounting-cutover.ts
@@ -364,27 +364,48 @@ export function isIgnorableOpenItem(
/**
* The trial balance with every control account set to Carbon's opening total
- * for it, debit-signed as `migrationClearingByAccount` reports it. Every other
- * row is kept. Each control account's difference becomes zero; the Migration
- * Clearing total does not move, and shows up instead as the trial balance
- * being out of balance, to be put on a non-control account.
+ * for it, debit-signed as `migrationClearingByAccount` reports it, and every
+ * other row kept. Each control account's difference becomes zero. What is
+ * left — the Migration Clearing total — is the amount the trial balance is
+ * now out of balance by; it goes to `balancingAccountId` (retained
+ * earnings), added to any row already there, so Migration Clearing totals
+ * zero and the plug is a trial balance line the user can see and change.
*/
export function applyCarbonToTrialBalance(
trialBalance: TrialBalanceLine[],
rows: MigrationClearingRow[],
- controlAccountIds: ReadonlySet<string>
+ controlAccountIds: ReadonlySet<string>,
+ balancingAccountId: string
): { accountId: string; debit: number; credit: number }[] {
- const kept = trialBalance
- .filter((line) => !controlAccountIds.has(line.accountId))
- .map(({ accountId, debit, credit }) => ({ accountId, debit, credit }));
- const control = rows
- .filter((row) => Math.abs(row.carbon) > EPSILON)
- .map((row) => ({
- accountId: row.accountId,
- debit: row.carbon > 0 ? row.carbon : 0,
- credit: row.carbon < 0 ? -row.carbon : 0
- }));
- return [...kept, ...control];
+ if (controlAccountIds.has(balancingAccountId)) {
+ throw new Error("The balancing account cannot be a control account");
+ }
+ const debitByAccount = new Map<string, number>();
+ const add = (accountId: string, value: number) =>
+ debitByAccount.set(accountId, (debitByAccount.get(accountId) ?? 0) + value);
+ for (const line of trialBalance) {
+ if (!controlAccountIds.has(line.accountId)) {
+ add(line.accountId, netDebit(line));
+ }
+ }
+ for (const row of rows) add(row.accountId, row.carbon);
+ const outOfBalance = [...debitByAccount.values()].reduce(
+ (sum, value) => sum + value,
+ 0
+ );
+ add(balancingAccountId, -outOfBalance);
+
+ return [...debitByAccount].flatMap(([accountId, value]) => {
+ const amount = round(value);
+ if (Math.abs(amount) <= EPSILON) return [];
+ return [
+ {
+ accountId,
+ debit: amount > 0 ? amount : 0,
+ credit: amount < 0 ? -amount : 0
+ }
+ ];
+ });
}
/** The layer that opens an item's stock at the cutover. */
diff --git a/packages/database/src/accounting-cutover/trial-balance.ts b/packages/database/src/accounting-cutover/trial-balance.ts
index 2e94bbf364..cbf0d8664a 100644
--- a/packages/database/src/accounting-cutover/trial-balance.ts
+++ b/packages/database/src/accounting-cutover/trial-balance.ts
@@ -556,20 +556,36 @@ export async function setCutoverInvoiceIgnored(
/**
* Sets every control account on the trial balance to Carbon's opening total
- * for it, keeping every other row (`applyCarbonToTrialBalance`).
+ * for it, keeping every other row and putting what that leaves out of balance
+ * on retained earnings (`applyCarbonToTrialBalance`), so Migration Clearing
+ * totals zero.
*/
export async function applyCarbonToOpeningTrialBalance(
db: CutoverDb,
args: CutoverArgs & { userId: string }
): Promise<{ journalId: string }> {
return withTransaction(db, async (trx) => {
- const clearing = await getMigrationClearing(trx, args);
+ const [clearing, defaults] = await Promise.all([
+ getMigrationClearing(trx, args),
+ trx
+ .selectFrom("accountDefault")
+ .select("retainedEarningsAccount")
+ .where("companyId", "=", args.companyId)
+ .executeTakeFirst()
+ ]);
+ const retainedEarnings = defaults?.retainedEarningsAccount;
+ if (!retainedEarnings) {
+ throw new Error(
+ "Set the Retained Earnings default account before applying Carbon's totals"
+ );
+ }
return saveOpeningTrialBalance(trx, {
...args,
lines: applyCarbonToTrialBalance(
clearing.trialBalance,
clearing.rows,
- clearing.controlAccountIds
+ clearing.controlAccountIds,
+ retainedEarnings
)
});
});
diff --git a/packages/ee/AGENTS.md b/packages/ee/AGENTS.md
index 88fe08b05e..929fdb5f14 100644
--- a/packages/ee/AGENTS.md
+++ b/packages/ee/AGENTS.md
@@ -64,7 +64,7 @@ pnpm --filter @carbon/ee typecheck
- **Truthful ledger**: a drain no-op with no remote copy closes `Skipped` via `skipOperation()` (reason in `errorMessage`), never `Completed`; `Skipped → Pending` retry is allowed
- **Rillet idempotency keys are entity-scoped**: `buildRilletIdempotencyKey({companyId, operation, localId})` — the payload is deliberately NOT hashed, so a crash-retry with a drifted payload cannot double-create the remote document
- **Tie-out remote reads**: `accounting/core/remote-journal.ts` `fetchRemoteJournalTotals()` — provider-agnostic debit-signed per-account journal totals for the reconciliation tie-out
-- **Trial balance pull**: `accounting/core/remote-trial-balance.ts` `pullTrialBalanceFromProvider(client, db, { companyId, providerId, asOfDate })` → `{ lines, unmapped, ambiguous }` on Carbon accounts, for the accounting activation wizard. `fetchRemoteTrialBalance()` dispatches like `fetchRemoteJournalTotals` (Xero `/Reports/TrialBalance` YTD columns, QBO `/reports/TrialBalance` Debit/Credit; Rillet `supported: false`). The parsers and the pure mapper `mapRemoteTrialBalance` (mapping by external id → mapping by code → Carbon account number; several targets = ambiguous) live in `core/trial-balance.ts`. Failures throw `TrialBalancePullError` with a `reason` (`not_connected`/`unsupported`/`reconnect`/`rate_limited`/`failed`). `isTrialBalanceProvider(id)` says which providers the dispatch reads (the ERP shows the Pull button by it; `remote-trial-balance.test.ts` pins the two together). Xero needs the `accounting.reports.trialbalance.read` scope; older tokens get `reconnect`
+- **Trial balance pull**: `accounting/core/remote-trial-balance.ts` `pullTrialBalanceFromProvider(client, db, { companyId, providerId, asOfDate })` → `{ lines, unmapped, ambiguous }` on Carbon accounts, for the accounting activation wizard. `fetchRemoteTrialBalance()` dispatches like `fetchRemoteJournalTotals` (Xero `/Reports/TrialBalance` YTD columns, QBO `/reports/TrialBalance` Debit/Credit, Rillet `/reports/trial-balance` for the year to the date in its subsidiary — `parseRilletTrialBalance` reads `ending_balance` debit-signed or natural-signed by `/accounts` type, whichever agrees with each account's movement and totals zero, else throws). The parsers and the pure mapper `mapRemoteTrialBalance` (mapping by external id → mapping by code → Carbon account number; several targets = ambiguous) live in `core/trial-balance.ts`. Failures throw `TrialBalancePullError` with a `reason` (`not_connected`/`unsupported`/`reconnect`/`rate_limited`/`failed`). `isTrialBalanceProvider(id)` says which providers the dispatch reads (the ERP shows the Pull button by it; `remote-trial-balance.test.ts` pins the two together). Xero needs the `accounting.reports.trialbalance.read` scope; older tokens get `reconnect`
- **Dependency sync**: transaction syncers use `ensureDependencySynced()` for JIT deps (e.g. push customer before invoice)
- **Master data import**: ALL THREE accounting descriptors (`src/{rillet,xero,quickbooks}/config.tsx`) declare `actions` posting to `/api/integrations/master-sync?provider=…&direction=…`, which fires `accounting-master-sync` (`@carbon/jobs`). It is the only on-demand PULL of master data — every `build*SyncConfig` still forces customer/vendor `push-to-accounting`, and the job enqueues `pull-from-accounting` ledger rows by hand. Enumeration goes through `provider.listRemoteEntityIds` + `capabilities.importableEntities` (`providerSupportsMasterDataImport` needs both), so adding a provider needs no edit to the job. `RilletCustomerSyncer`/`RilletVendorSyncer` implement `mapToLocal`/`upsertLocal` for it and extend `RilletEntitySyncer`; the pull rejections now live in `RilletPushOnlyEntitySyncer` (item + every transaction syncer). Importing exists to write the mapping row: `upsertRemote` reads `getRemoteId(localId)` first, so a Carbon sales invoice for an imported customer PUTs the original Rillet customer instead of creating a duplicate
- **Permissions** (`./permissions.server`, `src/permissions.server.ts`): the licensed RBAC-authoring logic, gated to Business via the `PERMISSIONS` feature. `updatePermissions` (builds/persists the flattened `userPermission.permissions` object + audit diff + claims-cache bust), `updateEmployee`, employee-type CRUD (`insert/upsert/deleteEmployeeType`, `upsertEmployeeTypePermissions`), and the translators (`makeEmptyPermissionsFromModules`, `makeCompanyPermissionsFromClaims`, `makeCompanyPermissionsFromEmployeeType`). This is the ONLY copy of `updatePermissions` — the `@carbon/jobs` `carbon/update-permissions` (bulk-edit) task imports it here. **Server-only.** The ERP authoring UI stays `.ee.tsx` in `apps/erp` (couples to `~/components/Form`); routes stay in the app and gate with `requireFeature({ feature: "PERMISSIONS" })`. The community invite primitives (`setUserPermissions`, `makePermissionsFromEmployeeType`) deliberately stay in the app's `users.server.ts`. Console/kiosk mode is a sibling: `./console.server` — `updateConsoleSetting(client, db, companyId, enabled, userId?)` → `{ error, pin, pinError }` writes `companySettings.consoleEnabled` over `db` (a trigger refuses API-role writes) behind `requireEntitlement("PERMISSIONS")`, provisions the protected "Console Operator" employee type and a PIN for the enabling user (returned once as `pin`; `pinError` when it could not be created); `isConsoleModeEnabledForCompany(client, companyId, { consoleEnabled? })` is the runtime DEGRADE gate (flag AND entitlement; `null` when the settings read failed — never tear a live console session down on `null`); `generateConsolePin`, `setEmployeePin(db, …)`, `verifyEmployeePin(db, …)` → `{ hasPin, valid }` work on the bcrypt `employeePin` table, reachable only over the server's Kysely connection.
diff --git a/packages/ee/src/accounting/core/remote-trial-balance.test.ts b/packages/ee/src/accounting/core/remote-trial-balance.test.ts
index 62b84c9c68..33774c9b50 100644
--- a/packages/ee/src/accounting/core/remote-trial-balance.test.ts
+++ b/packages/ee/src/accounting/core/remote-trial-balance.test.ts
@@ -160,22 +160,78 @@ describe("fetchRemoteTrialBalance", () => {
expect(url.searchParams.has("minorversion")).toBe(true);
});
- it("reports Rillet as unsupported without calling it", async () => {
+ it("reads Rillet's trial balance for the year to the date, in its subsidiary", async () => {
const rillet = new RilletProvider({
companyId: "company-1",
- credentials: { type: "apiKey", apiKey: "key", environment: "production" },
+ credentials: {
+ type: "apiKey",
+ apiKey: "key",
+ environment: "production",
+ providerMetadata: { subsidiaryId: "sub-1" }
+ },
syncConfig: DEFAULT_SYNC_CONFIG
});
+ const money = (amount: string) => ({ amount, currency: "USD" });
+ fetchMock.mockImplementation(async (input) => {
+ const url = new URL(String(input));
+ if (url.pathname.endsWith("/accounts")) {
+ return jsonResponse({
+ accounts: [
+ { id: "a-cash", code: "1000", name: "Cash", type: "ASSET" },
+ { id: "a-ap", code: "2000", name: "Payables", type: "LIABILITY" }
+ ]
+ });
+ }
+ return jsonResponse({
+ accounts: [
+ {
+ id: "a-cash",
+ code: "1000",
+ name: "Cash",
+ beginning_balance: money("0.00"),
+ debit_total: money("500.00"),
+ credit_total: money("0.00"),
+ ending_balance: money("500.00")
+ },
+ {
+ id: "a-ap",
+ code: "2000",
+ name: "Payables",
+ beginning_balance: money("0.00"),
+ debit_total: money("0.00"),
+ credit_total: money("500.00"),
+ ending_balance: money("500.00")
+ }
+ ]
+ });
+ });
- expect(await fetchRemoteTrialBalance(rillet, "2026-09-30")).toEqual({
- supported: false
+ const result = await fetchRemoteTrialBalance(rillet, "2026-09-30");
+
+ // `ending_balance` was natural-signed here: the payable is a credit.
+ expect(result).toEqual({
+ supported: true,
+ rows: [
+ { externalId: "a-cash", code: "1000", name: "Cash", debitSigned: 500 },
+ {
+ externalId: "a-ap",
+ code: "2000",
+ name: "Payables",
+ debitSigned: -500
+ }
+ ]
});
- expect(fetchMock).not.toHaveBeenCalled();
+ const report = fetchMock.mock.calls
+ .map((call) => new URL(String(call[0])))
+ .find((url) => url.pathname.endsWith("/reports/trial-balance"))!;
+ expect(report.searchParams.get("from_date")).toBe("2025-10-01");
+ expect(report.searchParams.get("to_date")).toBe("2026-09-30");
+ expect(report.searchParams.get("subsidiary_id")).toBe("sub-1");
});
- it("offers the pull for exactly the providers it reads", () => {
+ it("offers the pull for every provider it reads", () => {
// The wizard shows the button by `isTrialBalanceProvider`; the tests
- // above show which providers `fetchRemoteTrialBalance` reads.
+ // above show that `fetchRemoteTrialBalance` reads each of these.
const rillet = new RilletProvider({
companyId: "company-1",
credentials: { type: "apiKey", apiKey: "key", environment: "production" },
@@ -183,6 +239,6 @@ describe("fetchRemoteTrialBalance", () => {
});
expect(isTrialBalanceProvider(makeXero().id)).toBe(true);
expect(isTrialBalanceProvider(makeQbo().id)).toBe(true);
- expect(isTrialBalanceProvider(rillet.id)).toBe(false);
+ expect(isTrialBalanceProvider(rillet.id)).toBe(true);
});
});
diff --git a/packages/ee/src/accounting/core/remote-trial-balance.ts b/packages/ee/src/accounting/core/remote-trial-balance.ts
index 5994f8281f..40b54dee75 100644
--- a/packages/ee/src/accounting/core/remote-trial-balance.ts
+++ b/packages/ee/src/accounting/core/remote-trial-balance.ts
@@ -8,6 +8,7 @@ import { parseDate } from "@internationalized/date";
import type { SupabaseClient } from "@supabase/supabase-js";
import type { AccountingProvider } from "../providers";
import { QboProvider } from "../providers/quickbooks-online";
+import { RilletProvider } from "../providers/rillet";
import { XeroProvider } from "../providers/xero";
import { getAccountMappings, getCompanyGroupId } from "./account-mapping";
import type { ProviderID } from "./models";
@@ -29,13 +30,8 @@ import {
* debit-signed per remote account. Dispatches on the concrete provider class,
* the same discrimination `fetchRemoteJournalTotals` uses.
*
- * Rillet resolves `supported: false`. Its API has
- * `GET /reports/trial-balance?from_date&to_date` returning per-account
- * `beginning_balance` / `debit_total` / `credit_total` / `ending_balance`,
- * but the docs state neither the sign of `ending_balance` nor whether profit
- * and loss accounts are closed into retained earnings at year end — and the
- * opening balance depends on both. Wire it once those are confirmed against a
- * real Rillet ledger.
+ * Rillet's `ending_balance` sign is not documented; `parseRilletTrialBalance`
+ * reads it the way the report itself agrees with.
*
* Provider errors propagate (AccountingApiError, AccountingAuthError,
* RatelimitError); `pullTrialBalanceFromProvider` turns them into a
@@ -53,6 +49,10 @@ export async function fetchRemoteTrialBalance(
return { supported: true, rows: await provider.getTrialBalance(asOfDate) };
}
+ if (provider instanceof RilletProvider) {
+ return { supported: true, rows: await provider.getTrialBalance(asOfDate) };
+ }
+
return { supported: false };
}
diff --git a/packages/ee/src/accounting/core/trial-balance.test.ts b/packages/ee/src/accounting/core/trial-balance.test.ts
index 7a49cdb717..7348c2628c 100644
--- a/packages/ee/src/accounting/core/trial-balance.test.ts
+++ b/packages/ee/src/accounting/core/trial-balance.test.ts
@@ -7,6 +7,7 @@ import {
mapRemoteTrialBalance,
parseQboTrialBalance,
parseReportAmount,
+ parseRilletTrialBalance,
parseXeroTrialBalance,
type QboTrialBalanceResponse,
type RemoteTrialBalanceRow,
@@ -404,6 +405,94 @@ describe("parseQboTrialBalance", () => {
});
});
+describe("parseRilletTrialBalance", () => {
+ const money = (amount: string) => ({ amount, currency: "USD" });
+ const account = (
+ id: string,
+ beginning: string,
+ debit: string,
+ credit: string,
+ ending: string
+ ) => ({
+ id,
+ code: id.toUpperCase(),
+ name: id,
+ beginning_balance: money(beginning),
+ debit_total: money(debit),
+ credit_total: money(credit),
+ ending_balance: money(ending)
+ });
+ const types = new Map([
+ ["cash", "ASSET"],
+ ["ap", "LIABILITY"],
+ ["equity", "EQUITY"]
+ ]);
+ const balances = (
+ rows: { externalId: string | null; debitSigned: number }[]
+ ) => Object.fromEntries(rows.map((row) => [row.externalId, row.debitSigned]));
+
+ it("reads debit-signed balances as they are", () => {
+ const rows = parseRilletTrialBalance(
+ {
+ accounts: [
+ account("cash", "100.00", "50.00", "0.00", "150.00"),
+ account("ap", "-40.00", "0.00", "50.00", "-90.00"),
+ account("equity", "-60.00", "0.00", "0.00", "-60.00")
+ ]
+ },
+ types
+ );
+ expect(balances(rows)).toEqual({ cash: 150, ap: -90, equity: -60 });
+ });
+
+ it("flips natural-signed balances on credit-natured accounts", () => {
+ const rows = parseRilletTrialBalance(
+ {
+ accounts: [
+ account("cash", "100.00", "50.00", "0.00", "150.00"),
+ account("ap", "40.00", "0.00", "50.00", "90.00"),
+ account("equity", "60.00", "0.00", "0.00", "60.00")
+ ]
+ },
+ types
+ );
+ expect(balances(rows)).toEqual({ cash: 150, ap: -90, equity: -60 });
+ });
+
+ it("refuses a report that agrees with neither reading", () => {
+ expect(() =>
+ parseRilletTrialBalance(
+ {
+ accounts: [
+ account("cash", "100.00", "50.00", "0.00", "150.00"),
+ account("ap", "-40.00", "0.00", "50.00", "-40.00")
+ ]
+ },
+ types
+ )
+ ).toThrow(/does not balance/);
+ });
+
+ it("reads the FX totals as movement", () => {
+ const rows = parseRilletTrialBalance(
+ {
+ accounts: [
+ {
+ ...account("cash", "0.00", "10.00", "0.00", "12.00"),
+ debit_fx_total: money("2.00")
+ },
+ {
+ ...account("ap", "0.00", "0.00", "10.00", "-12.00"),
+ credit_fx_total: money("2.00")
+ }
+ ]
+ },
+ types
+ );
+ expect(balances(rows)).toEqual({ cash: 12, ap: -12 });
+ });
+});
+
describe("mapRemoteTrialBalance", () => {
const accounts = [
{ id: "a-bank", number: "1000", isGroup: false, active: true },
diff --git a/packages/ee/src/accounting/core/trial-balance.ts b/packages/ee/src/accounting/core/trial-balance.ts
index 564e6bf1e6..c02e3dc0e7 100644
--- a/packages/ee/src/accounting/core/trial-balance.ts
+++ b/packages/ee/src/accounting/core/trial-balance.ts
@@ -38,7 +38,8 @@ export type RemoteTrialBalanceRow = {
*/
const TRIAL_BALANCE_PROVIDERS: ReadonlySet<string> = new Set<ProviderID>([
ProviderID.XERO,
- ProviderID.QUICKBOOKS
+ ProviderID.QUICKBOOKS,
+ ProviderID.RILLET
]);
export function isTrialBalanceProvider(id: string): id is ProviderID {
@@ -307,6 +308,123 @@ export function parseQboTrialBalance(
return result;
}
+// ---------------------------------------------------------------------------
+// Rillet — GET /reports/trial-balance?from_date&to_date[&subsidiary_id]
+// ---------------------------------------------------------------------------
+
+type RilletAmount = { amount?: string | null } | null | undefined;
+
+export type RilletTrialBalanceAccount = {
+ id?: string | null;
+ code?: string | null;
+ name?: string | null;
+ beginning_balance?: RilletAmount;
+ debit_total?: RilletAmount;
+ credit_total?: RilletAmount;
+ debit_fx_total?: RilletAmount;
+ credit_fx_total?: RilletAmount;
+ ending_balance?: RilletAmount;
+};
+
+export type RilletTrialBalanceResponse = {
+ accounts?: RilletTrialBalanceAccount[] | null;
+};
+
+/** Rillet's account types; the natural side of each decides its sign. */
+export type RilletAccountType =
+ | "ASSET"
+ | "LIABILITY"
+ | "EQUITY"
+ | "EXPENSE"
+ | "INCOME";
+
+const RILLET_CREDIT_NATURED = new Set(["LIABILITY", "EQUITY", "INCOME"]);
+
+/** Half a cent: report amounts are rounded to the currency's decimals. */
+const REPORT_TOLERANCE = 0.005;
+
+/**
+ * Reduce Rillet's trial balance to one row per account, the balance at the
+ * report's `to_date`.
+ *
+ * Rillet's docs do not say how `ending_balance` is signed, so the parser
+ * reads it both ways — debit-signed, and positive on each account's natural
+ * side (credit for LIABILITY, EQUITY and INCOME, by `accountTypes`) — and
+ * keeps the reading that agrees with the report itself: every account's
+ * `ending − beginning` must equal its period movement signed the same way,
+ * and the debit-signed balances must total zero. When neither reading
+ * agrees, or both do and give different balances, it throws rather than
+ * guess.
+ */
+export function parseRilletTrialBalance(
+ response: RilletTrialBalanceResponse,
+ accountTypes: ReadonlyMap<string, string>
+): RemoteTrialBalanceRow[] {
+ const accounts = (response.accounts ?? []).map((account) => {
+ const debits =
+ parseReportAmount(account.debit_total?.amount) +
+ parseReportAmount(account.debit_fx_total?.amount);
+ const credits =
+ parseReportAmount(account.credit_total?.amount) +
+ parseReportAmount(account.credit_fx_total?.amount);
+ const creditNatured = RILLET_CREDIT_NATURED.has(
+ accountTypes.get(account.id ?? "") ?? ""
+ );
+ return {
+ account,
+ creditNatured,
+ beginning: parseReportAmount(account.beginning_balance?.amount),
+ ending: parseReportAmount(account.ending_balance?.amount),
+ movement: debits - credits
+ };
+ });
+
+ // A reading turns a reported amount into a debit-signed one.
+ const readings = {
+ debitSigned: (amount: number) => amount,
+ natural: (amount: number, creditNatured: boolean) =>
+ creditNatured ? -amount : amount
+ };
+ const agrees = (read: (amount: number, creditNatured: boolean) => number) => {
+ let total = 0;
+ for (const row of accounts) {
+ const change =
+ read(row.ending, row.creditNatured) -
+ read(row.beginning, row.creditNatured);
+ if (Math.abs(change - row.movement) > REPORT_TOLERANCE) return false;
+ total += read(row.ending, row.creditNatured);
+ }
+ return Math.abs(total) <= REPORT_TOLERANCE * Math.max(accounts.length, 1);
+ };
+
+ const debitSignedAgrees = agrees(readings.debitSigned);
+ const naturalAgrees = agrees(readings.natural);
+ const toRows = (read: (amount: number, creditNatured: boolean) => number) =>
+ accounts.map(({ account, creditNatured, ending }) => ({
+ externalId: account.id ? account.id : null,
+ code: account.code ? account.code : null,
+ name: account.name?.trim() || account.code || "",
+ debitSigned: round(read(ending, creditNatured))
+ }));
+
+ if (debitSignedAgrees && naturalAgrees) {
+ const a = toRows(readings.debitSigned);
+ const b = toRows(readings.natural);
+ // Equal when no credit-natured account carries a balance.
+ if (a.every((row, index) => row.debitSigned === b[index]!.debitSigned)) {
+ return a;
+ }
+ throw new Error(
+ "Rillet's trial balance can be read with either sign; enter the balances by hand"
+ );
+ }
+ if (debitSignedAgrees) return toRows(readings.debitSigned);
+ if (naturalAgrees) return toRows(readings.natural);
+ throw new Error(
+ "Rillet's trial balance does not balance as read; enter the balances by hand"
+ );
+}
+
// ---------------------------------------------------------------------------
// Mapping onto Carbon accounts
// ---------------------------------------------------------------------------
diff --git a/packages/ee/src/accounting/providers/rillet/provider.ts b/packages/ee/src/accounting/providers/rillet/provider.ts
index 7f01651aa7..d7940af5a3 100644
--- a/packages/ee/src/accounting/providers/rillet/provider.ts
+++ b/packages/ee/src/accounting/providers/rillet/provider.ts
@@ -3,12 +3,18 @@
// (packages/ee/LICENSE). Not AGPL. Running, modifying, or copying it beyond those terms requires a commercial license.
import { createHash } from "node:crypto";
+import { parseDate } from "@internationalized/date";
import type {
CounterpartSearchKeys,
ExternalIdentityKind,
RemoteCandidate
} from "../../core/counterpart-types";
import { ProviderID } from "../../core/models";
+import {
+ parseRilletTrialBalance,
+ type RemoteTrialBalanceRow,
+ type RilletTrialBalanceResponse
+} from "../../core/trial-balance";
import type {
AccountingEntityType,
AuthProvider,
@@ -591,6 +597,48 @@ export class RilletProvider extends BaseProvider {
}
}
+ /**
+ * The trial balance as at `date` (YYYY-MM-DD), one row per account
+ * (GET /reports/trial-balance), scoped to the configured subsidiary. The
+ * report covers the year to `date`, so most accounts move in it: that
+ * movement is how `parseRilletTrialBalance` tells which sign
+ * `ending_balance` uses. Account types come from GET /accounts, inactive
+ * accounts included, since a closed account can still carry a balance.
+ */
+ async getTrialBalance(date: string): Promise<RemoteTrialBalanceRow[]> {
+ const params = new URLSearchParams({
+ from_date: parseDate(date)
+ .subtract({ years: 1 })
+ .add({ days: 1 })
+ .toString(),
+ to_date: date
+ });
+ if (this.subsidiaryId) params.set("subsidiary_id", this.subsidiaryId);
+
+ const [report, accounts] = await Promise.all([
+ this.request<RilletTrialBalanceResponse>(
+ "GET",
+ `/reports/trial-balance?${params.toString()}`
+ ),
+ this.request<{ accounts?: Rillet.Account[] }>("GET", "/accounts")
+ ]);
+ if (report.error || !report.data) {
+ throwRilletApiError("read trial balance", report);
+ }
+ if (accounts.error) {
+ throwRilletApiError("list accounts", accounts);
+ }
+
+ return parseRilletTrialBalance(
+ report.data,
+ new Map(
+ (accounts.data?.accounts ?? []).flatMap((account) =>
+ account.type ? [[account.id, account.type] as const] : []
+ )
+ )
+ );
+ }
+
/**
* Fetch the Rillet subsidiaries (multi-entity ledger; the configured
* `providerMetadata.subsidiaryId` scopes every pushed document). Returns
diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.po
index 74e51be49e..8025c2b979 100644
--- a/packages/locale/locales/de/erp.po
+++ b/packages/locale/locales/de/erp.po
@@ -15138,8 +15138,8 @@ msgstr "Ein"
msgid "On {sentDate}"
msgstr "An"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "Auf einem Kontrolkonto eröffnet Carbon den Saldo aus seinen offenen Positionen, Beständen und Anlagegut. Die Probebilanz muss sich decken: jede Differenz bleibt auf Migration Clearing, welche insgesamt null betragen muss. Öffnen Sie ein Konto, um seine Artikel anzuzeigen, und ignorieren Sie eine Rechnung, die das Vorsystem bereits abgewickelt hat."
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "Auf einem Steuerkonto öffnet Carbon den Saldo aus seinen eigenen offenen Artikeln, Beständen und Anlagegütern. Die Rohbilanz muss übereinstimmen: jede Differenz verbleibt auf Migration Clearing, das insgesamt Null sein muss. Öffnen Sie ein Konto, um seine Artikel anzuzeigen, und ignorieren Sie eine Rechnung, die das vorherige System bereits beglichen hat. Auf Rohbilanz anwenden setzt jedes Steuerkonto auf Carbons Gesamtbetrag und legt den Rest auf Gewinnvortrag ab."
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "Bei einer Umlagerungs-Kanban ist die Mindestmenge für die Ziel-Lagereinheit der Schwellwert. Wenn der verfügbare Bestand plus offene eingehende Umlagerungen darunter fällt, erstellt Carbon eine ausgelöste Umlagerung für die Kanban-Menge."
diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.po
index a07a5126c4..be9929d01c 100644
--- a/packages/locale/locales/en/erp.po
+++ b/packages/locale/locales/en/erp.po
@@ -15138,8 +15138,8 @@ msgstr "On"
msgid "On {sentDate}"
msgstr "On {sentDate}"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.po
index d0643f35e0..8099d97488 100644
--- a/packages/locale/locales/es/erp.po
+++ b/packages/locale/locales/es/erp.po
@@ -15138,8 +15138,8 @@ msgstr "Activado"
msgid "On {sentDate}"
msgstr "El {sentDate}"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "En una cuenta de control, Carbon calcula el saldo de sus propias partidas abiertas, inventario y activos fijos. El saldo de prueba debe coincidir: cada diferencia se mantiene en Liquidación de Migración, que debe sumar cero. Abra una cuenta para ver sus partidas e ignore una factura que el sistema anterior ya liquidó."
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "En una cuenta de control, Carbon abre el saldo de sus propios artículos abiertos, inventario y activos fijos. La balanza de comprobación debe coincidir: cada diferencia se mantiene en Compensación de migración, que debe totalizar cero. Abra una cuenta para ver sus artículos e ignore una factura que el sistema anterior ya pagó. Aplicar a Balanza de comprobación establece cada cuenta de control al total de Carbon y coloca lo que queda en Resultados acumulados."
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "En un kanban de transferencia, la cantidad mínima para la unidad de almacenamiento de destino. Cuando las existencias disponibles más las transferencias entrantes abiertas caen por debajo de esto, Carbon crea una transferencia de existencias Liberada por la cantidad del kanban."
diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.po
index a8f8f0e3a6..1de164c3df 100644
--- a/packages/locale/locales/fr/erp.po
+++ b/packages/locale/locales/fr/erp.po
@@ -12961,7 +12961,7 @@ msgid "Map Lines Now"
msgstr "Mapper les lignes maintenant"
msgid "Map these accounts in the {providerName} integration settings and pull again, or enter their balances below."
-msgstr "Mettez en correspondance ces comptes dans les paramètres {providerName} et récupérez à nouveau, ou entrez leurs soldes ci-dessous."
+msgstr "Mettez en correspondance ces comptes dans les paramètres de l'intégration {providerName} et récupérez à nouveau, ou entrez leurs soldes ci-dessous."
msgid "Map your chart of accounts to the provider's. Posting-default and expense accounts are marked Required; posted journals push using the mapped provider account code."
msgstr "Mappez votre plan comptable au plan comptable du fournisseur. Les comptes de comptabilisation par défaut et les comptes de charge sont marqués Requis ; les écritures comptabilisées utilisent le code de compte du fournisseur mappé."
@@ -15138,8 +15138,8 @@ msgstr "Activé"
msgid "On {sentDate}"
msgstr "Le {sentDate}"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "Sur un compte de contrôle, Carbon récupère le solde à partir de ses articles non fermés, des stocks et des immobilisations. La balance de vérification doit correspondre : toute différence reste sur Migration Clearing, qui doit totaliser zéro. Ouvrez un compte pour voir ses articles, et ignorez une facture que le système précédent a déjà apurée."
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "Sur un compte de contrôle, Carbon ouvre le solde de ses propres articles ouverts, ses stocks et ses immobilisations. La balance de vérification doit correspondre : chaque différence reste sur Rapprochement de migration, qui doit totaliser zéro. Ouvrez un compte pour voir ses articles, et ignorez une facture que le système antérieur a déjà réglée. Appliquer à la Balance de vérification définit chaque compte de contrôle au total de Carbon et place ce qui reste sur Report à nouveau."
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "Sur un kanban de transfert, la quantité minimale pour l'unité de stockage de destination. Lorsque le stock disponible plus les transferts entrants ouverts descend au-dessous, Carbon crée un transfert de stock lancé pour la quantité du kanban."
diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.po
index 8498e18810..c523361756 100644
--- a/packages/locale/locales/hi/erp.po
+++ b/packages/locale/locales/hi/erp.po
@@ -15138,8 +15138,8 @@ msgstr "चालू"
msgid "On {sentDate}"
msgstr "{sentDate} को"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "एक नियंत्रण खाते पर, Carbon अपने खुले आइटम्स, इन्वेंटरी और अचल संपत्ति से शेष राशि निकालता है। Trial balance सहमत होना चाहिए: हर अंतर Migration Clearing पर रहता है, जो शून्य होना चाहिए। एक खाता खोलें इसके आइटम्स को देखने के लिए, और एक चालान को अनदेखा करें जो पूर्व प्रणाली पहले ही निपटा चुकी है।"
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "एक नियंत्रण खाते पर, Carbon अपने स्वयं के खुले आइटम, इन्वेंटरी और अचल संपत्ति से शेष राशि खोलता है। परीक्षण संतुलन सहमत होना चाहिए: प्रत्येक अंतर माइग्रेशन क्लीयरिंग पर रहता है, जो कुल शून्य होना चाहिए। एक खाता खोलें इसके आइटम को देखने के लिए, और एक चालान को अनदेखा करें जो पूर्व प्रणाली ने पहले से ही निपटा दिया है। परीक्षण संतुलन पर लागू करें प्रत्येक नियंत्रण खाते को Carbon के कुल में सेट करता है और जो शेष है उसे प्रतिधारित आय पर रखता है।"
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "एक स्थानांतरण कानबान पर, To भंडारण इकाई के लिए न्यूनतम मात्रा। जब हाथ पर प्लस खुली आने वाली स्थानांतरण इससे नीचे चली जाती है, तो Carbon कानबान मात्रा के लिए एक जारी स्टॉक स्थानांतरण बनाता है।"
diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.po
index 47371b81e0..0aa5df15a2 100644
--- a/packages/locale/locales/it/erp.po
+++ b/packages/locale/locales/it/erp.po
@@ -15138,8 +15138,8 @@ msgstr "Attivato"
msgid "On {sentDate}"
msgstr "Acceso"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "Su un conto di controllo, Carbon apre il saldo dalle sue partite aperte, magazzino e cespiti. Il bilancio di verifica deve corrispondere: ogni differenza rimane su Migration Clearing, che deve sommare a zero. Apri un account per vederne gli articoli, e ignora una fattura che il sistema precedente ha già liquidato."
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "Su un conto di controllo, Carbon apre il saldo dai suoi articoli aperti, dal magazzino e dai cespiti. La bilancia di verifica deve concordare: ogni differenza rimane su Compensazione migrazione, che deve totalizzare zero. Apri un conto per visualizzare i suoi articoli e ignora una fattura che il sistema precedente ha già pagato. Applica a Bilancia di verifica imposta ogni conto di controllo al totale di Carbon e mette ciò che rimane su Utili non distribuiti."
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "Su un kanban di trasferimento, la quantità minima per l'unità di stoccaggio di destinazione. Quando la giacenza più i trasferimenti in entrata aperti scendono al di sotto di essa, Carbon crea un trasferimento di giacenza Autorizzato per la quantità del kanban."
diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.po
index aaae636805..7c5151e9b8 100644
--- a/packages/locale/locales/ja/erp.po
+++ b/packages/locale/locales/ja/erp.po
@@ -15138,8 +15138,8 @@ msgstr "オン"
msgid "On {sentDate}"
msgstr "{sentDate}に送信"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "管理勘定では、Carbonはその独自のオープン品目、在庫管理、および固定資産から残高を開きます。試算表は一致する必要があります。すべての差異は移行クリアリングに留まり、合計がゼロになる必要があります。勘定を開いてその品目を確認し、前のシステムで既に決済された請求書を無視してください。"
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "制御勘定では、Carbonは独自のオープン品目、在庫管理および固定資産から残高を開きます。試算表は一致する必要があります。すべての差異は移行クリアリングに留まり、ゼロに合計する必要があります。勘定をオープンして品目を確認し、前のシステムで既に決済した請求書は無視してください。試算表に適用することで、各制御勘定をCarbonの合計に設定し、残りを利益剰余金に配置します。"
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "転送かんばんでは、宛先保管ユニットの最小数量です。手持ちプラス未処理の受信転送がそれ以下に落ちると、Carbon はかんばん数量のためにリリース済の在庫転送を作成します。"
diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.po
index 390af6e205..42e4ed5962 100644
--- a/packages/locale/locales/ko/erp.po
+++ b/packages/locale/locales/ko/erp.po
@@ -15138,8 +15138,8 @@ msgstr "켜짐"
msgid "On {sentDate}"
msgstr "켬"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "통제 계정에서 Carbon은 자신의 미결 항목, 재고 관리 및 고정자산에서 잔액을 가져옵니다. 시산표는 일치해야 합니다. 모든 차이는 Migration Clearing에 남으며, 이는 총계가 0이어야 합니다. 계정을 열어 항목을 확인하고, 이전 시스템에서 이미 정산된 송장은 무시하세요."
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "제어 계정에서 Carbon은 자신의 미결 품목, 재고 관리 및 고정자산에서 잔액을 엽니다. 시산표는 일치해야 합니다: 모든 차이는 마이그레이션 클리어링에 남으며, 총합이 0이어야 합니다. 계정을 열어 품목을 확인하고 이전 시스템에서 이미 결제한 송장을 무시하십시오. 시산표에 적용하면 각 제어 계정을 Carbon의 총계로 설정하고 나머지를 이익잉여금에 배치합니다."
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "이송 칸반에서 도착 보관 단위의 최소 수량입니다. 현재 재고와 미결 인바운드 이송의 합이 이 수준 아래로 내려가면, Carbon은 칸반 수량만큼의 릴리스됨 재고 이송을 생성합니다."
diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.po
index 5fb60e6481..168585384a 100644
--- a/packages/locale/locales/pl/erp.po
+++ b/packages/locale/locales/pl/erp.po
@@ -15138,8 +15138,8 @@ msgstr "Włączone"
msgid "On {sentDate}"
msgstr "W dniu {sentDate}"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "Na koncie kontrolnym Carbon otwiera saldo ze swoich otwartych artykułów, zapasów i środków trwałych. Bilans otwarcia musi się zgadzać: każda różnica pozostaje na Migration Clearing, które musi wynosić zero. Otwórz konto, aby zobaczyć jego artykuły, i zignoruj fakturę rozliczoną przez poprzedni system."
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "Na koncie kontrolnym Carbon otwiera saldo ze swoich otwartych artykułów, zapasów i środków trwałych. Bilans próbny musi się zgadzać: każda różnica pozostaje w Rozliczeniu migracji, które musi w sumie wyniesć zero. Otwórz konto, aby zobaczyć jego artykuły, i zignoruj fakturę, którą poprzedni system już opłacił. Zastosowanie do Bilansu próbnego ustawia każde konto kontrolne na sumę Carbona i umieszcza pozostałość na Zyski zatrzymane."
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "W kanban transferu minimalna ilość dla jednostki magazynowej docelowej. Gdy zapas dostępny plus otwarte przychodzące przesunięcia spadną poniżej tej wartości, Carbon tworzy zwolnione przesunięcie zapasu dla ilości kanban."
diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.po
index ef03295414..b2508fdb30 100644
--- a/packages/locale/locales/pt/erp.po
+++ b/packages/locale/locales/pt/erp.po
@@ -15138,8 +15138,8 @@ msgstr "Ativado"
msgid "On {sentDate}"
msgstr "Ligado"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "Em uma conta de controle, o Carbon exibe o saldo de seus próprios itens em aberto, inventário e ativos fixos. O saldo de verificação deve concordar: cada diferença fica em Limpeza de Migração, que deve somar zero. Abra uma conta para ver seus itens, e ignore uma fatura que o sistema anterior já liquidou."
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "Em uma conta de controle, Carbon abre o saldo de seus próprios itens abertos, inventário e ativos fixos. O saldo de verificação deve concordar: cada diferença permanece em Compensação de migração, que deve totalizar zero. Abra uma conta para ver seus itens e ignore uma fatura que o sistema anterior já liquidou. Aplicar ao Saldo de verificação define cada conta de controle ao total de Carbon e coloca o que sobra em Lucros acumulados."
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "Em um kanban de transferência, a quantidade mínima para a unidade de armazenamento de destino. Quando o estoque em mão mais as transferências de entrada abertas caem abaixo disso, Carbon cria uma transferência de estoque confirmada para a quantidade do kanban."
diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.po
index fc10531127..fcfadbd726 100644
--- a/packages/locale/locales/ru/erp.po
+++ b/packages/locale/locales/ru/erp.po
@@ -15138,8 +15138,8 @@ msgstr "Включено"
msgid "On {sentDate}"
msgstr "На {sentDate}"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "Для контрольного счета Carbon получает остаток из своих открытых документов, запасов и основных средств. Пробный баланс должен совпадать: каждое различие остается на счете миграции, сумма которого должна быть равна нулю. Откройте счет, чтобы увидеть его документы, и игнорируйте счет-фактуру, которую предыдущая система уже обработала."
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "На счёте управления Carbon открывает остаток со своих собственных открытых номенклатур, запасов и основных средств. Пробный баланс должен совпадать: каждое расхождение остаётся на Миграционном клиринге, который должен в итоге равняться нулю. Откройте счёт, чтобы увидеть его номенклатуру, и проигнорируйте счёт-фактуру, которую предыдущая система уже оплатила. Применение к Пробному балансу устанавливает каждый счёт управления на итого Carbon и помещает остаток на Нераспределенную прибыль."
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "На канбане перемещения минимальное количество для целевой единицы хранения. Когда наличие плюс открытые входящие перемещения упадут ниже этого значения, Carbon создает перемещение запаса в объеме канбана."
diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.po
index d78c9dd9ce..e0c75eda13 100644
--- a/packages/locale/locales/tr/erp.po
+++ b/packages/locale/locales/tr/erp.po
@@ -15138,8 +15138,8 @@ msgstr "Açık"
msgid "On {sentDate}"
msgstr "{sentDate} tarihinde"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "Kontrol hesabında, Carbon bakiyeyi kendi açık kalemlerinden, envanterden ve sabit kıymetlerden açar. Deneme dengesi uyuşmalıdır: her fark Göç Temizlemesi'nde kalır, bunun toplamı sıfır olmalıdır. Öğelerini görmek için bir hesabı açın ve önceki sistem tarafından zaten kapatılmış bir faturayı yoksayın."
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "Bir kontrol hesabında, Carbon kendi açık stok kartlarından, envanterinden ve sabit kıymetlerinden bakiye açar. Deneme mizanı uyumlu olmalıdır: her fark Geçiş Takas hesabında kalır ve toplamı sıfır olmalıdır. Stok kartlarını görmek için bir hesabı açın ve önceki sistem tarafından zaten kapatılan bir faturayı yoksayın. Deneme Mizanı'na Uygula işlemi her kontrol hesabını Carbon'un toplamına ayarlar ve kalanı Dağıtılmamış kârlar hesabına koyar."
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "Transfer kanban'ında To depolama birimi için minimum miktar. Eldeki + açık gelen transferler bunun altına düştüğünde, Carbon kanban miktarı için Serbest bırakıldı stok transferi oluşturur."
diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.po
index 987365a73c..e9943fd4aa 100644
--- a/packages/locale/locales/zh/erp.po
+++ b/packages/locale/locales/zh/erp.po
@@ -15138,8 +15138,8 @@ msgstr "开"
msgid "On {sentDate}"
msgstr "打开"
-msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled."
-msgstr "对于控制账户,Carbon 从其自己的未结项目、库存和固定资产中获取期初余额。试算表必须一致:每个差异都保留在迁移清除账户上,必须合计为零。打开一个账户来查看其项目明细,并忽略先前系统已经结清的发票。"
+msgid "On a control account, Carbon opens the balance from its own open items, inventory and fixed assets. The trial balance must agree: every difference stays on Migration Clearing, which must total zero. Open an account to see its items, and ignore an invoice the prior system already settled. Apply to Trial Balance sets each control account to Carbon's total and puts what is left on Retained Earnings."
+msgstr "在控制账户上,Carbon从其自有的未结物料、库存管理和固定资产中开账户余额。试算表必须相符:每个差异都留在迁移清算上,必须总计为零。打开一个账户以查看其物料,并忽略前一个系统已经结清的发票。应用至试算表将每个控制账户设置为Carbon的总计,并将剩余部分放在未分配利润上。"
msgid "On a transfer kanban, the minimum quantity for the To storage unit. When on-hand plus open inbound transfers drops below it, Carbon creates a Released stock transfer for the kanban quantity."
msgstr "在转移看板上,指目标存储单元的最小数量。当现有库存加上未完成的入库调拨降至此水位以下时,Carbon 会创建一个已下达的库存调拨,调拨数量为看板数量。"
diff --git a/packages/server-functions/src/activate-accounting/ignored-invoices.test.ts b/packages/server-functions/src/activate-accounting/ignored-invoices.test.ts
index a0b735788c..f5f8b89ca7 100644
--- a/packages/server-functions/src/activate-accounting/ignored-invoices.test.ts
+++ b/packages/server-functions/src/activate-accounting/ignored-invoices.test.ts
@@ -110,17 +110,26 @@ databaseTest(
await applyCarbonToOpeningTrialBalance(f.db, { ...args, userId: USER });
const { lines } = await getOpeningTrialBalance(f.db, args);
- expect(lines).toEqual([
- expect.objectContaining({
- accountId: f.account("receivables"),
- debit: 100,
- credit: 0
- })
- ]);
+ expect(lines).toHaveLength(2);
+ expect(lines).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ accountId: f.account("receivables"),
+ debit: 100,
+ credit: 0
+ }),
+ // Nothing in the trial balance offset the receivable: the
+ // difference lands on retained earnings.
+ expect.objectContaining({
+ accountId: f.account("retained-earnings"),
+ debit: 0,
+ credit: 100
+ })
+ ])
+ );
const clearing = await getMigrationClearing(f.db, args);
expect(clearing.rows.every((row) => row.difference === 0)).toBe(true);
- // The receivable is still not offset anywhere in the trial balance.
- expect(clearing.total).toBe(-100);
+ expect(clearing.total).toBe(0);
} finally {
await f.cleanup();
}