MWST optional: Schalter in Einstellungen (mwst_ausweisen), standardmassig Ausweis deaktiviert

This commit is contained in:
Erik Thiele
2026-07-02 14:39:12 +02:00
parent 4f3c6763ca
commit f77be1c07a
4 changed files with 32 additions and 15 deletions

View File

@@ -17,6 +17,7 @@ function getFormData() {
const type = el.dataset.type || 'text';
let val = el.value;
if (type === 'number') val = parseFloat(val) || 0;
else if (type === 'checkbox') val = el.checked;
data[key] = val;
});
data.dark_mode = document.documentElement.getAttribute('data-bs-theme') === 'dark';
@@ -52,10 +53,12 @@ function renderResult(calc) {
`Gewinn (${((document.querySelector('[data-var="gewinnmarge"]')?.value) || 20)}%): ${String(calc.gewinn.toFixed(2)).padStart(10)} EUR`,
`${'\u2500'.repeat(40)}`,
`Verkaufspreis (netto): ${String(calc.verkaufspreis.toFixed(2)).padStart(10)} EUR`,
`MwSt. (19%): ${String(calc.mwst.toFixed(2)).padStart(10)} EUR`,
`${'\u2550'.repeat(40)}`,
`GESAMT (brutto): ${String(calc.gesamt_brutto.toFixed(2)).padStart(10)} EUR`,
];
if (calc.mwst_ausweisen) {
lines.push(`MwSt. (19%): ${String(calc.mwst.toFixed(2)).padStart(10)} EUR`);
}
lines.push(`${'\u2550'.repeat(40)}`);
lines.push(`GESAMT: ${String(calc.gesamt_brutto.toFixed(2)).padStart(10)} EUR`);
document.getElementById('result-text').textContent = lines.join('\n');
const details = [