Skip to content

feat(core): set incoming stock by hand (spec 0082, 2/6) - #2930

Merged
glennjacobs merged 1 commit into
2.xfrom
feat/0082-2-set-incoming-stock
Nov 27, 2026
Merged

glennjacobs merged 1 commit into
2.xfrom
feat/0082-2-set-incoming-stock

Conversation

@glennjacobs

Copy link
Copy Markdown
Contributor

Why

Without a write path, sell_against_incoming would be a dead toggle: incoming stays at 0 in every store without a purchasing add-on.

What changes

  • SetIncomingStock (contract SetsIncomingStock, verb $variant->setIncomingStock($location, $quantity)) sets a location's incoming figure absolutely and refreshes the rollup.
  • It locks the stock level like RecordStockMovement but records no movement, since incoming is an expectation, not part of the on_hand ledger. Negative quantities throw.
  • Inventory reference docs gain a "Setting incoming stock" section.

Stacked PRs for spec 0082, merge in order: 1 → 2 → 3 → 4 → 5 → 6. Each targets the branch of the one before it. This is PR 2 of 6.

@github-project-automation github-project-automation Bot moved this to Todo in Roadmap Nov 26, 2026
@github-actions github-actions Bot added high needs-triage Base branch is not a recognised release line labels Nov 26, 2026
@glennjacobs
glennjacobs added this pull request to stack #2935 November 27, 2026 12:28
Base automatically changed from feat/0082-1-selling-booleans to 2.x November 27, 2026 12:52
SetIncomingStock sets a location's incoming figure absolutely and
refreshes the rollup, behind the SetsIncomingStock contract and a
setIncomingStock() verb on the variant. It locks the stock level like
RecordStockMovement but records no movement: incoming is an
expectation, not part of the on_hand ledger.

Amp-Thread-ID: https://ampcode.com/threads/T-bf4de4ed-1919-4bb7-a0f2-21c0b6f63fb3
Co-authored-by: Amp <amp@ampcode.com>
@glennjacobs
glennjacobs force-pushed the feat/0082-2-set-incoming-stock branch from cdb9e40 to 81b8496 Compare November 27, 2026 12:52
@glennjacobs
glennjacobs merged commit 8f368c6 into 2.x Nov 27, 2026
28 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Nov 27, 2026
@glennjacobs
glennjacobs deleted the feat/0082-2-set-incoming-stock branch November 27, 2026 12:52
@github-actions github-actions Bot added 2.x and removed needs-triage Base branch is not a recognised release line labels Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant