stocktransactions
| Name | Type | Storage | Nullable | Foreign Keys | Default Value & Notes |
|---|---|---|---|---|---|
| PKID | bigint | plain | Stock transaction ID | ||
| creator | integer | plain | users.ID | Creator user ID (defaults to authenticated user on creation) | |
| creationdate | bigint | plain | Default: date_part('epoch', now())Creation date and time as a Unix timestamp (defaults to current date and time on creation) | ||
| lastmodified | bigint | plain | Default: date_part('epoch', now())Last modification date and time as a Unix timestamp (auto-reset on modification) | ||
| item | integer | plain | items.ID | Item ID (**dependency**) | |
| storage | integer | plain | storages.ID | Storage ID | |
| transaction | integer | plain | transactions.ID | Transaction ID | |
| transfer | bigint | plain | stocktransactions.ID | Transfer stock transaction ID; must be distinct from `ID` and `null` for RESERVED | |
| flag | smallint | plain | Default: 0Flag (`0`=BOOKED, `1`=RESERVED, `2`=CANCELLED) | ||
| date | bigint | plain | Default: date_part('epoch', now())Designated date and time as a Unix timestamp (defaults to current date and time on creation) | ||
| chargenum | text | main | Default: ''Charge (lot) number | ||
| location | text | main | Default: ''Physical location (e.g. shelf identification) | ||
| reference | text | extended | Default: ''Reference identification | ||
| amount | double precision | plain | Amount (quantity); must not be zero (greater than zero if `transfer` is not `null`) | ||
| sellingprice | double precision | plain | Default: 0Selling price per unit | ||
| purchaseprice | double precision | plain | Default: 0Purchase price per unit | ||
| serials | text[] | extended | Array-encoded serial numbers | ||
| subtransactions | bigint[] | extended | Array-encoded sub-transaction IDs |
| Name | Unique | Nulls Distinct | Primary | Partial | Method | Keys |
|---|---|---|---|---|---|---|
| fk_stocktransactions_item | btree | item | ||||
| fk_stocktransactions_storage | gin | storage | ||||
| fk_stocktransactions_transaction | btree | transaction | ||||
| i_stocktransactions_date | btree | date | ||||
| i_stocktransactions_reservations | btree | transaction | ||||
| i_stocktransactions_serials | gin | serials | ||||
| pk_stocktransactions | btree | ID | ||||
| s_stocktransactions_chargenum | gin | chargenum | ||||
| s_stocktransactions_reference | gin | reference | ||||
| s_stocktransactions_serials | gin | f_safe_array_to_string(serials, ' ') | ||||
| u_stocktransactions_transfer | btree | transfer |
| Name | Type |
|---|---|
| c_stocktransactions_transfer | check |
| dc_stocktransactions_amount | check |
| dc_stocktransactions_chargenum | check |
| dc_stocktransactions_flag | check |
| dc_stocktransactions_location | check |
| dc_stocktransactions_reference | check |
| fk_stocktransactions_creator | foreign_key |
| fk_stocktransactions_item | foreign_key |
| fk_stocktransactions_storage | foreign_key |
| fk_stocktransactions_transaction | foreign_key |
| fk_stocktransactions_transfer | foreign_key |
| pk_stocktransactions | primary_key |
| Name | Type | Events | Function | Definition |
|---|---|---|---|---|
| td_stocktransactions_serials | before | delete | ftd_stocktransactions_serials | |
| ti_stocktransactions_item | before | insert | ftiu_stocktransactions_item | |
| ti_stocktransactions_serials | before | insert | fti_stocktransactions_serials | |
| ti_stocktransactions_subtransactions | before | insert | ftiu_stocktransactions_subtransactions | |
| ti_stocktransactions_transfer | before | insert | fti_stocktransactions_transfer | |
| tu_stocktransactions_item | before | update | ftiu_stocktransactions_item | |
| tu_stocktransactions_serials | before | update | ftu_stocktransactions_serials | |
| tu_stocktransactions_subtransactions | before | update | ftiu_stocktransactions_subtransactions | |
| tu_stocktransactions_transfer | before | update | ftu_stocktransactions_transfer |
Loading...