feat(opportunities): Festpreis, Klick daneben, Kontakt von hier

Drei Dinge, die im Alltag gefehlt haben:

- Projektdaten kennen jetzt einen Projektpreis. Ist er gesetzt, gilt er als
  Volumen statt Tagessatz x Laufzeit - Festpreisprojekte mussten bisher
  ausgerechnet und in den Tagessatz gefaelscht werden.
- Dialoge schliessen auch per Klick in den Hintergrund, nicht nur ueber das X.
  Escape trifft dabei nur den obersten Dialog; eine Textmarkierung, die im
  Dialog beginnt und daneben endet, schliesst nichts.
- Fehlt ein Ansprechpartner noch im CRM, oeffnet "Neuer Kontakt..." in der
  Opportunity denselben Dialog wie unter Kontakte. Der frische Kontakt haengt
  danach sofort als Ansprechpartner dran, ohne die Opportunity zu verlassen.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sascha Wolf
2026-08-18 10:41:11 +02:00
co-authored by Claude Opus 5
parent 30164e0ae7
commit 025390e18a
12 changed files with 243 additions and 67 deletions
+5
View File
@@ -118,6 +118,7 @@ CREATE TABLE IF NOT EXISTS crm_opportunities (
probability TINYINT UNSIGNED NOT NULL DEFAULT 10, -- 0-100 %
daily_rate DECIMAL(10,2) NULL, -- Tagessatz in Euro
duration_days DECIMAL(6,1) NULL, -- Personentage, halbe moeglich
fixed_price DECIMAL(12,2) NULL, -- Festpreis; Alternative zu Tagessatz x Laufzeit
start_date DATE NULL,
end_date DATE NULL,
last_interaction_at DATE NULL,
@@ -137,6 +138,10 @@ CREATE TABLE IF NOT EXISTS crm_opportunities (
CONSTRAINT fk_crm_opp_creator FOREIGN KEY (created_by) REFERENCES crm_users (id) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Festpreisprojekte rechnen nicht ueber Tagessatz x Personentage. Ist der
-- Projektpreis gesetzt, gilt er als Volumen (siehe opportunityVolume()).
ALTER TABLE crm_opportunities ADD COLUMN IF NOT EXISTS fixed_price DECIMAL(12,2) NULL AFTER duration_days;
CREATE TABLE IF NOT EXISTS crm_opportunity_contacts (
opportunity_id INT UNSIGNED NOT NULL,
lead_id INT UNSIGNED NOT NULL,