Icons, Footer, Stundenformel
This commit is contained in:
@@ -187,7 +187,11 @@ function generatePDF(timesheetId, req, res) {
|
||||
if (row.type === 'holiday') {
|
||||
y = doc.y;
|
||||
x = 50;
|
||||
const rowData = [formatDate(row.date), '-', '-', '-', fullDayHours.toFixed(2) + ' h (Feiertag)'];
|
||||
// Feiertag am Wochenende: keine Tagesarbeitsstunden anzeigen
|
||||
const holidayDay = new Date(row.date + 'T12:00:00').getDay();
|
||||
const isWeekendHoliday = (holidayDay === 0 || holidayDay === 6);
|
||||
const holidayHoursStr = isWeekendHoliday ? '0 h (Feiertag)' : fullDayHours.toFixed(2) + ' h (Feiertag)';
|
||||
const rowData = [formatDate(row.date), '-', '-', '-', holidayHoursStr];
|
||||
rowData.forEach((data, i) => {
|
||||
doc.text(data, x, y, { width: colWidths[i], align: 'left' });
|
||||
x += colWidths[i];
|
||||
@@ -455,7 +459,11 @@ function generatePDFToBuffer(timesheetId, req) {
|
||||
if (row.type === 'holiday') {
|
||||
y = doc.y;
|
||||
x = 50;
|
||||
const rowDataBuf = [formatDate(row.date), '-', '-', '-', fullDayHoursBuf.toFixed(2) + ' h (Feiertag)'];
|
||||
// Feiertag am Wochenende: keine Tagesarbeitsstunden anzeigen
|
||||
const holidayDay = new Date(row.date + 'T12:00:00').getDay();
|
||||
const isWeekendHoliday = (holidayDay === 0 || holidayDay === 6);
|
||||
const holidayHoursStr = isWeekendHoliday ? '0 h (Feiertag)' : fullDayHoursBuf.toFixed(2) + ' h (Feiertag)';
|
||||
const rowDataBuf = [formatDate(row.date), '-', '-', '-', holidayHoursStr];
|
||||
rowDataBuf.forEach((data, i) => {
|
||||
doc.text(data, x, y, { width: colWidths[i], align: 'left' });
|
||||
x += colWidths[i];
|
||||
|
||||
Reference in New Issue
Block a user