Darstellung
StockHistory
Tabelle: stock_history
Domain: StockHistory · com.reybex.domain.wws.stock
Modul: INV
Partner-Hinweise
- Daten liegen mandantengetrennt – bei SELECT fast immer
tenant_id = :mandantsetzen (Spalte ggf.TenantIdin älteren Tabellen). - Schreibende SQL (
INSERT/UPDATE/DELETE) nur in abgestimmten Export-/Report-Jobs (Transaktion BAS23) und nie ohne Freigabe durch reybex. - Für API-Integrationen bevorzugt die API statt direkter DB-Zugriffe.
Primärschlüssel
id
Spalten
| Spalte | SQL-Typ | NULL | Default | Beschreibung |
|---|---|---|---|---|
id | bigint auto_increment | Ja | — | Primärschlüssel (Domain: id) |
tenant_id | bigint | Nein | — | Mandanten-ID (Multi-Tenant – in Abfragen fast immer filtern) (Domain: tenantId) |
type | smallint | Nein | 0 | type |
stock_item_id | bigint | Ja | — | Fremdschlüssel → stock item |
material_id | bigint | Nein | — | Fremdschlüssel → material |
doc_date | datetime | Nein | — | Belegdatum (Domain: docDate) |
price | decimal(20, 8) | Nein | 0.00000000 | price |
original_price | decimal(20, 8) | Ja | 0.00000000 | original price |
price_unit | decimal(20, 8) | Nein | 1.00000000 | price unit |
freight_cost | decimal(20, 8) | Nein | 0.00000000 | freight cost |
customs_cost | decimal(20, 8) | Nein | 0.00000000 | customs cost |
quantity | decimal(20, 8) | Nein | 0.00000000 | Menge (Domain: quantity) |
open_quantity | decimal(20, 8) | Nein | 0.00000000 | Domain-Feld openQuantity |
total | decimal(20, 8) | Nein | 0.00000000 | total |
warehouse_id | bigint | Nein | — | Fremdschlüssel → warehouse |
batchnum | varchar(500) | Ja | — | Domain-Feld batchnum |
variant_code | varchar(1000) | Ja | — | Domain-Feld variantCode |
ref_stock_history_id | bigint | Ja | — | Fremdschlüssel → ref stock history |
verification_item_id | bigint | Ja | — | Fremdschlüssel → verification item |
sales_item_id | bigint | Ja | — | Fremdschlüssel → sales item |
is_canceled | smallint | Ja | 0 | Boolean: Canceled |
created_by_id | bigint | Ja | — | Angelegt von (Benutzer-ID) |
last_updated | datetime | Ja | CURRENT_TIMESTAMP | Letzte Änderung (Domain: lastUpdated) |
updated_by_id | bigint | Ja | — | Geändert von (Benutzer-ID) |
date_created | datetime | Ja | — | Anlagezeitpunkt |
Fremdschlüssel
| Spalte(n) | Referenz |
|---|---|
tenant_id | company (tenant_id) |
verification_item_id | verification_item (id) |
material_id | material (id) |
warehouse_id | ltt_warehouse (id) |
ref_stock_history_id | stock_history (id) |
sales_item_id | sales_item (id) |