added backup and email client
This commit is contained in:
@@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
|
||||
import { useParams, Link, useNavigate, useLocation } from 'react-router-dom';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { contractApi, uploadApi, meterApi, contractTaskApi, appSettingsApi } from '../../services/api';
|
||||
import { ContractEmailsSection } from '../../components/email';
|
||||
import { useAuth } from '../../context/AuthContext';
|
||||
import Card from '../../components/ui/Card';
|
||||
import Button from '../../components/ui/Button';
|
||||
@@ -2326,6 +2327,14 @@ export default function ContractDetail() {
|
||||
isCustomerPortal={isCustomerPortal}
|
||||
/>
|
||||
|
||||
{/* Zugeordnete E-Mails */}
|
||||
{!isCustomerPortal && hasPermission('contracts:read') && c.customerId && (
|
||||
<ContractEmailsSection
|
||||
contractId={contractId}
|
||||
customerId={c.customerId}
|
||||
/>
|
||||
)}
|
||||
|
||||
{c.notes && (
|
||||
<Card title="Notizen">
|
||||
<p className="whitespace-pre-wrap">{c.notes}</p>
|
||||
|
||||
@@ -142,6 +142,17 @@ export default function ContractForm() {
|
||||
}
|
||||
}, [isEdit]);
|
||||
|
||||
// Set preselected customer from URL params (for new contracts)
|
||||
useEffect(() => {
|
||||
if (!isEdit && preselectedCustomerId && customersData?.data) {
|
||||
// Only set if the customer exists in the list
|
||||
const customerExists = customersData.data.some(c => c.id.toString() === preselectedCustomerId);
|
||||
if (customerExists) {
|
||||
setValue('customerId', preselectedCustomerId);
|
||||
}
|
||||
}
|
||||
}, [isEdit, preselectedCustomerId, customersData, setValue]);
|
||||
|
||||
// Reset tariffId when providerId changes (but only after initial contract load)
|
||||
useEffect(() => {
|
||||
// Only reset tariff if:
|
||||
|
||||
Reference in New Issue
Block a user