diff --git a/ui/src/components/OperationPanel.jsx b/ui/src/components/OperationPanel.jsx index 846879f..af453fe 100644 --- a/ui/src/components/OperationPanel.jsx +++ b/ui/src/components/OperationPanel.jsx @@ -490,13 +490,19 @@ function ScaleLedger({ currentTotals, scaleInputs, setScaleInputs, scalePlug, se // Value only: a cumulative price is meaningless -- prices do not add -- and a // second running column for units doubles the width to say something the // value column already implies. + // Accumulates in display order across everything: the immovable segments + // first, then the walk. So it reads as the whole number being built up -- + // billed, then booked, then the baseline, then each adjustment -- and closes + // on Selected total rather than on Adjustable, which is only the part of it + // that can still move. const runningByKey = (() => { const out = new Map() let acc = 0 - for (const e of lines) { acc += e.value || 0; out.set(e.key, acc) } + for (const seg of exclLines) { acc += seg.value || 0; out.set(`final:${seg.name}`, acc) } + for (const e of lines) { acc += e.value || 0; out.set(e.key, acc) } return out })() - const showRunning = !!valueCol && lines.length > 1 + const showRunning = !!valueCol && (lines.length + exclLines.length) > 1 const numCell = 'text-right font-mono tabular-nums whitespace-nowrap px-2' const rule =
@@ -537,6 +543,11 @@ function ScaleLedger({ currentTotals, scaleInputs, setScaleInputs, scalePlug, se {m.key === 'price' ? fmtNum(priceOf(seg), m.dp) : fmtNum(seg[m.key], m.dp)} ))} + {showRunning && ( + + {fmtNum(runningByKey.get(`final:${seg.name}`), 0)} + + )} ))} @@ -572,9 +583,7 @@ function ScaleLedger({ currentTotals, scaleInputs, setScaleInputs, scalePlug, se {measures.map(m => ( {fmtNum(m.current, m.dp)} ))} - {showRunning && ( - {fmtNum(total.value, 0)} - )} + {showRunning && } @@ -588,6 +597,9 @@ function ScaleLedger({ currentTotals, scaleInputs, setScaleInputs, scalePlug, se : fmtNum(grand[m.key], m.dp)} ))} + {showRunning && ( + {fmtNum(grand.value, 0)} + )} )}