diff --git a/ui/src/components/OperationPanel.jsx b/ui/src/components/OperationPanel.jsx index 8dcb1aa..b36b337 100644 --- a/ui/src/components/OperationPanel.jsx +++ b/ui/src/components/OperationPanel.jsx @@ -277,11 +277,17 @@ function ScaleLedger({ currentTotals, scaleInputs, setScaleInputs, scalePlug, se return grand[key] } + // Every line that has both measures has a price -- a bridge line's is the + // implied price of that initiative's own contribution, which is the number + // that says whether it was a price move or a volume move. Only a line with no + // units has nothing to show, since the price is undefined rather than zero. + const priceOf = (row) => (row && row.units) ? row.value / row.units : null + // measure columns, in ledger order const measures = [ valueCol && { key: 'value', label: valueCol, current: total.value, dp: 2 }, unitsCol && { key: 'units', label: unitsCol, current: total.units, dp: 2 }, - (valueCol && unitsCol) && { key: 'price', label: 'price', current: curPrice, dp: 4, hint: 'holds units' }, + (valueCol && unitsCol) && { key: 'price', label: 'price', current: curPrice, dp: 4, hint: 'value / units' }, ].filter(Boolean) const derived = Object.fromEntries( @@ -383,7 +389,7 @@ function ScaleLedger({ currentTotals, scaleInputs, setScaleInputs, scalePlug, se {measures.map(m => (