Kunden: Reiter "Abgesagt", Absage eintragen und Warnung vor Doppelten
- Kundenliste mit Reiter "Abgesagt" (vorher nur unter "Alle"), rotes Abzeichen, Suche auch nach Telefon - Kundenseite: "Absage eintragen" fuer Leads (Grund freiwillig); Vermerk "Abgesagt am TT.MM.JJJJ (Name): Grund" oben in die Notizen, offene Akquise-Tickets auf "Abgesagt"; roter Hinweis "nicht erneut anrufen" und "Wieder als Lead fuehren" - Neuer Lead (jetzt mit Telefon) und Neuer Kunde gleichen live mit allen Kunden ab (auch archivierte/abgesagte): Name ohne Rechtsform, E-Mail, Firmen-Domain (ohne Freemailer), Telefon; Abgesagte rot und zuerst, Knopf heisst dann "Trotzdem anlegen" - Uebersicht wird nach Speichern neu aufgebaut (key), damit kein alter Notizstand den Vermerk ueberschreibt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5d8130e8ef
commit
d2883018fc
10 files changed
+378
-23
No files matched your search
@@ -17,13 +17,14 @@ export function isArchived(c) {
|
||||
export const CUSTOMER_TABS = [
|
||||
{ id: 'customer', label: 'Feste Kunden' },
|
||||
{ id: 'lead', label: 'Leads' },
|
||||
{ id: 'lost', label: 'Abgesagt' },
|
||||
{ id: 'archived', label: 'Archiviert' },
|
||||
{ id: 'all', label: 'Alle' },
|
||||
]
|
||||
|
||||
/**
|
||||
* Filtert die Kundenliste nach Reiter und Suchtext. Die Reihenfolge der Eingabe bleibt.
|
||||
* Archivierte erscheinen nur im Reiter `archived`. Die Stufe `lost` erscheint nur im Reiter `all`.
|
||||
* Archivierte erscheinen nur im Reiter `archived`.
|
||||
*/
|
||||
export function filterCustomers(customers, { stage = 'customer', search = '' } = {}) {
|
||||
const s = String(search || '').toLowerCase()
|
||||
@@ -32,13 +33,13 @@ export function filterCustomers(customers, { stage = 'customer', search = '' } =
|
||||
if (stage === 'archived') return archived
|
||||
if (archived) return false
|
||||
if (stage === 'all') return true
|
||||
if (stage === 'customer' || stage === 'lead') return customerStage(c) === stage
|
||||
if (stage === 'customer' || stage === 'lead' || stage === 'lost') return customerStage(c) === stage
|
||||
return false
|
||||
}
|
||||
return (customers || []).filter((c) => {
|
||||
if (!matchesStage(c)) return false
|
||||
if (!s) return true
|
||||
return `${c.name || ''} ${c.code || ''} ${c.location || ''} ${c.email || ''} ${c.contactName || ''}`.toLowerCase().includes(s)
|
||||
return `${c.name || ''} ${c.code || ''} ${c.location || ''} ${c.email || ''} ${c.contactName || ''} ${c.phone || ''}`.toLowerCase().includes(s)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -65,7 +66,7 @@ export function customerBadges(c, { stage = true } = {}) {
|
||||
if (stage) {
|
||||
const st = customerStage(c)
|
||||
if (st === 'lead') badges.push({ key: 'lead', label: stageLabel('lead'), tone: 'muted' })
|
||||
else if (st === 'lost') badges.push({ key: 'lost', label: stageLabel('lost'), tone: 'plain' })
|
||||
else if (st === 'lost') badges.push({ key: 'lost', label: stageLabel('lost'), tone: 'danger' })
|
||||
}
|
||||
if (isArchived(c)) badges.push({ key: 'archived', label: 'Archiviert', tone: 'plain' })
|
||||
return badges
|
||||
|
||||
Reference in new issue
Block a user