feat: Warnfenster und Planungs-Hinweis bei möglicher Doppelzählung (A12-T4)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-29 07:35:16 +02:00
co-authored by Claude Opus 5.5
parent 9e856ec655
commit e665180b1f
8 changed files with 264 additions and 2 deletions
+17
View File
@@ -7,6 +7,7 @@
<link rel="stylesheet" href="/static/style.css">
<script src="/static/htmx.min.js"></script>
<script src="/static/sort.js"></script>
<script src="/static/doppelzaehlung.js"></script>
</head>
<body>
<nav>
@@ -26,8 +27,18 @@
<main>
{% block content %}{% endblock %}
</main>
<dialog id="doppelzaehlung-dialog">
<h2>Mögliche Doppelzählung</h2>
<p class="dz-meldung"></p>
<ul class="dz-konflikte"></ul>
<p>Trotzdem speichern?</p>
<button type="button" id="dz-abbrechen" autofocus>Abbrechen</button>
<button type="button" id="dz-bestaetigen">Trotzdem speichern</button>
</dialog>
<script>
document.body.addEventListener('htmx:responseError', function (e) {
// Mögliche Doppelzählung Kredit/Fixposten: eigenes Warnfenster statt alert.
if (window.FBDoppel && window.FBDoppel.handle(e)) { return; }
alert('Fehler: ' + (e.detail.xhr.responseText || e.detail.xhr.status));
});
@@ -72,6 +83,10 @@
out[field.name] = field.checked;
});
}
// Bestätigte Doppelzählung (Warnfenster „Trotzdem speichern"):
if (elt.getAttribute && elt.getAttribute('data-doppelzaehlung-bestaetigt') === '1') {
out.doppelzaehlung_bestaetigt = true;
}
xhr.overrideMimeType('text/json');
return JSON.stringify(out);
}
@@ -82,6 +97,8 @@
document.getElementById(prefix + '-row-' + id).hidden = editing;
document.getElementById(prefix + '-edit-' + id).hidden = !editing;
}
if (window.FBDoppel) { window.FBDoppel.init(document); }
</script>
<footer class="version">Finanzberatungs-Tool v{{ app_version }}</footer>
</body>