Improve bonus report text format for cleaner output
Co-authored-by: Kenearos <86194771+Kenearos@users.noreply.github.com>
This commit is contained in:
parent
a2cc8340ee
commit
f5d300bfed
2 changed files with 24 additions and 18 deletions
|
|
@ -1296,20 +1296,23 @@ class DienstplanApp {
|
||||||
|
|
||||||
totalBonus += bonus;
|
totalBonus += bonus;
|
||||||
|
|
||||||
// Generate note for this employee
|
// Generate note for this employee - cleaner, more professional format
|
||||||
const safeName = this.sanitizeName(name);
|
const safeName = this.sanitizeName(name);
|
||||||
let note = `<b>${safeName}</b>: `;
|
let note = '';
|
||||||
|
|
||||||
if (!thresholdReached) {
|
if (!thresholdReached) {
|
||||||
note += `Erreicht das Bonussystem nicht (nur ${we_total.toFixed(1)} WE-Einheiten, mind. 2,0 erforderlich).`;
|
note = `<b>${safeName}</b> erreicht die Mindestschwelle nicht (${we_total.toFixed(1)} von 2,0 WE-Einheiten) und erhält daher keine Bonuszahlung.`;
|
||||||
} else {
|
} 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;
|
const paid_we = we_total - 1.0;
|
||||||
details.push(`${paid_we.toFixed(1)} WE × 450€ (abzgl. 1,0 Abzug von ${deductedFrom})`);
|
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 = `<b>${safeName}</b> erhält eine Bonuszahlung von <span style="color: #28a745; font-weight: bold;">${this.formatCurrency(bonus)}</span>`;
|
||||||
|
if (breakdown.length > 0) {
|
||||||
|
note += ` (${breakdown.join(' + ')})`;
|
||||||
}
|
}
|
||||||
note += `Erhält ${this.formatCurrency(bonus)}. ${details.join(', ')}.`;
|
note += '.';
|
||||||
}
|
}
|
||||||
employeeNotes.push(note);
|
employeeNotes.push(note);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -757,20 +757,23 @@ class DienstplanApp {
|
||||||
|
|
||||||
totalBonus += bonus;
|
totalBonus += bonus;
|
||||||
|
|
||||||
// Generate note
|
// Generate note - cleaner, more professional format
|
||||||
const safeName = escapeHtml(name);
|
const safeName = escapeHtml(name);
|
||||||
let note = `<b>${safeName}</b>: `;
|
let note = '';
|
||||||
|
|
||||||
if (!thresholdReached) {
|
if (!thresholdReached) {
|
||||||
note += `Erreicht das Bonussystem nicht (nur ${we_total.toFixed(1)} WE-Einheiten, mind. 2,0 erforderlich).`;
|
note = `<b>${safeName}</b> erreicht die Mindestschwelle nicht (${we_total.toFixed(1)} von 2,0 WE-Einheiten) und erhält daher keine Bonuszahlung.`;
|
||||||
} else {
|
} 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;
|
const paid_we = we_total - 1.0;
|
||||||
details.push(`${paid_we.toFixed(1)} WE × 450€ (abzgl. 1,0 Abzug von ${deductedFrom})`);
|
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 = `<b>${safeName}</b> erhält eine Bonuszahlung von <span style="color: #28a745; font-weight: bold;">${this.calculator.formatCurrency(bonus)}</span>`;
|
||||||
|
if (breakdown.length > 0) {
|
||||||
|
note += ` (${breakdown.join(' + ')})`;
|
||||||
}
|
}
|
||||||
note += `Erhält ${this.calculator.formatCurrency(bonus)}. ${details.join(', ')}.`;
|
note += '.';
|
||||||
}
|
}
|
||||||
employeeNotes.push(note);
|
employeeNotes.push(note);
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue