Skip to content
Snippets Groups Projects

Replace cost unit endpoints for staff member

Merged Martin Mechtel requested to merge beta-4 into develop
14 files
+ 697
203
Compare changes
  • Side-by-side
  • Inline
Files
14
import {
AlignmentType, Document, HeadingLevel, Packer, Paragraph, Table, TableCell, TableRow, WidthType
} from 'docx';
import { getPropertyLabel, getPropertyValueAsString } from '@lib/properties';
import { StaffService } from '../database/services/staff.service';
export class DownloadDocx {
@@ -12,11 +13,21 @@ export class DownloadDocx {
const propRows = properties.map(p => new TableRow({
children: [
new TableCell({
children: [new Paragraph(p)],
children: [new Paragraph({
text: getPropertyLabel(p),
spacing: {
before: 100, after: 100
}
})],
width: { size: 50, type: WidthType.PERCENTAGE }
}),
new TableCell({
children: [new Paragraph(staffData[p])],
children: [new Paragraph({
text: getPropertyValueAsString(p, staffData[p]),
spacing: {
before: 100, after: 100
}
})],
width: { size: 50, type: WidthType.PERCENTAGE }
})
]
@@ -31,8 +42,15 @@ export class DownloadDocx {
const doc = new Document({
sections: [{
children: [
new Paragraph({
text: 'MANDANT: IQB',
heading: HeadingLevel.HEADING_2,
alignment: AlignmentType.RIGHT
}),
new Paragraph({ text: `${dateNow.getDate()}.${dateNow.getMonth() + 1}.${dateNow.getFullYear()}` }),
new Paragraph({ text: 'Bearbeiter*in: ' }),
new Paragraph({ text: 'gültig von (Startdatum):' }),
new Paragraph({ text: 'gültig bis (Enddatum):' }),
new Paragraph({
text: 'Berechnungs- und Anweisungsauftrag',
heading: HeadingLevel.HEADING_1,
@@ -52,7 +70,8 @@ export class DownloadDocx {
new Paragraph({ text: `Personalnummer: ${staffData.payrollId || '?'}` }),
new Paragraph({ text: '' }),
table,
new Paragraph({ text: '' })
new Paragraph({ text: '' }),
new Paragraph({ text: 'Notizen/Hinweise:' })
]
}]
});
Loading