YTD heisst bis heute, nicht bis zum Jahresende
Die Kacheln "Eintritte/Austritte (YTD)" zaehlten bis zum 31.12. und damit auch, was erst bevorsteht: ein fuer den 01.11. erfasster Austritt stand schon im September als geschehen da. Die Kachel sagte 2, tatsaechlich war es 1. Der Kommentar an der Kachel nannte die Absicht seit jeher richtig -- "seit Jahresbeginn bis heute, nicht das ganze Kalenderjahr" --, nur stand darunter yearEnd. Was kommt, steht ohnehin in "Anstehend" daneben; die Kachel soll sagen, was war. Der Verweis auf den Bericht traegt denselben Zeitraum, sonst zeigte der Bericht eine andere Zahl als die Kachel, ueber die man ihn geoeffnet hat. Und die Variable heisst jetzt ytdBis statt yearEnd -- ein Name, der "Jahresende" sagt und "heute" bedeutet, waere die naechste Fundstelle gewesen.
This commit is contained in:
@@ -70,7 +70,10 @@ export default async function DashboardPage({
|
||||
const today = todayIso();
|
||||
const year = today.slice(0, 4);
|
||||
const yearStart = `${year}-01-01`;
|
||||
const yearEnd = `${year}-12-31`;
|
||||
// Das obere Ende des YTD-Fensters ist **heute**. Hier stand der 31.12., also
|
||||
// das ganze Kalenderjahr — womit die Kacheln auch zählten, was erst
|
||||
// bevorsteht (B.02).
|
||||
const ytdBis = today;
|
||||
|
||||
// Der Vorschauzeitraum ist einstellbar, und mit ihm, was überhaupt geladen
|
||||
// wird. Deshalb steht die Auswahl in der Adresse und nicht im Browser: 90
|
||||
@@ -103,7 +106,7 @@ export default async function DashboardPage({
|
||||
upcomingReturns,
|
||||
upcomingNotes,
|
||||
history,
|
||||
} = await withUser(userId, (tx) => loadDashboardData(tx, { userId, today, yearStart, yearEnd, bisIso, arten }));
|
||||
} = await withUser(userId, (tx) => loadDashboardData(tx, { userId, today, yearStart, ytdBis, bisIso, arten }));
|
||||
// "Aktiv" means status Aktiv — somebody on Karenz is employed but not
|
||||
// active, and is counted by its own tile instead. FTE follows the same
|
||||
// set: Karenz contributes no capacity, so including it would overstate
|
||||
@@ -225,16 +228,18 @@ export default async function DashboardPage({
|
||||
kacheln: [
|
||||
{
|
||||
// YTD: seit Jahresbeginn bis heute, nicht das ganze Kalenderjahr.
|
||||
// Der Verweis trägt denselben Zeitraum — sonst zeigte der Bericht
|
||||
// eine andere Zahl als die Kachel, über die man ihn geöffnet hat.
|
||||
label: "Eintritte (YTD)",
|
||||
value: hiresYtd,
|
||||
tone: "success",
|
||||
href: `/reports?mode=events&eventType=Eintritt&from=${yearStart}&to=${yearEnd}`,
|
||||
href: `/reports?mode=events&eventType=Eintritt&from=${yearStart}&to=${ytdBis}`,
|
||||
},
|
||||
{
|
||||
label: "Austritte (YTD)",
|
||||
value: exitsYtd,
|
||||
tone: "danger",
|
||||
href: `/reports?mode=events&eventType=Austritt&from=${yearStart}&to=${yearEnd}`,
|
||||
href: `/reports?mode=events&eventType=Austritt&from=${yearStart}&to=${ytdBis}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user