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:
@@ -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>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<tbody>
|
||||
{% for r in recurring %}
|
||||
<tr id="rec-row-{{ r.id }}">
|
||||
<td>{{ r.name }}</td>
|
||||
<td data-sort="{{ r.name }}">{{ r.name }}{% for kn in doppelt_posten.get(r.id, []) %}<span class="warn-hint">⚠ zählt evtl. doppelt mit Kredit „{{ kn }}“</span>{% endfor %}</td>
|
||||
<td class="{{ 'neg' if r.amount < 0 else '' }}" data-sort="{{ r.amount }}">{{ r.amount|eur }} €</td>
|
||||
<td>{{ r.rhythm|de_label }}</td>
|
||||
<td>{{ r.due_day }}</td>
|
||||
@@ -197,7 +197,7 @@
|
||||
<tbody>
|
||||
{% for l in loans %}
|
||||
<tr id="loan-row-{{ l.id }}">
|
||||
<td>{{ l.name }}</td>
|
||||
<td data-sort="{{ l.name }}">{{ l.name }}{% for pn in doppelt_kredit.get(l.id, []) %}<span class="warn-hint">⚠ zählt evtl. doppelt mit Posten „{{ pn }}“</span>{% endfor %}</td>
|
||||
<td data-sort="{{ l.principal }}">{{ l.principal|eur }} €</td>
|
||||
<td>{{ l.annual_rate_pct|eur }} %</td>
|
||||
<td data-sort="{{ l.term_months }}">{{ l.term_months }} Monate</td>
|
||||
|
||||
Reference in New Issue
Block a user