Vertragsauswahl: Kundennr./Zählernr./Telefonnr. in allen Pickern
Zentraler Helper contractLabel.ts liefert je nach Vertragstyp die sinnvollen Zusatzinfos (nur wenn Daten vorhanden): - Kdnr. <customer.customerNumber> (immer) - Anbieter-Vtr. <contractNumberAtProvider> - Zähler <meterNumber> (Strom/Gas) - Mobil <main-SIM-Nummer> (Mobilfunk) - Festnetz <main-phone> (Internet) Backend contractApi.getAll include um energyDetails.meter und internetDetails.phoneNumbers erweitert – vorher fehlten die im Response. Angewendet auf 5 Call-Sites: - AssignToContractModal (Email-zu-Vertrag zuordnen) - TaskList (Mitarbeiter- und Kundenportal-"Neue Aufgabe/Anfrage") - Dashboard (Support-Anfrage-Modal) - PdfTemplates (Test-Vorlage-Kontext-Auswahl) - ContractForm (Vorgänger-Vertrag-Select) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import Input from '../../components/ui/Input';
|
||||
import Select from '../../components/ui/Select';
|
||||
import CopyButton from '../../components/ui/CopyButton';
|
||||
import CustomerInfoModal from '../../components/contracts/CustomerInfoModal';
|
||||
import { buildContractLabelParts } from '../../utils/contractLabel';
|
||||
import type { ContractType } from '../../types';
|
||||
import { formatDate } from '../../utils/dateFormat';
|
||||
import { useProviderSettings } from '../../hooks/useProviderSettings';
|
||||
@@ -878,10 +879,15 @@ export default function ContractForm() {
|
||||
<Select
|
||||
label="Vorgänger-Vertrag"
|
||||
{...register('previousContractId')}
|
||||
options={predecessorContracts.map((c) => ({
|
||||
value: c.id,
|
||||
label: `${c.contractNumber} (${c.type}${c.startDate ? ` - ${formatDate(c.startDate)}` : ''})`,
|
||||
}))}
|
||||
options={predecessorContracts.map((c) => {
|
||||
const parts = buildContractLabelParts(c);
|
||||
const dateHint = c.startDate ? ` – ${formatDate(c.startDate)}` : '';
|
||||
const suffix = parts.extras.length > 0 ? ` · ${parts.extras.join(' · ')}` : '';
|
||||
return {
|
||||
value: c.id,
|
||||
label: `${c.contractNumber} (${c.type}${dateHint})${suffix}`,
|
||||
};
|
||||
})}
|
||||
placeholder="Keinen Vorgänger auswählen"
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user