/** * Interaktiver Handelskalkulations-Trainer für ITSM & KDM * IHK ZPA Nord-West AP2 */ (function() { function renderHandelskalkulation(containerId) { const container = document.getElementById(containerId); if (!container) return; container.innerHTML = `

📊 Interaktiver Handelskalkulations-Trainer (ITSM / KDM)

Geben Sie die kaufmännischen Eckdaten ein, um das Vorwärtskalkulations-Schema nach IHK-Standard durchzurechnen:

Listeneinkaufspreis: 0,00 €
- Lieferantenrabatt: 0,00 €
= Zieleinkaufspreis: 0,00 €
- Lieferantenskonto: 0,00 €
= Bareinkaufspreis: 0,00 €
+ Bezugskosten: 0,00 €
= Einstandspreis (Bezugspreis): 0,00 €
+ Handlungskosten: 0,00 €
= Selbstkostenpreis: 0,00 €
+ Gewinnzuschlag: 0,00 €
= Barverkaufspreis (BVP netto): 0,00 €
`; function update() { const lep = parseFloat(document.getElementById('kalk_lep').value) || 0; const rabP = parseFloat(document.getElementById('kalk_rab').value) || 0; const skoP = parseFloat(document.getElementById('kalk_sko').value) || 0; const bezug = parseFloat(document.getElementById('kalk_bezug').value) || 0; const hkzP = parseFloat(document.getElementById('kalk_hkz').value) || 0; const gewinnP = parseFloat(document.getElementById('kalk_gewinn').value) || 0; const rab = lep * (rabP / 100); const zep = lep - rab; const sko = zep * (skoP / 100); const bep = zep - sko; const einstand = bep + bezug; const hkz = einstand * (hkzP / 100); const sk = einstand + hkz; const gewinn = sk * (gewinnP / 100); const bvp = sk + gewinn; const fmt = (v) => v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' €'; document.getElementById('out_lep').textContent = fmt(lep); document.getElementById('out_rab').textContent = '- ' + fmt(rab); document.getElementById('out_zep').textContent = fmt(zep); document.getElementById('out_sko').textContent = '- ' + fmt(sko); document.getElementById('out_bep').textContent = fmt(bep); document.getElementById('out_bezug').textContent = '+ ' + fmt(bezug); document.getElementById('out_einstand').textContent = fmt(einstand); document.getElementById('out_hkz').textContent = '+ ' + fmt(hkz); document.getElementById('out_sk').textContent = fmt(sk); document.getElementById('out_gewinn').textContent = '+ ' + fmt(gewinn); document.getElementById('out_bvp').textContent = fmt(bvp); } ['kalk_lep', 'kalk_rab', 'kalk_sko', 'kalk_bezug', 'kalk_hkz', 'kalk_gewinn'].forEach(id => { document.getElementById(id).addEventListener('input', update); }); update(); } window.renderHandelskalkulation = renderHandelskalkulation; document.addEventListener('DOMContentLoaded', () => { if (document.getElementById('handelskalkulation-app')) { renderHandelskalkulation('handelskalkulation-app'); } }); })();