diff --git a/Spalten.txt b/Spalten.txt index b5e4d8a..89bd03a 100644 --- a/Spalten.txt +++ b/Spalten.txt @@ -6,4 +6,5 @@ Ben8 (Deutscher Text) Hersteller Text -> Text aus der tabelle TEXT durch TextId verknüpft PrsVK -> Aus Tabelle TSSAEF verknüpft durch Teil +Ersatz (Ersetzte durch) -> Aus Tabelle TSSAEF, Spalte Ersatz diff --git a/mssql-mcp-readonly.js b/mssql-mcp-readonly.js index 7785bf5..69c3cfe 100644 --- a/mssql-mcp-readonly.js +++ b/mssql-mcp-readonly.js @@ -207,8 +207,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { t.Ben7, t.Ben8, t.Hersteller, + t.Stat, txt.Text AS [Text], - ts.PrsVk AS PrsVK + ts.PrsVk AS PrsVK, + ts.Ersatz AS Ersatz FROM TEILE t WITH (NOLOCK) OUTER APPLY ( SELECT TOP 1 [Text] @@ -217,7 +219,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { ORDER BY LfdNr ) txt OUTER APPLY ( - SELECT TOP 1 PrsVk + SELECT TOP 1 PrsVk, Ersatz FROM TSSAEF WITH (NOLOCK) WHERE Teil = t.Teil ORDER BY ISN diff --git a/public/dev.html b/public/dev.html index 4e1d431..6fc790a 100644 --- a/public/dev.html +++ b/public/dev.html @@ -160,12 +160,40 @@ } .record { - background: #f9f9f9; - padding: 15px; + display: flex; margin-bottom: 10px; border-radius: 6px; - border-left: 4px solid #667eea; + overflow: hidden; + background: #f9f9f9; } + .record-status-bar { + width: 16px; + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; + padding: 8px 0; + } + .record-status-label { + writing-mode: vertical-rl; + text-orientation: mixed; + transform: rotate(180deg); + color: rgba(255,255,255,0.95); + font-size: 11px; + font-weight: 600; + white-space: nowrap; + letter-spacing: 0.5px; + } + .record-body { + flex: 1; + padding: 15px; + } + /* Status-Farben (siehe status.txt): aktiv=grün, inaktiv/löschbar=rot, prüfbar=orange, pseudoteil=grün */ + .record-status-bar.record--aktiv { background: #2e7d32; } + .record-status-bar.record--inaktiv { background: #c62828; } + .record-status-bar.record--loeschbar { background: #c62828; } + .record-status-bar.record--pruefbar { background: #e65100; } + .record-status-bar.record--pseudoteil { background: #2e7d32; } .record-field { display: flex; @@ -396,11 +424,37 @@ { key: 'Ben8', label: 'Deutscher Text' }, { key: 'Hersteller', label: 'Hersteller' }, { key: 'Text', label: 'Zusatztext' }, - { key: 'PrsVK', label: 'Verkaufspreis in €' } + { key: 'PrsVK', label: 'Verkaufspreis in €' }, + { key: 'Ersatz', label: 'Ersetzt durch' } ]; + function getStatusClass(stat) { + const s = (stat == null ? '' : String(stat).trim()); + if (s === 'i') return 'record--inaktiv'; + if (s === 'l') return 'record--loeschbar'; + if (s === 'L') return 'record--pruefbar'; + if (s === 'p') return 'record--pseudoteil'; + return 'record--aktiv'; // "" oder leer = aktiv + } + + function getStatusLabel(stat) { + const s = (stat == null ? '' : String(stat).trim()); + if (s === 'i') return 'Inaktiv'; + if (s === 'l') return 'Löschbar'; + if (s === 'L') return 'Prüfbar'; + if (s === 'p') return 'Pseudoteil'; + return 'Aktiv'; + } + function renderRecord(record) { - let html = '