Darstellung
invoice
Tabelle: invoice
Domain: Keine zugeordnete Domain-Entität (Hilfstabelle, Legacy oder mandantenspezifisch).
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 |
doc_type_id | bigint | Ja | — | Fremdschlüssel → doc type |
customer_id | bigint | Ja | — | Fremdschlüssel → customer |
order_date | datetime | Ja | — | order date |
paymcond_id | bigint | Ja | — | Fremdschlüssel → paymcond |
order_description | varchar(500) | Ja | — | order description |
discount_rate | double | Ja | 0 | discount rate |
tax_type_id | bigint | Ja | — | Fremdschlüssel → tax type |
is_paid | smallint | Ja | 0 | Boolean: Paid |
project_id | bigint | Ja | — | Fremdschlüssel → project |
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) |
tenant_id | bigint | Nein | — | Mandanten-ID (Multi-Tenant – in Abfragen fast immer filtern) |
end_date | date | Ja | — | end date |
start_date | date | Ja | — | start date |
customer_employee_id | bigint | Ja | — | Fremdschlüssel → customer employee |
notes | varchar(2000) | Ja | — | Interne Notizen |
terms | varchar(2000) | Ja | — | terms |
total_amount | double | Ja | 0 | total amount |
currency_id | bigint | Ja | — | Fremdschlüssel → currency |
is_delete | smallint | Ja | 0 | Soft-Delete (0 = aktiv, 1 = gelöscht) |
discount_amount | double | Ja | 0 | discount amount |
tax_amount | double | Ja | 0 | tax amount |
sub_total | double | Ja | 0 | sub total |
is_hours_proof | smallint | Ja | 0 | Boolean: Hours Proof |
is_recur | smallint | Ja | 0 | Boolean: Recur |
recur_type_id | bigint | Ja | — | Fremdschlüssel → recur type |
doc_date | datetime | Ja | — | Belegdatum |
is_printed | smallint | Ja | 0 | Boolean: Printed |
due_date | datetime | Ja | — | due date |
doc_number | varchar(50) | Ja | — | Belegnummer |
is_discount_in_amount | smallint | Ja | 0 | Boolean: Discount In Amount |
crm_opportunity_id | bigint | Ja | — | Fremdschlüssel → crm opportunity |
ref_invoice_id | bigint | Ja | — | Fremdschlüssel → ref invoice |
status | smallint | Ja | 0 | status |
receiver_id | bigint | Ja | — | Fremdschlüssel → receiver |
balance_amount | decimal(15, 2) | Ja | 0.00 | balance amount |
dunlevel_id | bigint | Ja | — | Fremdschlüssel → dunlevel |
dun_date | datetime | Ja | — | dun date |
op_text | mediumtext | Ja | — | op text |
last_dun_date | datetime | Ja | — | last dun date |
Fremdschlüssel
| Spalte(n) | Referenz |
|---|---|
tenant_id | company (tenant_id) |
doc_type_id | ltt_doc_type (id) |
customer_id | customer (id) |
paymcond_id | ltt_paymcond (id) |
tax_type_id | ltt_tax_type (id) |
project_id | project (id) |
currency_id | ltt_currency (id) |
receiver_id | customer (id) |
dunlevel_id | ltt_dunning_level (id) |