stocktransactions


Columns

Column Type Size Nulls Auto Default Children Parents Comments
ID int8 19 null
stocktransactions.transfer fk_stocktransactions_transfer N

Stock transaction ID

creator int4 10 null
users.ID fk_stocktransactions_creator N

Creator user ID (defaults to authenticated user on creation)

creationdate int8 19 date_part('epoch'::text, now())

Creation date and time as a Unix time stamp (defaults to current date and time on creation)

lastmodified int8 19 date_part('epoch'::text, now())

Last modification date and time as a Unix time stamp (auto-reset on modification)

item int4 10 null
items.ID fk_stocktransactions_item C

Item ID (**dependency**)

storage int4 10 null
storages.ID fk_stocktransactions_storage N

Storage ID

transaction int4 10 null
transactions.ID fk_stocktransactions_transaction N

Transaction ID

transfer int8 19 null
stocktransactions.ID fk_stocktransactions_transfer N

Transfer stock transaction ID; must be distinct from ID and null for RESERVED

flag int2 5 0

Flag (0=BOOKED, 1=RESERVED, 2=CANCELLED)

date int8 19 date_part('epoch'::text, now())

Designated date and time as a Unix time stamp (defaults to current date and time on creation)

chargenum text 2147483647 ''::text

Charge (lot) number

location text 2147483647 ''::text

Physical location (e.g. shelf identification)

reference text 2147483647 ''::text

Reference identification

amount float8 17,17 null

Amount (quantity); must not be zero (greater than zero if transfer is not null)

sellingprice float8 17,17 0

Selling price per unit

purchaseprice float8 17,17 0

Purchase price per unit

serials _text 2147483647 null

Serial numbers

subtransactions _int8 19 null

Sub-transaction IDs

Table contained 0 rows

Indexes

Constraint Name Type Sort Column(s)
pk_stocktransactions Primary key Asc ID
fk_stocktransactions_item Performance Asc item
fk_stocktransactions_storage Performance Asc storage
fk_stocktransactions_transaction Performance Asc transaction
i_stocktransactions_date_ID Performance Desc/Desc date + ID
i_stocktransactions_serials Performance Asc serials
s_stocktransactions Performance Asc chargenum
u_stocktransactions_transfer Must be unique Asc transfer

Relationships