From 36d411fe77269d3a6d801be737f19349b397571d Mon Sep 17 00:00:00 2001 From: Rob Date: Fri, 27 Mar 2026 13:59:01 +0100 Subject: [PATCH] udate plans --- .github/copilot-plan.md | 13 ++++--- .../application-masterplan.instructions.md | 34 ++++++++++++------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/copilot-plan.md b/.github/copilot-plan.md index c6da7c4..96bd6b4 100644 --- a/.github/copilot-plan.md +++ b/.github/copilot-plan.md @@ -34,10 +34,11 @@ Excel-Datei → excel_reader → MonthlyAttendance → pdf_filler → PDF-Datei ## Entwurfsentscheidungen - `plan.N` = immer `"6"` (mind. 6h), unabhängig von tatsächlichen Stunden -- Sheet-Auswahl: manuell via `--sheet ` (z.B. `--sheet Feb`) +- Sheet-Auswahl: manuell via `--month ` (z.B. `--month Feb`) - Output-Benennung: `(n) Nachname, Vorname.pdf` (n = lfd. Nummer aus Spalte A) -- `pauschale.N` = `"8,60"` wenn anwesend (X), sonst leer +- `pauschale_5.N` = Dropdown-Wert `"1"` (= 8,60 €) wenn anwesend (X), sonst `"0"` - PDF-Template liegt in `./template/sab.pdf` +- PDF-Felder für Ort und Datum: `unterschrift.ort` / `unterschrift.datum` ## Excel-Struktur - Spalte A (Index 0): lfd. Nummer @@ -50,11 +51,13 @@ Excel-Datei → excel_reader → MonthlyAttendance → pdf_filler → PDF-Datei - "E" → entschuldigtes Fehlen - "P" → Praktikum - "U" → Urlaub + - "V" → Vorstellungsgespräch + - "A" → aus Projekt ausgeschieden - Leer → Zeile überspringen ## PDF-Feld-Mapping (pro Zeile N, max 23 Zeilen) -| Excel-Zelle | datum.N | anwesend.N | ist.N | plan.N | pauschale.N | +| Excel-Zelle | datum.N | anwesend.N | ist.N | plan.N | pauschale_5.N | |---|---|---|---|---|---| -| Numerisch | DD.MM.YYYY | X | Wert (dt. Format) | "6" | "8,60" | -| "K"/"KK"/etc| DD.MM.YYYY | Code | leer | leer | leer | +| Numerisch | DD.MM.YYYY | X | Wert (dt. Format) | "6" | "1" | +| "K"/"KK"/etc| DD.MM.YYYY | Code | leer | leer | "0" | | Leer | (überspringen) | — | — | — | — | diff --git a/.github/instructions/application-masterplan.instructions.md b/.github/instructions/application-masterplan.instructions.md index e6740b2..1d477da 100644 --- a/.github/instructions/application-masterplan.instructions.md +++ b/.github/instructions/application-masterplan.instructions.md @@ -28,13 +28,13 @@ Each PDF is generated per participant, per month. The PDF contains a table with | `person.name` | Full name of the participant | Excel column B | | `monat_jahr` | Month and year in `MM/YYYY` format | Derived from sheet name + filename | | `antragsnummer` | Application number | `config.json` (hardcoded) | -| `ort` | Location/city | `config.json` (hardcoded) | -| `erstellungsdatum` | Creation date (`DD.MM.YYYY`) | Current system date at generation time | +| `unterschrift.ort` | Location/city (signature line) | `config.json` (hardcoded) | +| `unterschrift.datum` | Creation date (`DD.MM.YYYY`) (signature line) | Current system date at generation time | | `datum.0` – `datum.22` | Date per row in `DD.MM.YYYY` format (max 23 rows) | Derived from sheet name + year | | `anwesend.0` – `anwesend.22` | Attendance status dropdown (see mapping below) | Excel day cell | | `ist.0` – `ist.22` | Actual attendance in hours (`Ist-Stand Anwesenheit (in h)`) | Excel day cell (numeric) | -| `plan.0` – `plan.22` | Planned attendance in hours (`Geplante Anwesenheit lt. Konzeption (in h)`) | Derived from `ist` value | -| `pauschale.0` – `pauschale.22` | Flat rate `Pauschale 8,60 € (mind. 6 h anwesend)` | Set to `8,60` if present (`X`), else empty | +| `plan.0` – `plan.22` | Planned attendance in hours (`Geplante Anwesenheit lt. Konzeption (in h)`) | Always `"6"` (mind. 6h) when present | +| `pauschale_5.0` – `pauschale_5.22` | Flat rate Pauschale 8,60 € | Dropdown value `"1"` if present (`X`), else `"0"` | ## Header Field Derivation Rules @@ -66,11 +66,13 @@ Each PDF is generated per participant, per month. The PDF contains a table with ### Application Number (`antragsnummer`) - Hardcoded static value stored in `config.json`. Never derived from Excel. -### Location (`ort`) +### Location (`unterschrift.ort`) - Hardcoded static value stored in `config.json`. Never derived from Excel. +- PDF field name is configurable via `pdf_field_ort` in `config.json`. -### Creation Date (`erstellungsdatum`) +### Creation Date (`unterschrift.datum`) - Always the **current system date** at the time of PDF generation, formatted as `DD.MM.YYYY`. +- PDF field name is configurable via `pdf_field_erstellungsdatum` in `config.json`. ## Excel-to-PDF Field Mapping Rules @@ -81,8 +83,9 @@ Each PDF is generated per participant, per month. The PDF contains a table with **PDF actions**: - `datum.N` → Set to the date in `DD.MM.YYYY` format. - `anwesend.N` → Select `X = anwesend`. -- `ist.N` → Set to the exact numeric value from Excel (actual hours worked). -- `plan.N` → Select the nearest applicable planned value: `3` (for sessions up to 3h) or `6` (for sessions above 3h). The threshold logic must be consistently applied and configurable. +- `ist.N` → Set to the exact numeric value from Excel (actual hours worked), with comma as decimal separator. +- `plan.N` → Always set to `"6"` (= `mind. 6h` dropdown option). +- `pauschale_5.N` → Set to `"1"` (= 8,60 € dropdown option). ### Rule 2: Sick — Value `"K"` @@ -114,13 +117,13 @@ Each PDF is generated per participant, per month. The PDF contains a table with - `ist.N` → Leave empty (no hours entered). - `plan.N` → Leave empty (no planned hours entered). -### Rule 5: Flat Rate — `pauschale.N` +### Rule 5: Flat Rate — `pauschale_5.N` **Condition**: Applied for every row where attendance is present (`X`). **PDF actions**: -- `pauschale.N` → Set to `8,60` if `anwesend.N` is `X = anwesend`. -- `pauschale.N` → Leave empty for all other statuses (K, KK, F, etc.). +- `pauschale_5.N` → Set to `"1"` (= 8,60 € in dropdown) if `anwesend.N` is `X = anwesend`. +- `pauschale_5.N` → Set to `"0"` for all other statuses (K, KK, F, etc.). ### Rule 6: No Entry / Empty Cell @@ -142,6 +145,8 @@ The `anwesend` field is a dropdown. Valid selectable values: | `F` | `F = unentschuldigtes Fehlen` (unexcused absence) | | `P` | `P = Praktikum` (internship) | | `U` | `U = Urlaub` (vacation) | +| `V` | `V = Vorstellungsgespräch` (job interview) | +| `A` | `A = aus Projekt ausgeschieden` (left project) | ## Planned Hours Logic (`plan.N`) @@ -169,7 +174,7 @@ All of the following must be verified. Errors are **logged** (not silently ignor | Column A present | Sequential number column exists | | Column B present | Name column exists | | Day columns present | At least one day column is detected | -| Attendance values valid | Each non-empty cell contains either a numeric value or a known status code (`K`, `KK`, `F`, `E`, `P`, `U`) | +| Attendance values valid | Each non-empty cell contains either a numeric value or a known status code (`K`, `KK`, `F`, `E`, `P`, `U`, `V`, `A`) | | `config.json` present and complete | All required keys (`antragsnummer`, `ort`, month mapping, filename pattern) exist | | PDF template accessible | The PDF template file exists and is readable | @@ -188,6 +193,11 @@ Erstelldatum : 27.03.2026 Teilnehmer : 12 Fehler : 0 +--- Stichproben aus dem Excel-Sheet (erste 10 Tage) --- + Person 1 2 ... + Mustermann, Max 6 K ... + ... + Möchten Sie die PDF-Generierung starten? [j/N] ```