Show ticket Teamspace totals

This commit is contained in:
2026-08-05 14:11:30 +02:00
parent 0325631d02
commit cfc4ef45a8
2 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -665,7 +665,7 @@ async function getPeriodTicket(config: PeriodConfig, period: ParsedPeriod, ticke
const periodClosureJoin =
config.type === "month"
? "LEFT JOIN month_closures pc ON pc.month = $3::date AND pc.user_id = $2"
: "LEFT JOIN (SELECT NULL::timestamptz AS closed_at) pc ON true";
: "LEFT JOIN (SELECT $3::date AS period_start, NULL::timestamptz AS closed_at) pc ON true";
const ticketResult = await query(
`
SELECT
+10 -3
View File
@@ -228,6 +228,7 @@ export function TicketDetailPage({ periodType, period, ticketId, onNavigate }: T
return Array.from(groups.values());
}, [data?.sessions]);
const periodTotalMinutes = sessionGroups.reduce((sum, group) => sum + group.totalMinutes, 0);
const periodTeamspaceMinutes = Array.from(dayBillingMap.values()).reduce((sum, minutes) => sum + Number(minutes ?? 0), 0);
async function setBilling(sessionId: string, billingStatus: BillingStatus) {
if (isPeriodClosed && billingStatus !== null) {
@@ -542,9 +543,15 @@ export function TicketDetailPage({ periodType, period, ticketId, onNavigate }: T
<CardTitle>Session-Einträge</CardTitle>
<CardDescription>Wähle für jede Session genau eine Bewertung aus oder lösche falsche Einträge.</CardDescription>
</div>
<div className="flex items-center gap-2 rounded-md border bg-muted/30 px-3 py-2 text-sm">
<span className="text-muted-foreground">{periodLabel} gesamt</span>
<span className="font-semibold">{formatMinutes(periodTotalMinutes)}</span>
<div className="flex flex-wrap items-center gap-2">
<div className="flex items-center gap-2 rounded-md border bg-muted/30 px-3 py-2 text-sm">
<span className="text-muted-foreground">{periodLabel} gesamt</span>
<span className="font-semibold">{formatMinutes(periodTotalMinutes)}</span>
</div>
<div className="flex items-center gap-2 rounded-md border bg-muted/30 px-3 py-2 text-sm">
<span className="text-muted-foreground">{periodType === "month" ? "Teamspace gesamt" : "Teamspace Tag"}</span>
<span className="font-semibold">{formatMinutes(periodTeamspaceMinutes)}</span>
</div>
</div>
</CardHeader>
<CardContent className="px-4 pb-4">