Darstellung
SalesItemDiscount
Tabelle: sales_item_discount
Domain: SalesItemDiscount · com.reybex.domain.wws.sales
Modul: SAL
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 | Ja | — | Mandanten-ID (Multi-Tenant – in Abfragen fast immer filtern) (Domain: tenantId) |
sales_item_id | bigint | Ja | — | Fremdschlüssel → sales item |
discount_type_id | bigint | Ja | — | Fremdschlüssel → discount type |
discount_rate | decimal(20, 8) | Ja | 0.00000000 | discount rate |
discount_amount | decimal(20, 8) | Ja | 0.00000000 | discount amount |
total_amount | decimal(20, 8) | Ja | 0.00000000 | total amount |
date_created | datetime | Ja | — | Anlagezeitpunkt |
last_updated | datetime | Ja | CURRENT_TIMESTAMP | Letzte Änderung |
created_by_id | bigint | Ja | — | Angelegt von (Benutzer-ID) |
updated_by_id | bigint | Ja | — | Geändert von (Benutzer-ID) |
is_changeable | smallint | Ja | — | Boolean: Changeable |
is_copied | smallint | Ja | 0 | Boolean: Copied |
amount_or_percentage | smallint | Ja | — | Domain-Feld amountOrPercentage |
base_amount_type | smallint | Ja | — | base amount type |
order_pos | int | Ja | — | order pos |
is_cash_discount | smallint | Ja | 0 | Boolean: Cash Discount |
base_discount_type_id | bigint | Ja | — | Fremdschlüssel → base discount type |
item_base_reduced | decimal(20, 8) | Ja | 0.00000000 | Domain-Feld itemBaseReduced |
purchase_discount_rate | decimal(20, 8) | Ja | — | purchase discount rate |
purchase_discount_amount | decimal(20, 8) | Ja | — | purchase discount amount |
purchase_total_amount | decimal(20, 8) | Ja | — | purchase total amount |
purchase_item_base_reduced | decimal(20, 8) | Ja | 0.00000000 | Domain-Feld purchaseItemBaseReduced |
is_added_automatically | smallint | Ja | 0 | Boolean: Added Automatically |
is_set_manually | smallint | Ja | 0 | Boolean: Set Manually |
Fremdschlüssel
| Spalte(n) | Referenz |
|---|---|
discount_type_id | ltt_discount_type (id) |
sales_item_id | sales_item (id) |