Every stock movement of a part in a store, in order, with the balance before and after it and who recorded it, when and…
Every stock movement of a part in a store, in order, with the balance before and after it and who recorded it, when and through what.
balance_after is the store’s quantity of the part once the movement had happened, summed over its whole history in the order occurred_at, created_at, id, so a row reads the same balance whatever period it is asked for in. Ask for one part, or one part and store, at a time.
occurred_at is when the movement happened; recorded_at is when it reached the ledger, and recorded_after_seconds is the gap. A movement recorded from a handset that was offline carries its device_id; one with no device and a long gap was dated earlier by the person who recorded it.
recorded_by_name is the login that recorded the movement and handled_by_name the person who handled the stock. Where nobody was signed in, recorded_by_source says what recorded it: IMPORT, AUTOMATION, APPROVAL, EMAIL, TELEGRAM or SYSTEM. recorded_through is WEB, HANDSET, IMPORT, API or SYSTEM.
document_type is WORK_ORDER, PURCHASE_ORDER, KIT, PROJECT or ASSET where the movement was made against one. A reversal names what it reverses in reverses_transaction_id; a reversed movement names the reversal in reversed_by_transaction_id.

