pf_app/routes
Paul Trowbridge 7fd07e52d2 Hold price unless somebody names it
Two defaults both moved price when nobody asked:

A qty edit held the dollars, so price absorbed the whole difference -- 10% more
cases at the same revenue is a 9% price cut, and nothing in the figure being
edited shows it. Dollars now follow qty at the current price:
`value = (curValue / curUnits) * unitsIncr`, on the server in resolveIncrs() and
mirrored in the ledger's Result line. A slice with no units has no price to
hold, so there the dollars stay put and the edit is a pure qty change.

`plug` defaulted to 'price' -- volume holds, price moves -- because that is what
the API did before the flag existed. It now defaults to 'volume'. The client's
stored preference is keyed pf_scale_plug_v2, since a browser carrying the old
'price' choice would otherwise go on moving price silently.

The deliberate routes are unchanged and both outrank the above: name the dollars
and the qty together and price falls out of the two, or name a target_price,
which is the Excel form's Edit Price mode. The ledger labels the column that
cannot move `· holds`, which now includes price on a qty edit.

One behaviour to know about: holding price is impossible on a slice whose value
is zero, so a dollar edit there answers 400 with an explanation where before it
quietly moved price. Fail-loud is the point.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 13:43:06 -04:00
..
auth.js Read territory at login, and survive having none 2026-09-18 11:52:00 -04:00
layouts.js Make a pivot layout a thing people own and publish 2026-09-19 14:20:04 -04:00
log.js Record what a write ran against, and the statement it ran 2026-09-18 12:19:40 -04:00
operations.js Hold price unless somebody names it 2026-09-22 13:43:06 -04:00
plans.js Drop Shift years 2026-09-21 12:39:07 -04:00
sources.js Make a pivot layout a thing people own and publish 2026-09-19 14:20:04 -04:00
tables.js Read source columns from pg_catalog, not information_schema 2026-09-18 16:12:05 -04:00
versions.js Manage a version's tags as a list, not one entry at a time 2026-09-22 09:00:27 -04:00