Skip to content

fix(showcase): a EUR invoice's line grid, line table and Subtotal draw in the invoice's currency, not $ (#36005) - #36233

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-ahft2r
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-ahft2r

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

repo:objectstack#1 · os-sales · session_01L6bhgTqpQZctiVye1J87J9

Fixes #36005

Clause-②: no
Metadata-protocol: none

维护者速读

  • 欧元发票 INV-1010:编辑表单的明细表单价、金额,记录页(发票文档页)的明细表,以及「小计」,原来都显示 $,现在跟「含税总额」一样显示 €。日元发票显示 ¥ 且不带小数。
  • 原因不在界面代码:平台早已支持「明细跟随发票币种」(ADR-0144 修订,Sales 裁定 A),只是示例应用 showcase 的发票明细没有声明,于是落到本位币美元。这次只改示例的元数据和测试。
  • 随之生效的平台规则(Sales 已裁定,席位判为小事):发票一旦有明细行,币种锁定,改币种会被拒绝,需先删明细;没有币种的发票不能保存带价格的明细。新建发票表单会自动预填组织币种(USD),日常录单不受影响。

What changes

  • examples/app-showcase/src/data/objects/invoice.object.ts: showcase_invoice_line.unit_price and amount declare currencyConfig: { currencyMode: 'record', currencyField: 'invoice.currency_code' } (ADR-0144 D2 as amended, ADR-0144 amendment: a child row and a roll-up follow the parent record currency through master_detail (ruled A, 6739066323) #31743 ruling A); showcase_invoice.total (the Subtotal roll-up) declares { currencyMode: 'record', currencyField: 'currency_code' } (D6 as amended). The stale comment that said lines could not follow the invoice is replaced.
  • The Console needed no change: the line grid's columnCurrencies, the form totals' totalsCurrency and LineItemsPanel (record:line_items) already resolve a following amount through parentCurrencyFieldsOf / followedColumnCurrencies (ui(currency): render a child row and a roll-up in the parent record currency (ADR-0144 amendment, console half) #31912). The record page's read-only line table had the same $ and the same cause, so it is fixed by the same declaration.
  • New pin examples/app-showcase/test/invoice-line-currency-follows-invoice.test.ts (the three declarations and the path they name).
  • Test fixtures that wrote priced lines under an invoice with no currency_code now give the invoice USD (a following amount under a blank code is refused ERR_CURRENCY_CODE_REQUIRED): examples/app-showcase/test/paid-invoice-line-lock.test.ts (also hands its bare engine the home currency the showcase .env pins) and four dogfood files (master-detail-batch-atomic, showcase-invoice-cbp, showcase-mcp-record-files, showcase-readonly-when-parent). What each test asserts is unchanged.
  • Checklist records-forms.multi-currency-invoice revision 4: knownGaps[0] no longer says the lines stay in the home currency; steps[2] PATCHes a lineless USD draft instead of seed INV-1002 (one line, so its code is now locked). No clause changed.

No changeset: both touched packages (@objectstack/example-showcase, the dogfood suite) are private, so nothing publishes (skip-changeset).

Small calls (dev thread, Sales 22:19:27Z rule)

  1. The currency lock and the blank-code refusal now apply on the showcase invoice. They are the platform's ruled behaviour (ADR-0144 D2 as amended), not new rules; the seat accepted this reading in the claim (7072977562).
  2. The planned checklist item records-forms.master-detail-child-follows-parent-currency is not promoted here: promotion needs a run in which it passes. The showcase invoice is now its fixture.

Verification

  • Browser, stock pnpm dev -- --fresh boot of the showcase, console built from this tree, admin, 1280 px, before (main 48c732c) and after (this branch), files in /mnt/project-files/build-seat1/36005/:
    • Edit form line grid on INV-1010 (EUR): before $ 46 / $230.00 beside "Total incl. Tax €276.00"; after € 46 / €230.00 (before-edit-form-grid-1280.png, after-edit-form-1280.png).
    • Record page line table: before $46.00 / $230.00; after €46.00 / €230.00. The Subtotal on the record page: before a bare 230, after €230.00 (before-record-line-table-1280.png, after-record-line-table-1280.png).
    • API on the same boot: PATCH INV-1010 currency_code EUR → USD answers 400 naming showcase_invoice_line (the lock); a lineless USD draft PATCHed to EUR answers 200; a line with only the required fields under a code-less invoice answers 201, a priced one 400 ERR_CURRENCY_CODE_REQUIRED; JPY INV-1008 stores amount_home 1593.73 as before. The New Invoice form pre-fills Currency USD.
  • examples/app-showcase: pnpm validate OK, pnpm typecheck clean, vitest run 49 files / 554 tests passed.
  • packages/qa/dogfood: the 24 test files that name showcase_invoice: all pass after the fixture edits (four failed before them, all on ERR_CURRENCY_CODE_REQUIRED).
  • pnpm check:platform-checklist OK.

Follow-ups (not in this PR)

  • Picking a product on a EUR invoice copies the product's unit_price (a home-currency amount) into the line as euros: a price-list currency question, for a separate card.
  • The edit form draws the total Subtotal as a plain 230.00 (no symbol) both before and after; the record page draws it €230.00.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset. (nothing publishes)
  • 6. packages/spec touched: regenerated. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 block is the maintainer's summary, in the maintainer's language).

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgTqpQZctiVye1J87J9

…'s currency, not the home one

The invoice lines' unit_price and amount now declare currencyField
`invoice.currency_code` (ADR-0144 D2 as amended), and the `total` Subtotal
declares the invoice's `currency_code` (D6 as amended). The Console already
draws a following amount in the parent's currency: the edit form's line
grid, the record page's line table and the Subtotal now show EUR/JPY where
they showed the home currency's `$`.

Test fixtures that wrote priced lines under a currency-less invoice now give
the invoice a code; checklist item records-forms.multi-currency-invoice rev 4.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTqpQZctiVye1J87J9
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 22, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-sales November 22, 2026 03:00
@github-actions github-actions Bot added the tests label Nov 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json a5a5312ff41dc8cb459b33dbec731c143907db4d → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgVdP6nEyftgTJapu6J

维护者速读

欧元发票的明细、明细合计和记录页上的「小计」,原来显示 $,现在跟发票币种一样显示 €(日元显示 ¥、不带小数)。只改了示例应用 showcase 的元数据和测试,界面代码没动:平台早就支持「明细跟着发票的币种走」,只是示例里没写上。
随之生效的是你已经裁过的平台规则:发票有了明细以后就不能再改币种;没填币种的发票不能存带价格的明细。新建发票表单会自动填上 USD,平时录单不受影响。
L1 结论:通过。席位可以落地。

席位核对 — ACCEPT (L1-d) · repo:objectstack#1 · head df7a9112 · 2026-11-22T03:25Z

Face: example metadata (examples/app-showcase, private) + tests + one checklist item. No ui/, no packages/spec/src/**, no docs/adr/**, no engine code. 8 files, +91 / −17. Clause-②: no, Metadata-protocol: none; skip-changeset is right (both touched packages are private, l1-face reads it). No L2 owed.

Gates at df7a9112: 38 success, 21 expected skip, 0 failed, 0 pending; Lint & Repo Gates and TypeScript Type Check success; mergeable clean. l1-face clean.

Card #36005

  • "Find where the grid's currency cells take their currency": the lines' unit_price / amount and the total Subtotal declared no currencyConfig, so every face fell back to home. The fix declares currencyMode: 'record' with invoice.currency_code on the two line amounts (ADR-0144 D2 as amended, ADR-0144 amendment: a child row and a roll-up follow the parent record currency through master_detail (ruled A, 6739066323) #31743 ruling A) and currency_code on the Subtotal roll-up (D6 as amended). The new comment replaces the stale "lines cannot follow" text and is accurate.
  • "Check whether the read-only body table shows the same mismatch": yes, same cause, fixed by the same declaration; before/after shots of both (edit-form grid $ 46 → € 46, $230.00 → €230.00; record-page line table and Subtotal). I read after-edit-form-grid-1280.png. Fixes is right.

The behaviour that comes with it (checked in origin/main's engine, not re-ruled)

  • packages/objectql/src/record-currency-parent-lock.ts: a change of a followed code that is non-blank → different or blank is refused while any following child row (bin included) exists; setting a code on a blank parent is not a change. So the other checklist step that adds a line to a code-less invoice and then PATCHes it to USD (records-forms.json:6981) still works; the PR did not need to touch it.
  • Seed (examples/app-showcase/src/data/seed/index.ts:397-412): every seeded invoice carries a currency_code, so no seed line is refused and silently dropped by the seeder. The fresh-boot API readings in the body agree (INV-1010 lock 400, lineless draft 200, JPY INV-1008 amount_home unchanged).
  • This flips the showcase invoice's shipped behaviour (lock + blank-code refusal), but it is the platform's ruled rule taking effect on an example, recorded as small call 1 and accepted in the seat's claim 7072977562. Not a hold.

Fixtures and checklist

  • Five fixture edits only add currency_code: 'USD' to the invoice headers (plus a home-currency resolver for the bare engine in paid-invoice-line-lock); no assertion moves.
  • records-forms.multi-currency-invoice rev 4: knownGaps[0] rewritten to the new shape and steps[2] now PATCHes a lineless draft (INV-1002 has a line, so the old step is refused); the history row is accurate; no clause changed. Read sentence by sentence.
  • The new pin test reads the three declarations and the path they name.

Should / nits (no hold)

  • S1. Two live specs outside the CI live list write a new invoice with a priced line through the form: ui/e2e/live/form-view-subforms.spec.ts and grid-file-upload.spec.ts. They pass only because the New Invoice form pre-fills USD (the body's reading); one local run of each, or a line in the body saying so, closes it. master-detail.spec.ts (in the CI list) is green.
  • N1. The two follow-ups in the body (a product's home-currency unit_price copied into a EUR line; the edit form's Subtotal drawn as a bare 230.00) should each be a card, not only a body line (l1-review-checklist.md: follow-ups are filed).

L1 only; no L2 is owed here. The seat lands it.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-22T03:26Z · #36005 (p1): on a EUR showcase invoice, the line items, the line totals and the subtotal now show €, matching the form total. The cause was in the example: the showcase invoice lines and subtotal never declared that they follow the invoice's currency, so they fell back to the base currency. The platform rule (ADR-0144 as amended, #31910–#31912) was already wired, and the console is unchanged. The same declaration fixes the record page's read-only line table.

Reviews:

  • L1-d: ACCEPT FINAL 7073534398 on this head. It checked the engine lock (setting a blank code is not a change, so the checklist step still runs), that the seeded invoices all carry a code, that the five fixtures only add USD without touching assertions, and checklist rev 4 sentence by sentence. S1 is disclosed: two live cases that are not in CI (form-view-subforms, grid-file-upload) pass because a new form pre-fills USD, and they are owed one local run at their next pass. N1: two follow-ups get their own card (a product's base-currency price copied into a EUR line; the edit form's subtotal shown without a symbol).
  • No contract L2: Clause-②: no, Metadata-protocol: none; both touched packages are private (skip-changeset).

Gates on this head (df7a9112):

  • check-governed-merges --pr 36233 reads NOT governed (108 changed lines).
  • K = 3 first-parent commits since the merge base; no translations/ or skills/ path.
  • All check-runs on their latest runs are success (38) or skipped (16); mergeable clean.

The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #36005.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 03:27
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit efe4436 Nov 22, 2026
60 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-ahft2r branch November 22, 2026 04:02
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…, as the record page does (objectstack-ai#36293)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XP3RHGWUG7UH3fNa4tBa9UC)_

Part of objectstack-ai#36249

Builds Done-when item 2 only. Item 1 (a product's price copied across
currencies) stays open on the card for the maintainer's rule.

Clause-②: no
Metadata-protocol: none

## 维护者速读

在编辑发票表单里,欧元发票的小计原来显示成没有货币符号的「230.00」,现在显示「€230.00」,和记录页、含税合计一致。
这是多币种发票的后续问题,替在示例应用里录入外币发票的用户解决小计看不出币种的问题。
只影响编辑表单里汇总金额的显示,不改存储的数字;出问题可以直接撤回,回到原来的无符号显示。
卡片的另一半(选产品时把本币单价原样抄进欧元明细)需要你定规则,选项和建议在报告里。

## What changes

- `ui/packages/components/src/renderers/form/form.tsx`:
`RECORD_CURRENCY_WIDGET_TYPES` gains `summary`. The form renderer hands
the live form record (`dependentValues`) to a registered widget only
when its type is in that set; `currency` and `formula` were in it,
`summary` was not. `SummaryField` already formats a roll-up that
declares its currency (ADR-0144 D6 as amended) with
`resolveFieldCurrency(field, tenant, dependentValues)`, the same call
the record page's cell (`FormulaCellRenderer` → `CurrencyCellRenderer`)
makes; with no record, a `record`-mode config resolves to no code and
`formatCurrency` prints a bare `230.00`. Now the edit form's subtotal is
drawn by that same code path with the record it needs. The fix is in the
shared host, so every `summary` field that declares a currency on any
form (New / Edit, drawer, modal) gets it; the showcase fixture was
already right (PR objectstack-ai#36233 declared `currencyConfig: { currencyMode:
'record', currencyField: 'currency_code' }` on `total`).
-
`ui/packages/fields/src/__tests__/parentCurrency.faces-31912.test.tsx`:
a new top-level `describe` in the existing D6 harness drives the real
form renderer with the real `SummaryField` / `CurrencyField` /
`TextField`: a EUR record's subtotal reads `€230.00` and its
tax-inclusive total `€276.00`; a USD record reads `$230.00` / `$276.00`.
- `.changeset/36249-form-subtotal-currency.md`: `@object-ui/components`
patch.

Read first, by risk: (1) the one-line set change in `form.tsx`
(`SummaryField` spreads no leftover props onto the DOM, so the new prop
leaks nowhere); (2) the new `describe` at the end of the faces harness.

Two-minute check: `pnpm --dir ui exec vitest run
packages/fields/src/__tests__/parentCurrency.faces-31912.test.tsx`
passes 11/11; remove `'summary'` from the set and the two new cases fail
with `expected 'Subtotal230.00' to contain '€230.00'`.

## Tests

<details><summary>Pin and ablation at d5c341f</summary>

- With the fix: `Test Files 1 passed (1)`, `Tests 11 passed (11)`.
- Ablation (`scripts/ablation-replace.mjs`, anchor hit x1 -> x0, blob
44f1fec -> cee0c300): `Tests 2 failed | 9 passed (11)`,
`AssertionError: expected 'Subtotal230.00' to contain '€230.00'` and
`expected 'Subtotal230.00' to contain '$230.00'`. The tax-inclusive
total cases stayed green in both legs (that face already had the
record). Restored: blob == HEAD, `git diff HEAD` empty. The ui test
config aliases `@object-ui/components` to `src`, so no rebuild sits
between the mutation and the run.

</details>

## Acceptance notes

- Item 1 of the card (a picked product's home-currency `unit_price`
copied into a EUR line) is not built here, as the claim says. The
measurement and the options go to the seat in the report.
- Before this change a home-currency (USD) invoice's subtotal was also
bare on the edit form (`230.00`); it now reads `$230.00`, the record
page's format.
- Seen while verifying, not fixed here: the showcase `en` translation
bundle labels `showcase_invoice.total` "Total" while the object metadata
labels it "Subtotal", so the record page and the edit form show the
pre-tax roll-up as "Total" next to "Total incl. Tax", and the line-grid
stack calls the same figure "Subtotal". Listed in the report for the
seat.

## Verification

<details><summary>Booted showcase, INV-1010 (EUR), edit form, 1280
px</summary>

Own stack: `objectstack dev --seed-admin --fresh -p 4361` in
`examples/app-showcase` on this branch's build, the Console from this
tree's source (`vite --port 5361`, `DEV_PROXY_TARGET` at the backend),
admin, Playwright with the preinstalled Chromium. Both servers stopped
after.

- Before (the fix ablated in the source the Console serves): edit form
`total` reads `Total 230.00`; `Total incl. Tax €276.00`; the line-grid
stack `Subtotal €230.00`.
- After: edit form `total` reads `Total €230.00`; the tax-inclusive
total unchanged at `€276.00`.
- Record page on the same boot: `Total €230.00`.
- Screenshots in the project files:
`build-seat4/36249/before-edit-form-1280.png`,
`after-edit-form-1280.png`.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01FEkQ5okniknzVVR3KTSVr1

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline line grid shows $ on a EUR record while the form total shows €

2 participants