# StockFigures type


A stock card's figures, one number each.

## Fields

### quantity

[`Decimal!`](/chameleoon-max/type/decimal)

What is physically in the warehouse: the sum of its stock movements.

### reserved

[`Decimal!`](/chameleoon-max/type/decimal)

What is promised to orders and held by open transfer advices, for every batch.

### reservedBySource

[`[StockReservationBySource!]!`](/chameleoon-max/type/stock-reservation-by-source)

`reserved`, split by the external source of the order that holds it, sorted by external source
with null first. The entries sum to `reserved`. The external source is null for an order
without one, and for an open transfer advice. External sources with nothing reserved are left
out.

Priced as 3 external sources, however many it holds.

Costs 3 points plus 3 × one entry's selection.

### available

[`Decimal!`](/chameleoon-max/type/decimal)

What may still be promised. This is not `quantity` minus `reserved`: it is the stock on counted
bins (kind `STOCK` or `RECEIVING`, picking or reserve), less what is reserved on them, less
`waiting`. Blocked, quarantined and expired-under-policy batches and bins of other kinds are
left out. What a transfer advice between the bins of one warehouse holds for a counted bin stays
in: the goods do not leave. It can be more than an order can reserve right now, because a reservation takes only
from picking bins. It is not clamped: a negative value means more is promised than there is.

### waiting

[`Decimal!`](/chameleoon-max/type/decimal)

What confirmed orders still need from this warehouse and could not reserve. It is already taken
off `available`.

### waitingBySource

[`[StockReservationBySource!]!`](/chameleoon-max/type/stock-reservation-by-source)

`waiting`, split by the external source of the order that waits, sorted by external source
with null first. The entries sum to `waiting`. The external source is null for an order without
one. External sources with nothing waiting are left out.

Priced as 3 external sources, however many it holds.

Costs 3 points plus 3 × one entry's selection.

### advised

[`Decimal!`](/chameleoon-max/type/decimal)

What is announced and not yet received: on an open receipt advice, and still to come on an
OPEN transfer advice from another warehouse into this one. A transfer advice line bound for a
bin whose stock does not count (a quarantine or transit bin, for example) is left out. A
transfer advice between the bins of one warehouse brings nothing in, and is not advised.

### onOrder

[`Decimal!`](/chameleoon-max/type/decimal)

What is on a sent purchase order that no open receipt advice announces yet. It never overlaps
`advised`.

## Used by

- [`StockCard`](/chameleoon-max/type/stock-card)
- [`StockCardChange`](/chameleoon-max/type/stock-card-change)
