complete new audit system
This commit is contained in:
@@ -36,6 +36,7 @@ import {
|
||||
ExternalLink,
|
||||
CheckCircle2,
|
||||
} from 'lucide-react';
|
||||
import { formatDate } from '../../utils/dateFormat';
|
||||
import type { CockpitContract, CockpitUrgencyLevel, ContractType } from '../../types';
|
||||
|
||||
const typeIcons: Record<ContractType, typeof Zap> = {
|
||||
@@ -570,7 +571,7 @@ export default function ContractCockpit() {
|
||||
</Badge>
|
||||
)}
|
||||
<p className="text-xs text-gray-500 mt-1">
|
||||
{new Date(alert.expiryDate).toLocaleDateString('de-DE')}
|
||||
{formatDate(alert.expiryDate)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -623,7 +624,7 @@ export default function ContractCockpit() {
|
||||
</div>
|
||||
<p className="text-xs text-gray-600">
|
||||
Zähler {reading.meter.meterNumber} – <strong>{reading.value} {reading.unit}</strong> am{' '}
|
||||
{new Date(reading.readingDate).toLocaleDateString('de-DE')}
|
||||
{formatDate(reading.readingDate)}
|
||||
{reading.notes && ` – ${reading.notes}`}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@ import FileUpload from '../../components/ui/FileUpload';
|
||||
import { Edit, Trash2, Copy, Eye, EyeOff, ArrowLeft, ArrowRight, Download, ExternalLink, Plus, ChevronDown, ChevronUp, Gauge, CheckCircle, Circle, ClipboardList, MessageSquare, Calculator, Info, X, BellOff, Lock, Shield } from 'lucide-react';
|
||||
import { calculateConsumption, calculateCosts, calculateMultiMeterConsumption } from '../../utils/energyCalculations';
|
||||
import CopyButton, { CopyableBlock } from '../../components/ui/CopyButton';
|
||||
import { formatDate } from '../../utils/dateFormat';
|
||||
import type { ContractType, ContractStatus, SimCard, MeterReading, ContractTask, ContractTaskSubtask, ContractMeter } from '../../types';
|
||||
|
||||
const typeLabels: Record<ContractType, string> = {
|
||||
@@ -273,8 +274,8 @@ function MeterReadingsSection({
|
||||
className="flex justify-between items-center text-sm group py-1 border-b border-gray-200 last:border-0"
|
||||
>
|
||||
<span className="text-gray-500 flex items-center gap-1">
|
||||
{new Date(reading.readingDate).toLocaleDateString('de-DE')}
|
||||
<CopyButton value={new Date(reading.readingDate).toLocaleDateString('de-DE')} />
|
||||
{formatDate(reading.readingDate)}
|
||||
<CopyButton value={formatDate(reading.readingDate)} />
|
||||
</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-mono flex items-center gap-1">
|
||||
@@ -315,7 +316,7 @@ function MeterReadingsSection({
|
||||
|
||||
{!isExpanded && readings.length > 0 && (
|
||||
<p className="text-sm text-gray-500">
|
||||
Letzter Stand: {sortedReadings[0].value.toLocaleString('de-DE')} {sortedReadings[0].unit} ({new Date(sortedReadings[0].readingDate).toLocaleDateString('de-DE')})
|
||||
Letzter Stand: {sortedReadings[0].value.toLocaleString('de-DE')} {sortedReadings[0].unit} ({formatDate(sortedReadings[0].readingDate)})
|
||||
</p>
|
||||
)}
|
||||
|
||||
@@ -1033,8 +1034,8 @@ function ContractTaskItem({
|
||||
<p className="text-xs text-gray-400">
|
||||
{subtask.createdBy && `${subtask.createdBy} • `}
|
||||
{isSubtaskCompleted
|
||||
? `Erledigt am ${subtask.completedAt ? new Date(subtask.completedAt).toLocaleDateString('de-DE') : new Date(subtask.updatedAt).toLocaleDateString('de-DE')}`
|
||||
: new Date(subtask.createdAt).toLocaleDateString('de-DE')}
|
||||
? `Erledigt am ${subtask.completedAt ? formatDate(subtask.completedAt) : formatDate(subtask.updatedAt)}`
|
||||
: formatDate(subtask.createdAt)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1077,8 +1078,8 @@ function ContractTaskItem({
|
||||
<p className="text-xs text-gray-400 mt-1">
|
||||
{task.createdBy && `${task.createdBy} • `}
|
||||
{isCompleted
|
||||
? `Erledigt am ${task.completedAt ? new Date(task.completedAt).toLocaleDateString('de-DE') : '-'}`
|
||||
: new Date(task.createdAt).toLocaleDateString('de-DE')}
|
||||
? `Erledigt am ${task.completedAt ? formatDate(task.completedAt) : '-'}`
|
||||
: formatDate(task.createdAt)}
|
||||
</p>
|
||||
|
||||
{/* Subtasks */}
|
||||
@@ -1713,7 +1714,7 @@ export default function ContractDetail() {
|
||||
{c.nextReviewDate && new Date(c.nextReviewDate) > new Date() && (
|
||||
<div className="flex items-center gap-1 px-2 py-1 bg-amber-100 text-amber-800 rounded-full text-xs">
|
||||
<BellOff className="w-3 h-3" />
|
||||
<span>Zurückgestellt bis {new Date(c.nextReviewDate).toLocaleDateString('de-DE')}</span>
|
||||
<span>Zurückgestellt bis {formatDate(c.nextReviewDate)}</span>
|
||||
{hasPermission('contracts:update') && (
|
||||
<button
|
||||
onClick={() => setShowUnsnoozeConfirm(true)}
|
||||
@@ -2616,7 +2617,7 @@ export default function ContractDetail() {
|
||||
{c.internetDetails.installationDate && (
|
||||
<div>
|
||||
<dt className="text-sm text-gray-500">Installation</dt>
|
||||
<dd>{new Date(c.internetDetails.installationDate).toLocaleDateString('de-DE')}</dd>
|
||||
<dd>{formatDate(c.internetDetails.installationDate)}</dd>
|
||||
</div>
|
||||
)}
|
||||
{c.internetDetails.homeId && (
|
||||
@@ -2891,7 +2892,7 @@ export default function ContractDetail() {
|
||||
<div>
|
||||
<dt className="text-sm text-gray-500">Erstzulassung</dt>
|
||||
<dd>
|
||||
{new Date(c.carInsuranceDetails.firstRegistration).toLocaleDateString('de-DE')}
|
||||
{formatDate(c.carInsuranceDetails.firstRegistration)}
|
||||
</dd>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -9,6 +9,7 @@ import Button from '../../components/ui/Button';
|
||||
import Input from '../../components/ui/Input';
|
||||
import Select from '../../components/ui/Select';
|
||||
import type { ContractType } from '../../types';
|
||||
import { formatDate } from '../../utils/dateFormat';
|
||||
import { Plus, Trash2, Eye, EyeOff, Info, X, ArrowLeft } from 'lucide-react';
|
||||
|
||||
// Contract types are now loaded dynamically from the database
|
||||
@@ -724,7 +725,7 @@ export default function ContractForm() {
|
||||
{...register('previousContractId')}
|
||||
options={predecessorContracts.map((c) => ({
|
||||
value: c.id,
|
||||
label: `${c.contractNumber} (${c.type}${c.startDate ? ` - ${new Date(c.startDate).toLocaleDateString('de-DE')}` : ''})`,
|
||||
label: `${c.contractNumber} (${c.type}${c.startDate ? ` - ${formatDate(c.startDate)}` : ''})`,
|
||||
}))}
|
||||
placeholder="Keinen Vorgänger auswählen"
|
||||
/>
|
||||
|
||||
@@ -12,6 +12,7 @@ import Badge from '../../components/ui/Badge';
|
||||
import CopyButton from '../../components/ui/CopyButton';
|
||||
import { Plus, Search, Eye, Edit, Trash2, User, Users, ChevronDown, ChevronRight, Info, X, ShieldAlert } from 'lucide-react';
|
||||
import { gdprApi } from '../../services/api';
|
||||
import { formatDate } from '../../utils/dateFormat';
|
||||
import type { Contract, ContractType, ContractStatus } from '../../types';
|
||||
|
||||
const typeLabels: Record<ContractType, string> = {
|
||||
@@ -307,9 +308,9 @@ export default function ContractList() {
|
||||
)}
|
||||
{contract.startDate && (
|
||||
<p className={`text-sm text-gray-500 ${isPredecessor ? 'ml-6' : ''}`}>
|
||||
Beginn: {new Date(contract.startDate).toLocaleDateString('de-DE')}
|
||||
Beginn: {formatDate(contract.startDate)}
|
||||
{contract.endDate &&
|
||||
` | Ende: ${new Date(contract.endDate).toLocaleDateString('de-DE')}`}
|
||||
` | Ende: ${formatDate(contract.endDate)}`}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
@@ -491,7 +492,7 @@ export default function ContractList() {
|
||||
</td>
|
||||
<td className="py-3 px-4">
|
||||
{contract.startDate
|
||||
? new Date(contract.startDate).toLocaleDateString('de-DE')
|
||||
? formatDate(contract.startDate)
|
||||
: '-'}
|
||||
</td>
|
||||
<td className="py-3 px-4 text-right">
|
||||
|
||||
Reference in New Issue
Block a user