Repository navigation
feat(o2c): invoices and payments run in parallel; Unpaid and Uninvoiced replace the Receivable Balance; overdue on the payment plan (#2806) - #2819
Merged
objectstack-fleet[bot] merged 14 commits intoNov 27, 2026
Conversation
…ed replace the Receivable Balance; overdue on the payment plan (#2806) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
…step on the booted app (#2806) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
…nvoices and payments (#2806) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
…er count is unfilled counts as having none (#2806) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
… overdue plans and the confirmed order's step in the manuals and the docs site; hidden links list nothing (#2806) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
…ined; the two flows on the automation page, in the counts and in the runtime roster (#2806) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
) README.md and docs/STATUS.md keep both sides: main's 56 actions and its fields, this branch's 55 flows and its field change (635 fields, as pnpm validate prints on the merged tree). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
…-parallel (#2806) docs/STATUS.md keeps both sides: 636 fields and 55 flows, as pnpm validate prints on the merged tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
…ninvoiced read its Order Amount (#2806) The maintainer's ruling of 2026-11-27: a contract that has orders computes Unpaid and Uninvoiced from its Order Amount, not its Contract Value; a contract with no order keeps the Contract Value. Invoiced and Received are unchanged: invoices and payments entered on an order already carry the order's contract (row stamp; contract fill flow for a contract set later). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
…n order contract keeps its order's amount (#2806) The maintainer's option B ruling. crm_contract.order_amount sums only Confirmed and Completed orders: it feeds a framework contract's Order Amount, Remaining Quota and the o2c Unpaid/Uninvoiced base, and order_count counts the same set. A new hidden linked_order_amount (every order but Cancelled) keeps #2804's draft follow, Differs from the Order Amount and Update from Order. The record page does not apply visibleWhen in detail sections, so both roll-ups are hidden and one form-dependent formula, order_amount_shown, is the visible Order Amount. The quota warning still checks a Draft as if confirmed, and warns again when confirming takes the contract over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
…unt ruling (#2806) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
Contributor
Author
|
repo:hotcrm#1 · huangyiirene · session_01J8VVAk8tegvAi1ECkgCFfc ACCEPT · 2026-11-27T03:14ZHead-sha: 维护者速读
席位核对
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 27, 2026
…oiced, not the retired Receivable Balance (#2806, #2821) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
Contributor
Author
|
repo:hotcrm#1 · huangyiirene · session_01J8VVAk8tegvAi1ECkgCFfc Re-queue · 2026-11-27T03:33ZHead-sha:
|
13 tasks done
10 of 14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Irene · project thread
Fixes #2806
Clause-②: no
Metadata-protocol: none
Metadata-impact: maintainer — permission sets (crm_user, project_member and the shared Order to Cash figure rows carried from the Receivable Balance to Unpaid and Uninvoiced), fields hidden (payment Invoice; invoice Payment Plan, Paid, Open, Overpaid) and removed (Receivable Balance on contract and account; the plan step's Invoiced), two record-change flows added, seed data changed, hooks unchanged
维护者速读
What changes
The 2026-11-26 ruling, item by item:
relatedList: false). A payment names its Payment Plan, Order or Contract, or the account alone.invoice_figuresand still guarded by the row stamps for API and import writes). The plan step's Invoices list is gone too (relatedList: false). The plan step's own Invoiced summary is removed (it summed the hidden link;os lintflagged it as declared but not displayed).max(). Account: the sum of each deal's own figure, once per deal: Confirmed or Completed orders, plus Activated or Expired contracts that have no order. Stored computed fields, no hook.sales_order_confirmed_plan_step): on the status becoming Confirmed and no step yet, one step for the order total, planned today plus the payment-terms days (same day for Due on Receipt or no terms). Amount change (sales_order_amount_plan_step): the lone step follows the total while nothing is received; otherwise the order shows Payment Plan Differs. Instalments stay manual. No bank reference field.erp_refrule for a receipt split across orders.scripts/compare-unpaid-receivable.ts: the old-vs-new account figures, read-only.PM assumptions, measured. (1) A formula takes a maximum: true,
max(0.0, …)evaluates. (2) The account rolls up a formula on orders: false at runtime.os validateexits 0, but every child write logs thataggregatewill not sum a declared formula field and the query is not run, so the summary goes stale. The stored-computed-field route was taken instead: what the user sees is what the ruling describes, so no decision was needed.Old vs new account figures
pnpm exec tsx scripts/compare-unpaid-receivable.ts --url http://localhost:4112on the dev seed asmainleft it, after the upgrade,os migrate summary-nulls --apply(25 values) andos migrate stored-expressions --object crm_sales_order --object crm_contract --object crm_billing_milestone --object crm_account --apply(17 rows):9 accounts read, 3 with a figure on either side. The old figure is recomputed from the invoices' stored Open (equal to the stored Receivable Balance on
main).main's invoice names only the contract, and under the orders-first rule a contract with an order counts through the order. On a fresh seed of this branch the invoice names the order and the account reads 18,700.Tests
test/o2c-parallel-figures.test.ts(12 tests, booted app): order and account Unpaid and Uninvoiced, the 0 floor, draft and cancelled orders out, payment and amount moves, the seeded contract counted once (then through its order), overdue via the stored Open filter, the confirm flow (Net 30 is day 30, Due on Receipt today, an existing step means none, re-confirm adds none), the amount flow and Payment Plan Differs.Readings
pnpm verifyon b088a54: validate, typecheck, lint --strict, hygiene, build exit 0; vitest 330/338 files, 14 failed tests in 8 files (new flows missing from ledgers and counts, two unguarded flow conditions, an anchor prefix, the activation no-op test).test/docs-*,test/automation*,test/flow-*,test/actions-flows*, 60 files, 1603 passed, 15 skipped; typecheck, lint --strict, hygiene exit 0. The full suite was not rerun on d762604 (CI runs it).Acceptance notes
src/sales/profiles/(the crm_user and project_member rows and the shared Order to Cash figure rows had to move from the removed Receivable Balance to the new fields, or validate fails),src/docs/crm_admin_setup*,src/psa/docs/crm_psa_projects_cost*,docs/STATUS.md,README.mdand the introduction pages (flow and field counts).dependsOn: crm_account, and the browser shows "Select Account first" on it.Verification
Risky hunks, in order:
src/o2c/extensions/contract-account.extension.ts(the account legs and their filters),src/o2c/flows/sales-order-amount-plan-step.flow.ts(when the plan is rewritten),src/sales/profiles/_o2c-figures.ts(who reads the new figures).Two minutes:
pnpm dev, open Acme Corporation, then its order: the account reads Unpaid 238,700 and Uninvoiced 18,700, and the order shows Payment Plan Differs: Yes.🤖 Generated with Claude Code
https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
Seat note — DELIBERATE CORRECTION of an existing changeset
Commit 110d036 (by the seat) edits the unreleased
.changeset/2807-framework-contract-quota.mdso it does not contradict this PR's note in the same release:Why: maintainer ruling 2026-11-27T02:03Z (project thread decision card) — Order Amount and Remaining Quota count only Confirmed and Completed orders. Release text only; no code changed in that commit.