Merge pull request 'Fix n.n.: Summe der Anteile in den Splittabellen der Regeln' (#91) from fds2610-bot/Finanzmanager:main into main
Reviewed-on: https://codeberg.org/fds2610/Finanzmanager/pulls/91
This commit is contained in:
commit
0cfdae8b38
4 changed files with 48 additions and 3 deletions
|
|
@ -6,6 +6,11 @@ Das Format folgt [Keep a Changelog](https://keepachangelog.com/de/1.1.0/).
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- Regeln: Die Splittabellen zeigen die Spalte „Anteil“ ohne Prozentzeichen und darunter die
|
||||
laufend berechnete Summe der Anteile
|
||||
|
||||
### Fixed
|
||||
|
||||
- Echtzeitüberweisung scheiterte an Banken, die nur das ISO-Format pain.001.001.09 führen;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
# Änderungen
|
||||
|
||||
## Regeln: Summe der Anteile in den Splittabellen (29.09.2026)
|
||||
|
||||
- Die Spalte „Anteil %“ heißt in den Splittabellen der Regeln nur noch „Anteil“, da die
|
||||
Anteile zueinander gelten und keine Prozentwerte sein müssen.
|
||||
- Unter den Anteilen steht eine Summenzeile, die sich mit jeder Eingabe in derselben
|
||||
Tabelle neu berechnet (`public/static/app.js`).
|
||||
|
||||
## Zahlungsverkehr: Echtzeitüberweisung scheiterte am SEPA-Format der Bank (28.09.2026)
|
||||
|
||||
Eine Echtzeitüberweisung schlug mit „Für Echtzeitüberweisungen nimmt die Bank nur
|
||||
|
|
|
|||
|
|
@ -376,3 +376,30 @@
|
|||
}
|
||||
};
|
||||
})();
|
||||
|
||||
// Summe der Anteile in den Splittabellen der Abgleichregeln (regelsplits.php).
|
||||
// Sie wird beim Laden und bei jeder Eingabe in einem Anteilsfeld derselben
|
||||
// Tabelle neu berechnet.
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
document.querySelectorAll('table[data-anteilssumme]').forEach(function (tabelle) {
|
||||
const ausgabe = tabelle.querySelector('.anteilssumme');
|
||||
const felder = tabelle.querySelectorAll('input[name$="[prozent]"]');
|
||||
|
||||
const berechnen = function () {
|
||||
let summe = 0;
|
||||
felder.forEach(function (feld) {
|
||||
const zahl = parseFloat(feld.value.trim().replace(',', '.'));
|
||||
if (!isNaN(zahl)) { summe += zahl; }
|
||||
});
|
||||
ausgabe.textContent = (Math.round(summe * 100) / 100).toLocaleString('de-DE', {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2
|
||||
});
|
||||
};
|
||||
|
||||
felder.forEach(function (feld) { feld.addEventListener('input', berechnen); });
|
||||
berechnen();
|
||||
});
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ for ($i = count($splitZeilen); $i < $anzahl; $i++) {
|
|||
$fuerFormular = $splitForm === '' ? '' : ' form="' . View::h($splitForm) . '"';
|
||||
?>
|
||||
|
||||
<table class="liste splittabelle">
|
||||
<table class="liste splittabelle" data-anteilssumme>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Kategorie</th><th>Klasse</th><th>Notiz</th><th class="rechts">Anteil %</th>
|
||||
<th>Kategorie</th><th>Klasse</th><th>Notiz</th><th class="rechts">Anteil</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -58,7 +58,7 @@ $fuerFormular = $splitForm === '' ? '' : ' form="' . View::h($splitForm) . '"';
|
|||
<input type="text"<?= $fuerFormular ?> name="split[<?= (int)$nr ?>][notiz]"
|
||||
value="<?= View::h((string)($zeile['notiz'] ?? '')) ?>">
|
||||
</td>
|
||||
<td>
|
||||
<td class="rechts">
|
||||
<input type="text" class="rechts schmal" inputmode="decimal"<?= $fuerFormular ?>
|
||||
name="split[<?= (int)$nr ?>][prozent]"
|
||||
value="<?= $zeile['prozent'] === '' ? '' : View::h(number_format((float)$zeile['prozent'], 2, ',', '')) ?>">
|
||||
|
|
@ -66,6 +66,12 @@ $fuerFormular = $splitForm === '' ? '' : ' form="' . View::h($splitForm) . '"';
|
|||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="3" class="rechts">Summe</td>
|
||||
<td class="rechts anteilssumme"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<p class="feldhinweis">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue