This commit is contained in:
2026-07-17 00:41:09 +02:00
parent 9d96ecadfb
commit 9641eab2f4
2 changed files with 30 additions and 28 deletions
+3 -1
View File
@@ -119,9 +119,11 @@
preview.innerHTML = '<li class="list-group-item text-muted">Brak przypisanych pozycji — nic nie zostanie zaksięgowane.</li>';
return;
}
const total = keys.reduce((sum, k) => sum + groups[k].sum, 0);
preview.innerHTML = keys.map((k) =>
`<li class="list-group-item d-flex flex-column flex-sm-row justify-content-between gap-1"><span>${groups[k].label}</span><strong>${fmt(groups[k].sum)}</strong></li>`
).join('');
).join('') +
`<li class="list-group-item d-flex justify-content-between border-top"><strong>Razem</strong><strong>${fmt(total)}</strong></li>`;
}
rows.forEach((row) => {
row.querySelector('.js-cat').addEventListener('change', render);