{ "warehousemgmt_stock": { "name": "warehousemgmt_stock", "fields": { "warehousemgmt_stock_id": { "name": "warehousemgmt_stock_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_stock_name": { "name": "warehousemgmt_stock_name", "type": "VARCHAR(255)", "null": false }, "warehousemgmt_stock_inventory": { "name": "warehousemgmt_stock_inventory", "type": "TINYINT(1)", "null": false }, "warehousemgmt_stock_unit": { "name": "warehousemgmt_stock_unit", "type": "INT", "null": false, "foreignTable": "itemmgmt_item", "foreignKey": "itemmgmt_item_id" }, "warehousemgmt_stock_client": { "name": "warehousemgmt_stock_client", "type": "INT", "null": false, "foreignTable": "clientmgmt_client", "foreignKey": "clientmgmt_client_id" }, "warehousemgmt_stock_supplier": { "name": "warehousemgmt_stock_supplier", "type": "INT", "null": false, "foreignTable": "suppliermgmt_supplier", "foreignKey": "suppliermgmt_supplier_id" }, "warehousemgmt_stock_address": { "name": "warehousemgmt_stock_address", "type": "INT", "null": true, "default": null, "foreignTable": "address", "foreignKey": "address_id" } } }, "warehousemgmt_stock_type": { "name": "warehousemgmt_stock_type", "fields": { "warehousemgmt_stock_type_id": { "name": "warehousemgmt_stock_type_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_stock_type_name": { "name": "warehousemgmt_stock_type_name", "type": "VARCHAR(255)", "null": false } } }, "warehousemgmt_stock_type_l11n": { "name": "warehousemgmt_stock_type_l11n", "fields": { "warehousemgmt_stock_type_l11n_id": { "name": "warehousemgmt_stock_type_l11n_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_stock_type_l11n_name": { "name": "warehousemgmt_stock_type_l11n_name", "type": "VARCHAR(255)", "null": false }, "warehousemgmt_stock_type_l11n_type": { "name": "warehousemgmt_stock_type_l11n_type", "type": "INT", "null": false, "foreignTable": "warehousemgmt_stock_type", "foreignKey": "warehousemgmt_stock_type_id" }, "warehousemgmt_stock_type_l11n_language": { "name": "warehousemgmt_stock_type_l11n_language", "type": "VARCHAR(2)", "default": null, "null": true, "foreignTable": "language", "foreignKey": "language_639_1" } } }, "warehousemgmt_stocklocation": { "name": "warehousemgmt_stocklocation", "fields": { "warehousemgmt_stocklocation_id": { "name": "warehousemgmt_stocklocation_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_stocklocation_name": { "name": "warehousemgmt_stocklocation_name", "type": "VARCHAR(255)", "null": false }, "warehousemgmt_stocklocation_stock": { "name": "warehousemgmt_stocklocation_stock", "type": "INT", "null": false, "foreignTable": "warehousemgmt_stock", "foreignKey": "warehousemgmt_stock_id" }, "warehousemgmt_stocklocation_type": { "name": "warehousemgmt_stocklocation_type", "type": "INT", "null": true, "default": null, "foreignTable": "warehousemgmt_stock_type", "foreignKey": "warehousemgmt_stock_type_id" }, "warehousemgmt_stocklocation_x": { "name": "warehousemgmt_stocklocation_x", "type": "INT", "null": false }, "warehousemgmt_stocklocation_y": { "name": "warehousemgmt_stocklocation_y", "type": "INT", "null": false }, "warehousemgmt_stocklocation_z": { "comment": "Height", "name": "warehousemgmt_stocklocation_z", "type": "INT", "null": false } } }, "warehousemgmt_stockshelf": { "name": "warehousemgmt_stockshelf", "fields": { "warehousemgmt_stockshelf_id": { "name": "warehousemgmt_stockshelf_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_stockshelf_name": { "name": "warehousemgmt_stockshelf_name", "type": "VARCHAR(255)", "null": false }, "warehousemgmt_stockshelf_location": { "name": "warehousemgmt_stockshelf_location", "type": "INT", "null": false, "foreignTable": "warehousemgmt_stocklocation", "foreignKey": "warehousemgmt_stocklocation_id" }, "warehousemgmt_stockshelf_type": { "name": "warehousemgmt_stockshelf_type", "type": "INT", "null": true, "default": null, "foreignTable": "warehousemgmt_stock_type", "foreignKey": "warehousemgmt_stock_type_id" }, "warehousemgmt_stockshelf_x": { "name": "warehousemgmt_stockshelf_x", "type": "INT", "null": false }, "warehousemgmt_stockshelf_y": { "name": "warehousemgmt_stockshelf_y", "type": "INT", "null": false }, "warehousemgmt_stockshelf_z": { "comment": "Height", "name": "warehousemgmt_stockshelf_z", "type": "INT", "null": false } } }, "warehousemgmt_lot": { "name": "warehousemgmt_lot", "todo": "consider to also allow notes (similar to media relation below)", "fields": { "warehousemgmt_lot_id": { "name": "warehousemgmt_lot_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_lot_item": { "name": "warehousemgmt_lot_item", "type": "INT", "null": false, "foreignTable": "itemmgmt_item", "foreignKey": "itemmgmt_item_id" }, "warehousemgmt_lot_purchase_price": { "comment": "only used if custom value, otherwise transaction protocol more accurate because of mixed prices and then lifo/fifo etc. depending on internal guidelines", "name": "warehousemgmt_lot_purchase_price", "type": "BIGINT", "null": false }, "warehousemgmt_lot_internal": { "name": "warehousemgmt_lot_internal", "type": "VARCHAR(255)", "null": false, "unique": true }, "warehousemgmt_lot_external": { "name": "warehousemgmt_lot_external", "type": "VARCHAR(255)", "null": true, "default": null }, "warehousemgmt_lot_type": { "name": "warehousemgmt_lot_type", "type": "TINYINT", "null": false }, "warehousemgmt_lot_manufactured": { "name": "warehousemgmt_lot_manufactured", "type": "DATETIME", "null": true, "default": null }, "warehousemgmt_lot_bestuse": { "name": "warehousemgmt_lot_bestuse", "type": "DATETIME", "null": true, "default": null }, "warehousemgmt_lot_expiration": { "name": "warehousemgmt_lot_expiration", "type": "DATETIME", "null": true, "default": null } } }, "warehousemgmt_attr_type": { "name": "warehousemgmt_attr_type", "fields": { "warehousemgmt_attr_type_id": { "name": "warehousemgmt_attr_type_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_attr_type_name": { "name": "warehousemgmt_attr_type_name", "type": "VARCHAR(255)", "null": false, "unique": true }, "warehousemgmt_attr_type_datatype": { "name": "warehousemgmt_attr_type_datatype", "type": "INT(11)", "null": false }, "warehousemgmt_attr_type_fields": { "name": "warehousemgmt_attr_type_fields", "type": "INT(11)", "null": false }, "warehousemgmt_attr_type_custom": { "name": "warehousemgmt_attr_type_custom", "type": "TINYINT(1)", "null": false }, "warehousemgmt_attr_type_repeatable": { "name": "warehousemgmt_attr_type_repeatable", "type": "TINYINT(1)", "null": false }, "warehousemgmt_attr_type_internal": { "name": "warehousemgmt_attr_type_internal", "type": "TINYINT(1)", "null": false }, "warehousemgmt_attr_type_required": { "comment": "Every item must have this attribute type if set to true.", "name": "warehousemgmt_attr_type_required", "type": "TINYINT(1)", "null": false }, "warehousemgmt_attr_type_pattern": { "comment": "This is a regex validation pattern.", "name": "warehousemgmt_attr_type_pattern", "type": "VARCHAR(255)", "null": false } } }, "warehousemgmt_attr_type_l11n": { "name": "warehousemgmt_attr_type_l11n", "fields": { "warehousemgmt_attr_type_l11n_id": { "name": "warehousemgmt_attr_type_l11n_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_attr_type_l11n_title": { "name": "warehousemgmt_attr_type_l11n_title", "type": "VARCHAR(255)", "null": false }, "warehousemgmt_attr_type_l11n_type": { "name": "warehousemgmt_attr_type_l11n_type", "type": "INT(11)", "null": false, "foreignTable": "warehousemgmt_attr_type", "foreignKey": "warehousemgmt_attr_type_id" }, "warehousemgmt_attr_type_l11n_lang": { "name": "warehousemgmt_attr_type_l11n_lang", "type": "VARCHAR(2)", "null": false, "foreignTable": "language", "foreignKey": "language_639_1" } } }, "warehousemgmt_attr_value": { "name": "warehousemgmt_attr_value", "fields": { "warehousemgmt_attr_value_id": { "name": "warehousemgmt_attr_value_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_attr_value_default": { "name": "warehousemgmt_attr_value_default", "type": "TINYINT(1)", "null": false }, "warehousemgmt_attr_value_valueStr": { "name": "warehousemgmt_attr_value_valueStr", "type": "VARCHAR(255)", "null": true, "default": null }, "warehousemgmt_attr_value_valueInt": { "name": "warehousemgmt_attr_value_valueInt", "type": "INT(11)", "null": true, "default": null }, "warehousemgmt_attr_value_valueDec": { "name": "warehousemgmt_attr_value_valueDec", "type": "DECIMAL(19,5)", "null": true, "default": null }, "warehousemgmt_attr_value_valueDat": { "name": "warehousemgmt_attr_value_valueDat", "type": "DATETIME", "null": true, "default": null }, "warehousemgmt_attr_value_unit": { "name": "warehousemgmt_attr_value_unit", "type": "VARCHAR(255)", "null": false }, "warehousemgmt_attr_value_deptype": { "name": "warehousemgmt_attr_value_deptype", "type": "INT(11)", "null": true, "default": null, "foreignTable": "warehousemgmt_attr_type", "foreignKey": "warehousemgmt_attr_type_id" }, "warehousemgmt_attr_value_depvalue": { "name": "warehousemgmt_attr_value_depvalue", "type": "INT(11)", "null": true, "default": null, "foreignTable": "warehousemgmt_attr_value", "foreignKey": "warehousemgmt_attr_value_id" } } }, "warehousemgmt_attr_value_l11n": { "name": "warehousemgmt_attr_value_l11n", "fields": { "warehousemgmt_attr_value_l11n_id": { "name": "warehousemgmt_attr_value_l11n_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_attr_value_l11n_title": { "name": "warehousemgmt_attr_value_l11n_title", "type": "VARCHAR(255)", "null": false }, "warehousemgmt_attr_value_l11n_value": { "name": "warehousemgmt_attr_value_l11n_value", "type": "INT(11)", "null": false, "foreignTable": "warehousemgmt_attr_value", "foreignKey": "warehousemgmt_attr_value_id" }, "warehousemgmt_attr_value_l11n_lang": { "name": "warehousemgmt_attr_value_l11n_lang", "type": "VARCHAR(2)", "null": false, "foreignTable": "language", "foreignKey": "language_639_1" } } }, "warehousemgmt_lot_attr_default": { "name": "warehousemgmt_lot_attr_default", "fields": { "warehousemgmt_lot_attr_default_id": { "name": "warehousemgmt_lot_attr_default_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_lot_attr_default_type": { "name": "warehousemgmt_lot_attr_default_type", "type": "INT(11)", "null": false, "foreignTable": "warehousemgmt_attr_type", "foreignKey": "warehousemgmt_attr_type_id" }, "warehousemgmt_lot_attr_default_value": { "name": "warehousemgmt_lot_attr_default_value", "type": "INT(11)", "null": false, "foreignTable": "warehousemgmt_attr_value", "foreignKey": "warehousemgmt_attr_value_id" } } }, "warehousemgmt_lot_attr": { "name": "warehousemgmt_lot_attr", "fields": { "warehousemgmt_lot_attr_id": { "name": "warehousemgmt_lot_attr_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_lot_attr_lot": { "name": "warehousemgmt_lot_attr_lot", "type": "INT(11)", "null": false, "foreignTable": "warehousemgmt_lot", "foreignKey": "warehousemgmt_lot_id" }, "warehousemgmt_lot_attr_type": { "name": "warehousemgmt_lot_attr_type", "type": "INT(11)", "null": false, "foreignTable": "warehousemgmt_attr_type", "foreignKey": "warehousemgmt_attr_type_id" }, "warehousemgmt_lot_attr_value": { "name": "warehousemgmt_lot_attr_value", "type": "INT(11)", "null": true, "default": null, "foreignTable": "warehousemgmt_attr_value", "foreignKey": "warehousemgmt_attr_value_id" } } }, "warehousemgmt_lot_media": { "name": "warehousemgmt_lot_media", "fields": { "warehousemgmt_lot_media_id": { "name": "warehousemgmt_lot_media_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_lot_media_lot": { "name": "warehousemgmt_lot_media_lot", "type": "INT", "null": false, "foreignTable": "warehousemgmt_lot", "foreignKey": "warehousemgmt_lot_id" }, "warehousemgmt_lot_media_media": { "name": "warehousemgmt_lot_media_media", "type": "INT", "null": false, "foreignTable": "media", "foreignKey": "media_id" } } }, "warehousemgmt_stock_distribution": { "name": "warehousemgmt_stock_distribution", "fields": { "warehousemgmt_stock_distribution_id": { "name": "warehousemgmt_stock_distribution_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_stock_distribution_item": { "name": "warehousemgmt_stock_distribution_item", "type": "INT", "null": false, "foreignTable": "itemmgmt_item", "foreignKey": "itemmgmt_item_id" }, "warehousemgmt_stock_distribution_lot": { "name": "warehousemgmt_stock_distribution_lot", "type": "INT", "null": true, "default": null, "foreignTable": "warehousemgmt_lot", "foreignKey": "warehousemgmt_lot_id" }, "warehousemgmt_stock_distribution_stock": { "name": "warehousemgmt_stock_distribution_stock", "type": "INT", "null": false, "foreignTable": "warehousemgmt_stock", "foreignKey": "warehousemgmt_stock_id" }, "warehousemgmt_stock_distribution_stocktype": { "name": "warehousemgmt_stock_distribution_stocktype", "type": "INT", "null": false, "foreignTable": "warehousemgmt_stock_type", "foreignKey": "warehousemgmt_stock_type_id" }, "warehousemgmt_stock_distribution_quantity": { "name": "warehousemgmt_stock_distribution_quantity", "type": "BIGINT", "null": false } } }, "warehousemgmt_stock_distribution_history": { "name": "warehousemgmt_stock_distribution_history", "fields": { "warehousemgmt_stock_distribution_history_id": { "name": "warehousemgmt_stock_distribution_history_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_stock_distribution_history_name": { "descritpion": "Name of the stock distribution snapshot, given by a user/admin.", "name": "warehousemgmt_stock_distribution_history_name", "type": "VARCHAR(255)", "null": false }, "warehousemgmt_stock_distribution_history_item": { "name": "warehousemgmt_stock_distribution_history_item", "type": "INT", "null": false, "foreignTable": "itemmgmt_item", "foreignKey": "itemmgmt_item_id" }, "warehousemgmt_stock_distribution_history_lot": { "name": "warehousemgmt_stock_distribution_history_lot", "type": "INT", "null": false, "foreignTable": "warehousemgmt_lot", "foreignKey": "warehousemgmt_lot_id" }, "warehousemgmt_stock_distribution_history_stock": { "name": "warehousemgmt_stock_distribution_history_stock", "type": "INT", "null": false, "foreignTable": "warehousemgmt_stock", "foreignKey": "warehousemgmt_stock_id" }, "warehousemgmt_stock_distribution_history_stocktype": { "name": "warehousemgmt_stock_distribution_history_stocktype", "type": "INT", "null": false, "foreignTable": "warehousemgmt_stock_type", "foreignKey": "warehousemgmt_stock_type_id" }, "warehousemgmt_stock_distribution_history_quantity": { "name": "warehousemgmt_stock_distribution_history_quantity", "type": "BIGINT", "null": false }, "warehousemgmt_stock_distribution_history_datetime": { "name": "warehousemgmt_stock_distribution_history_datetime", "type": "DATETIME", "null": false } } }, "warehousemgmt_stock_transaction": { "name": "warehousemgmt_stock_transaction", "fields": { "warehousemgmt_stock_transaction_id": { "name": "warehousemgmt_stock_transaction_id", "type": "INT", "null": false, "primary": true, "autoincrement": true }, "warehousemgmt_stock_transaction_state": { "comment": "Is draft (= reserved = bill currently in draft) or finalized", "name": "warehousemgmt_stock_transaction_state", "type": "TINYINT", "null": false }, "warehousemgmt_stock_transaction_quantity": { "name": "warehousemgmt_stock_transaction_quantity", "type": "BIGINT", "null": false }, "warehousemgmt_stock_transaction_type": { "name": "warehousemgmt_stock_transaction_type", "type": "INT", "null": false }, "warehousemgmt_stock_transaction_item": { "name": "warehousemgmt_stock_transaction_item", "type": "INT", "null": false, "foreignTable": "itemmgmt_item", "foreignKey": "itemmgmt_item_id" }, "warehousemgmt_stock_transaction_from_lot": { "name": "warehousemgmt_stock_transaction_from_lot", "type": "INT", "null": true, "default": null, "foreignTable": "warehousemgmt_lot", "foreignKey": "warehousemgmt_lot_id" }, "warehousemgmt_stock_transaction_from_stock": { "name": "warehousemgmt_stock_transaction_from_stock", "type": "INT", "null": true, "default": null, "foreignTable": "warehousemgmt_stock", "foreignKey": "warehousemgmt_stock_id" }, "warehousemgmt_stock_transaction_from_stocktype": { "name": "warehousemgmt_stock_transaction_from_stocktype", "type": "INT", "null": true, "default": null, "foreignTable": "warehousemgmt_stock_type", "foreignKey": "warehousemgmt_stock_type_id" }, "warehousemgmt_stock_transaction_to_lot": { "name": "warehousemgmt_stock_transaction_to_lot", "type": "INT", "null": true, "default": null, "foreignTable": "warehousemgmt_lot", "foreignKey": "warehousemgmt_lot_id" }, "warehousemgmt_stock_transaction_to_stock": { "name": "warehousemgmt_stock_transaction_to_stock", "type": "INT", "null": true, "default": null, "foreignTable": "warehousemgmt_stock", "foreignKey": "warehousemgmt_stock_id" }, "warehousemgmt_stock_transaction_to_stocktype": { "name": "warehousemgmt_stock_transaction_to_stocktype", "type": "INT", "null": true, "default": null, "foreignTable": "warehousemgmt_stock_type", "foreignKey": "warehousemgmt_stock_type_id" }, "warehousemgmt_stock_transaction_bill_element": { "comment": "indirectly contains createdat/by in the bill as well as supplier/customer", "name": "warehousemgmt_stock_transaction_bill_element", "type": "INT", "null": false, "foreignTable": "billing_bill_element", "foreignKey": "billing_bill_element_id" } } } }