feat(mahnwesen): expose {FRIST}, {DATUMRECHNUNG}, {MAHNDATUM}, {TAGE} placeholders#271
Open
Avatarsia wants to merge 1 commit into
Open
feat(mahnwesen): expose {FRIST}, {DATUMRECHNUNG}, {MAHNDATUM}, {TAGE} placeholders#271Avatarsia wants to merge 1 commit into
Avatarsia wants to merge 1 commit into
Conversation
Avatarsia
pushed a commit
to Avatarsia/OpenXE
that referenced
this pull request
Apr 30, 2026
Adds the mahnfenster branch (upstream PR OpenXE-org#271) to the integration manifest under "Upstream bug-fix PRs". Single-file fix to www/pages/mahnwesen.php that exposes {FRIST}, {DATUMRECHNUNG}, {MAHNDATUM}, {TAGE} placeholders for dunning templates and fixes a use-before-define on $tage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bd43e58 to
61b3bf1
Compare
Contributor
Author
|
Force-Push-Hinweis: Branch wurde direkt auf Bestehende Inline-Kommentare auf alten SHAs erscheinen jetzt als „outdated" — gerne nochmal kommentieren auf den neuen Commits, falls noch was offen ist. |
Avatarsia
pushed a commit
to Avatarsia/OpenXE
that referenced
this pull request
May 20, 2026
Adds the mahnfenster branch (upstream PR OpenXE-org#271) to the integration manifest under "Upstream bug-fix PRs". Single-file fix to www/pages/mahnwesen.php that exposes {FRIST}, {DATUMRECHNUNG}, {MAHNDATUM}, {TAGE} placeholders for dunning templates and fixes a use-before-define on $tage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… placeholders
The mahnwesen template engine previously only exposed {DATUM}, {BELEGNR},
{OFFEN}, {MAHNGEBUEHR}, {HEUTE}, {RECHNUNG} via the ParseVars mapping.
The legacy block computing {DATUM*}/{TAGE}/{MAHNDATUM} is commented out,
so dunning templates referencing a calendar-bound deadline ("bis zum X")
had no working placeholder for the deadline date.
This adds:
- {FRIST} = mahnwesen_datum + mahn_tage (mahnwesen.tage from system
settings), formatted dd.mm.yyyy
- {DATUMRECHNUNG} = invoice date (alias to {DATUM} for clarity)
- {MAHNDATUM} = current dunning issue date in dd.mm.yyyy
- {TAGE} = configured grace days for the current dunning level
Also fixes a use-before-define on $tage at line 678 by replacing the
no-op `if($tage<=0)$tage=0;` with a single `max(0,(int)mahn_tage)`
assignment that pulls from the mahnwesen table (system settings).
Guards 0000-00-00 mahnwesen_datum to avoid bogus future-date arithmetic.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #270
Summary
MahnwesenMessage()um{FRIST},{DATUMRECHNUNG},{MAHNDATUM},{TAGE}— Werte stammen aus den System-Einstellungen → Mahnwesen (mahnwesen.tage) und derrechnung-Tabelle.if(\$tage<=0)\$tage=0;(Use-before-define) durch eine saubere Zuweisung\$tage = max(0, (int)\$rechnungarr['mahn_tage']).{FRIST}PHP-seitig (date('d.m.Y', strtotime(...))) statt DB-Roundtrip.0000-00-00als Reset-Sentinel vonmahnwesen_datum.Diff
Code-Review
Drei Codex-Review-Runden durchlaufen:
Test plan
Frist bis zum {FRIST}editieren{FRIST}ist im versendeten Brief korrekt durchmahnwesen_datum + Tageersetzt (deutsches Format dd.mm.yyyy){DATUM},{OFFEN},{MAHNGEBUEHR}) funktionieren weiterhinmahnwesen_datum = '0000-00-00'→{FRIST}bleibt leer statt unsinniges DatumOut of scope
DokumentCreate(Escaping inclass.erpapi.php:16041) wird in diesem PR nicht behandelt.geschaeftsbrief_vorlagen.tplfür die neuen Platzhalter — kann in Folge-PR ergänzt werden.🤖 Generated with Claude Code