diff --git a/src/components/WorksheetList.jsx b/src/components/WorksheetList.jsx index b9daa22..a4a9c8f 100644 --- a/src/components/WorksheetList.jsx +++ b/src/components/WorksheetList.jsx @@ -1,6 +1,8 @@ import { EmptyState } from './ui' import { needsTimeEntry, isGitWorksheet } from '../lib/ticketForm' import { parseSupporters } from '../lib/support' +import { useAbgerechnet } from '../hooks/useAbgerechnet' +import { abgerechnetText, ticketIdsOf } from '../lib/projektkontoView' import { showAboToggle, statusAfterLabel, @@ -23,6 +25,8 @@ export default function WorksheetList({ onOwnSupport, currentUserId, }) { + // Hooks laufen immer, auch bei den frühen Rückgaben unten; die Abzeichen sehen alle Mitarbeiter und zeigen nie Beträge + const abgerechnet = useAbgerechnet(ticketIdsOf(worksheets)) if (loading) return
Wird geladen …
if (!worksheets || worksheets.length === 0) { @@ -35,6 +39,7 @@ export default function WorksheetList({ const when = worksheetWhen(ws) const kind = worksheetKindLabel(ws) const badge = worksheetBadge(ws) + const billed = abgerechnetText(abgerechnet, ws.$id) const lines = supportLines(ws) const status = statusAfterLabel(ws) const time = timeLabel(ws) @@ -58,6 +63,18 @@ export default function WorksheetList({ {kind && {kind}} WSID {ws.wsid} {badge && {badge.text}} + {billed && ( + + {billed} + + )} {showAbo ? (