From 73c5446cf878f380ef565f07cb8b2eecb599fa28 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 7 Oct 2026 14:15:56 +0000 Subject: [PATCH] =?UTF-8?q?Kundenportal=20Auftr=C3=A4ge:=20Abschnitt=20im?= =?UTF-8?q?=20Reiter=20Rechnungen,=20Projekt=20unter=20der=20Rechnungsnumm?= =?UTF-8?q?er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- public/app.js | 23 +++++++- public/auftrag.css | 2 +- public/dashboard.html | 9 +++ test/auftraegeKundenportalDashboard.test.js | 63 +++++++++++++++++++++ 4 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 test/auftraegeKundenportalDashboard.test.js diff --git a/public/app.js b/public/app.js index b9251b8..e9d1938 100644 --- a/public/app.js +++ b/public/app.js @@ -584,6 +584,13 @@ function renderViewAsBanner(me) { } /* ------------------------------------------------------------- Rechnungen --- */ +// @rechnungsnummer-anfang +/** Rechnungsnummer mit dem Projekt darunter (Stripe-Metadaten projektName, Feld `projekt`); beides maskiert. */ +function invoiceNumberHtml(i) { + const project = i.projekt ? `${escapeHtml(i.projekt)}` : '' + return `${escapeHtml(i.number)}${project}` +} +// @rechnungsnummer-ende async function loadCustomerInvoices() { const body = document.getElementById('invoices-body') if (!body) return @@ -615,7 +622,7 @@ async function loadCustomerInvoices() { ${invoices.map((i) => ` - ${escapeHtml(i.number)} + ${invoiceNumberHtml(i)} ${fmtDateShort(i.date)} ${fmtEuro(i.amount)} ${fmtEuro(i.balance)} @@ -632,6 +639,19 @@ async function loadCustomerInvoices() { } } +// Abschnitt "Aufträge" im Reiter Rechnungen (public/auftrag-portal.js): Fehler lassen den Abschnitt weg und stören die Rechnungen nicht. +function loadCustomerOrders() { + return import('/auftrag-portal.js') + .then((m) => m.initAuftraege({ + section: document.getElementById('orders-section'), + body: document.getElementById('orders-body'), + invoicesTitle: document.getElementById('invoices-title'), + request: api, + viewAs: chatState.viewAs, + })) + .catch(() => {}) +} + /* -------------------------------------------------------------- Aktivität --- */ // Abschnitt "Was wir zuletzt erledigt haben" unter Projekte: je Auftrag eine Karte mit Status, Fortschrittsleiste // und Arbeiten (Bausteine der Projektdetails; Texte kommen aufbereitet vom Server). Zuerst die drei neuesten, @@ -2063,6 +2083,7 @@ async function initDashboardPage() { if (aboParam) window.history.replaceState(null, '', `/dashboard.html${window.location.hash}`) loadContracts({ afterCheckout: aboParam === 'success' }) loadCustomerInvoices() + loadCustomerOrders() activityScrollPending = currentHash() === 'fortschritt' loadCustomerActivity().then(scrollToActivity) diff --git a/public/auftrag.css b/public/auftrag.css index 8463188..4899a59 100644 --- a/public/auftrag.css +++ b/public/auftrag.css @@ -149,7 +149,7 @@ body.ab-seite { .ab-portal .ab-details[open] > summary { margin-bottom: 4px; } .ab-portal .ab-knopf { border-radius: 999px; } .ab-rechnungen-titel { font-size: 20px; margin: 0 0 10px; } -.inv-project { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--kb-muted, #6b6b70); overflow-wrap: anywhere; } +.inv-project { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; color: var(--kb-muted, rgba(255, 255, 255, 0.6)); overflow-wrap: anywhere; } /* ------------------------------------------------------------------ Installierte App --- */ .ab-app-back { display: none; } diff --git a/public/dashboard.html b/public/dashboard.html index 0401f1d..716e943 100644 --- a/public/dashboard.html +++ b/public/dashboard.html @@ -26,6 +26,7 @@ +