PDF Calc, Cosmetics
This commit is contained in:
@@ -251,12 +251,13 @@ function generatePDF(timesheetId, req, res) {
|
||||
doc.moveTo(50, y).lineTo(550, y).stroke();
|
||||
doc.moveDown(0.5);
|
||||
doc.font('Helvetica-Bold');
|
||||
doc.text(`Gesamtstunden: ${totalHours.toFixed(2)} h`, 50, doc.y);
|
||||
// Gesamtstunden = Arbeitsstunden + Urlaubsstunden (Urlaub zählt als Arbeitszeit)
|
||||
const totalHoursWithVacation = totalHours + vacationHours;
|
||||
doc.text(`Gesamtstunden: ${totalHoursWithVacation.toFixed(2)} h`, 50, doc.y);
|
||||
|
||||
// Überstunden berechnen und anzeigen
|
||||
const wochenstunden = timesheet.wochenstunden || 0;
|
||||
// Überstunden = (Tatsächliche Stunden + Urlaubsstunden) - Wochenstunden
|
||||
const totalHoursWithVacation = totalHours + vacationHours;
|
||||
const overtimeHours = totalHoursWithVacation - wochenstunden;
|
||||
|
||||
doc.moveDown(0.3);
|
||||
@@ -467,11 +468,12 @@ function generatePDFToBuffer(timesheetId, req) {
|
||||
doc.moveTo(50, y).lineTo(550, y).stroke();
|
||||
doc.moveDown(0.5);
|
||||
doc.font('Helvetica-Bold');
|
||||
doc.text(`Gesamtstunden: ${totalHours.toFixed(2)} h`, 50, doc.y);
|
||||
// Gesamtstunden = Arbeitsstunden + Urlaubsstunden (Urlaub zählt als Arbeitszeit)
|
||||
const totalHoursWithVacation = totalHours + vacationHours;
|
||||
doc.text(`Gesamtstunden: ${totalHoursWithVacation.toFixed(2)} h`, 50, doc.y);
|
||||
|
||||
const wochenstunden = timesheet.wochenstunden || 0;
|
||||
// Überstunden = (Tatsächliche Stunden + Urlaubsstunden) - Wochenstunden
|
||||
const totalHoursWithVacation = totalHours + vacationHours;
|
||||
const overtimeHours = totalHoursWithVacation - wochenstunden;
|
||||
|
||||
doc.moveDown(0.3);
|
||||
|
||||
Reference in New Issue
Block a user