Show ticket Teamspace totals
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,10 +543,16 @@ 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 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">
|
||||
<div className="space-y-3">
|
||||
|
||||
Reference in New Issue
Block a user