feat: Sonderführungen automatisch im Register SoFue2 nachtragen — Version 1.13.0
Beim Speichern eines Logbuch-Eintrags der Art 'SF' wird der passende Datensatz in SoFue2 über das Datum gesucht und dort stattgefunden=1, anzahl_echt, bezahlt und remarks gesetzt. Gibt es an dem Tag mehrere Führungen, gewinnt die zeitlich nächstgelegene. Das Ergebnis kommt als Feld 'sofue' aus der PHP-Bridge zurück und wird über dem Formular angezeigt — grün bei Erfolg, gelb, wenn keine Führung gefunden wurde. Der Logbuch-Eintrag wird in dem Fall trotzdem gespeichert. Die Meldung liegt in MainClient, weil LogbuchForm beim Bearbeiten durch onSaved() neu gemountet wird. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,8 @@ Next.js 16 App Router application. All pages are server components; interactive
|
||||
|
||||
`ArtFuehrung` is stored as abbreviations in the DB (`RF`, `SF`, `PrF`, `BEOS`, `SonF`, `TD`, `Beob`, `ToT`, `Sonst`). Display names are in `ARTEN_MAP` in `types/logbuch.ts`. `BEOS` and `TD` hide the Besucher and Objekte fields. `SonF` pre-selects "Sonne" as the only object. `SF` (Sonderführung) additionally shows `SonderName` plus the mandatory `Spende` select (`bar`, `ueberw`, `kasse`, `keine` — labels in `SPENDE_MAP`); `SpendeBetrag` is only filled for `bar`. Both columns stay `NULL` for every other Art, enforced client-side in `LogbuchForm` and server-side in `spendeValues()` in `DB4js_all.php`.
|
||||
|
||||
Saving an `SF` entry also writes back into the Sonderführungs register `SoFue2` (`stattgefunden`, `anzahl_echt`, `bezahlt`, `remarks`) via `RepoSoFue::ausLogbuch()` in `DB4js_all.php` — matched by `DATE(wtermin)` against the entry's Beginn, nearest time wins. It runs in the dispatcher **after** the logbuch transaction commits and never throws; the outcome travels back as a `sofue` field in the API response and is shown above the form by `MainClient`. Note `SoFue2` is latin1 while `logbuch` is utf8mb4, and `remarks` holds only 100 chars — `cp1252Safe()` handles both.
|
||||
|
||||
## Deployment
|
||||
|
||||
`output: 'standalone'` is set in `next.config.ts` for Docker. The MySQL container name in production is `db` — set `DB_HOST=db` in the server's environment.
|
||||
|
||||
Reference in New Issue
Block a user