update
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user