Przejdź do głównej zawartości

StockMovement

Dla: Programista

Typ obiektowyStockMovement

One change of a material stock: a receipt, an issue, a correction or a stock-take adjustment. Its quantities, time and the delivery details of a receipt (price, supplier, delivery document) never change once it is booked, so a sync reads movements by occurredAt. Its links to other records (orderId, productId, elementId, operationId, purchaseOrderId, supplierId) become null when that record is deleted in Prynt, and deleting a material deletes its movements: a periodic full read catches both.

Pola

PoleTypOpis
currencyString

Currency of unitPrice and netValue, a 3-letter code (e.g. PLN): given with the receipt (the currency of the card when none was given) or the currency of the purchase order. Null when unitPrice is null.

deliveredAtDateTime

When the goods were delivered, as the delivery document says — given with the receipt; null when not given. Not occurredAt: that is when the movement was booked, and what occurredFrom reads.

discrepancyReasonStockTakeDiscrepancyReason

Why the stock take found a difference (adjustments only); null otherwise.

documentNumberString

Number of the delivery document (delivery note or supplier invoice) given with the receipt, e.g. "WZ 412/2026"; null when none. With purchaseOrderId it tells a delivery already booked from one still to book (StockMovementFilterInput.documentNumber).

elementIdID

The element of the product; null when not recorded.

idID!

Identifier of the movement.

materialIdID!

The material whose stock moved: a paper, a paint or a foil, by materialType.

materialTypeStockMaterialType!

Kind of material whose stock moved.

netValueFloat

Net value of the goods received, in currency (2 decimals): the quantity received in priceUnit times unitPrice, computed when the receipt was booked — for a purchase-order delivery the quantity of the delivery in the unit of the item, whatever the stock precision rounds off. Null when unitPrice is null, or when a receipt booked by hand in the app gave a unit the material is not counted in.

Wymaga zakresu prices:read.

notesString

Note entered with the movement; null when none.

occurredAtDateTime!

When the movement was booked. What occurredFrom and the OCCURRED_AT sort read. Movements of one material booked within the same moment may sort in another order than the chain of their quantities.

operationIdID

The operation of the element; null when not recorded.

orderIdID

The order the material was issued for; null when none, or when that order was deleted.

priceUnitString

Unit unitPrice is for, as the movement writes it: ark. (a sheet), g or kg (paint), rolki or m (foil) — the unit given with a receipt by hand (the stock unit when none was given) or the unit of the purchase-order item. Not necessarily unit: a paint priced by the kilogram is stocked in grams. A unit the material is not counted in, accepted in the app, stays as it was given. Null when unitPrice is null.

productIdID

The product of the order; null when not recorded.

purchaseOrderIdID

The purchase order whose delivery this receipt booked; null otherwise, or when that purchase order was deleted.

quantityAfterFloat

Stock after the movement, in unit; null for older foil movements recorded without rolls.

quantityBeforeFloat

Stock before the movement, in unit: the stock really there when it was booked, so it equals quantityAfter of the movement of the same material booked just before it. Null for older foil movements recorded without rolls.

quantityChangeFloat

How the stock changed, in unit: positive when it rose (a receipt), negative when it dropped (an issue); quantityAfter minus quantityBefore. Null when either is null.

stockTakeIdID

The stock take whose approval booked this adjustment; null otherwise.

supplierIdID

The supplier the goods were received from: given with a receipt booked by hand, or the supplier of the purchase order for a delivery. Null when not recorded, or when that supplier was deleted in Prynt.

typeStockMovementType!

What moved the stock.

unitStockUnit!

Unit of the quantities: the stock unit of the material.

unitPriceFloat

Net price of one priceUnit of the goods received, in currency (up to 4 decimals): the price given with a receipt booked by hand, or the unit price of the purchase-order item a delivery was received against, as it was when the delivery was booked (a later change of the item leaves it). Null for issues, corrections, stock-take adjustments and receipts booked without a price (also every receipt booked before version 0.33.0).

Wymaga zakresu prices:read.

Używane w