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:
@@ -4,6 +4,7 @@ import Modal from '../ui/Modal';
|
||||
import Button from '../ui/Button';
|
||||
import { contractApi, cachedEmailApi, CachedEmail } from '../../services/api';
|
||||
import { formatDate } from '../../utils/dateFormat';
|
||||
import { buildContractLabelParts } from '../../utils/contractLabel';
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
interface AssignToContractModalProps {
|
||||
@@ -147,6 +148,14 @@ export default function AssignToContractModal({
|
||||
{contract.contractCategory?.name}
|
||||
{contract.provider && ` - ${contract.provider.name}`}
|
||||
</div>
|
||||
{(() => {
|
||||
const parts = buildContractLabelParts(contract);
|
||||
return parts.extras.length > 0 ? (
|
||||
<div className="text-xs text-gray-500 truncate">
|
||||
{parts.extras.join(' · ')}
|
||||
</div>
|
||||
) : null;
|
||||
})()}
|
||||
<div className="text-xs text-gray-500">
|
||||
Start: {formatDateOrDash(contract.startDate)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user