diff --git a/Dienstplan_Portable.html b/Dienstplan_Portable.html index 5fa79f0..0d8931f 100644 --- a/Dienstplan_Portable.html +++ b/Dienstplan_Portable.html @@ -1296,20 +1296,23 @@ class DienstplanApp { totalBonus += bonus; - // Generate note for this employee + // Generate note for this employee - cleaner, more professional format const safeName = this.sanitizeName(name); - let note = `${safeName}: `; + let note = ''; if (!thresholdReached) { - note += `Erreicht das Bonussystem nicht (nur ${we_total.toFixed(1)} WE-Einheiten, mind. 2,0 erforderlich).`; + note = `${safeName} erreicht die Mindestschwelle nicht (${we_total.toFixed(1)} von 2,0 WE-Einheiten) und erhält daher keine Bonuszahlung.`; } else { - const details = []; - if (data.wt > 0) details.push(`${data.wt.toFixed(1)} WT × 250€`); - if (data.we_fr > 0 || data.we_other > 0) { - const paid_we = we_total - 1.0; - details.push(`${paid_we.toFixed(1)} WE × 450€ (abzgl. 1,0 Abzug von ${deductedFrom})`); + const paid_we = we_total - 1.0; + let breakdown = []; + if (data.wt > 0) breakdown.push(`${data.wt.toFixed(1)} WT-Einheiten à 250 €`); + if (paid_we > 0) breakdown.push(`${paid_we.toFixed(1)} WE-Einheiten à 450 €`); + + note = `${safeName} erhält eine Bonuszahlung von ${this.formatCurrency(bonus)}`; + if (breakdown.length > 0) { + note += ` (${breakdown.join(' + ')})`; } - note += `Erhält ${this.formatCurrency(bonus)}. ${details.join(', ')}.`; + note += '.'; } employeeNotes.push(note); diff --git a/webapp/app.js b/webapp/app.js index 45a3519..dd97592 100644 --- a/webapp/app.js +++ b/webapp/app.js @@ -757,20 +757,23 @@ class DienstplanApp { totalBonus += bonus; - // Generate note + // Generate note - cleaner, more professional format const safeName = escapeHtml(name); - let note = `${safeName}: `; + let note = ''; if (!thresholdReached) { - note += `Erreicht das Bonussystem nicht (nur ${we_total.toFixed(1)} WE-Einheiten, mind. 2,0 erforderlich).`; + note = `${safeName} erreicht die Mindestschwelle nicht (${we_total.toFixed(1)} von 2,0 WE-Einheiten) und erhält daher keine Bonuszahlung.`; } else { - const details = []; - if (data.wt > 0) details.push(`${data.wt.toFixed(1)} WT × 250€`); - if (data.we_fr > 0 || data.we_other > 0) { - const paid_we = we_total - 1.0; - details.push(`${paid_we.toFixed(1)} WE × 450€ (abzgl. 1,0 Abzug von ${deductedFrom})`); + const paid_we = we_total - 1.0; + let breakdown = []; + if (data.wt > 0) breakdown.push(`${data.wt.toFixed(1)} WT-Einheiten à 250 €`); + if (paid_we > 0) breakdown.push(`${paid_we.toFixed(1)} WE-Einheiten à 450 €`); + + note = `${safeName} erhält eine Bonuszahlung von ${this.calculator.formatCurrency(bonus)}`; + if (breakdown.length > 0) { + note += ` (${breakdown.join(' + ')})`; } - note += `Erhält ${this.calculator.formatCurrency(bonus)}. ${details.join(', ')}.`; + note += '.'; } employeeNotes.push(note);