# StockQuant type


What one bin holds of one product variant (and of one lot, when the product tracks lots), in base
units.

## Fields

### variantId

[`UUID!`](/chameleoon-max/type/uuid)

The product variant's MAX id.

### warehouseId

[`UUID!`](/chameleoon-max/type/uuid)

The warehouse's MAX id.

### locationId

[`UUID!`](/chameleoon-max/type/uuid)

The bin's MAX id.

### locationCode

`String!`

The bin's code.

### pickable

`Boolean!`

Whether reservations, and so picking, take from this bin.

### lotId

[`UUID`](/chameleoon-max/type/uuid)

The lot's MAX id. Null without a lot.

### lot

[`Lot`](/chameleoon-max/type/lot)

The lot. Null without one. Requires the `lot.read` permission. Without it, the field is null
with a `FORBIDDEN_ROLE` error at its path, and the rest of the row is returned.

### lotStatus

[`LotStatus`](/chameleoon-max/type/lot-status)

The lot's status. Null without a lot. Requires the `lot.read` permission. Without it, the field
is null with a `FORBIDDEN_ROLE` error at its path, and the rest of the row is returned.

### productVariant

[`ProductVariant`](/chameleoon-max/type/product-variant)

The product variant. Requires the `item.read` permission. Without it, the field is null with a
`FORBIDDEN_ROLE` error at its path, and the rest of the row is returned.

### quantity

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

The quantity on hand in this bin and lot.

### reserved

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

What is reserved on this bin and lot, for orders and open transfer advices.

### free

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

What an issue or a transfer may take from here now: `quantity` minus `reserved`, and at least 0.

- It is not the stock card's `available` ([`StockCard`](/chameleoon-max/type/stock-card)).
- A bin that nobody picks from holds no order reservations, but an open transfer advice may hold
  goods there.

### plannedOut

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

What open outbound instructions still plan to take from this bin and lot beyond what they
already reserve there, in base units.

- It is the remaining quantity of every `OPEN` transfer advice line that names this bin as its
  source, less what that line holds here, whoever wrote the transfer advice. Issue advices will
  add to it once they exist.
- A line without a source bin, or without the lot of a lot-tracked row, is not counted here.
- What a line holds is in `reserved` instead, so `free` minus `plannedOut` counts each unit
  once.

### unplanned

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

What may still be planned out of this bin and lot: `free` minus `plannedOut`, and at least 0.
Plan new transfers from this, not from `free`, so that two transfer advices do not ask for the
same goods.

## Used by

- [`StockQuantConnection`](/chameleoon-max/type/stock-quant-connection)
- [`StockQuantEdge`](/chameleoon-max/type/stock-quant-edge)
