This commit is contained in:
Matthias Hochmeister
2026-03-26 14:44:30 +01:00
parent 3e5086441e
commit 841b6e3775

View File

@@ -488,11 +488,9 @@ export default function BestellungDetail() {
margin: { left: 10, right: 10 },
styles: { fontSize: 9, cellPadding: 2 },
columnStyles: {
0: { cellWidth: 60 },
1: { cellWidth: 28 },
2: { cellWidth: 25, halign: 'right' },
3: { cellWidth: 30, halign: 'right' },
4: { cellWidth: 30, halign: 'right' },
2: { halign: 'right' },
3: { halign: 'right' },
4: { halign: 'right' },
},
didParseCell: (data: any) => {
if (data.section === 'body') {
@@ -504,6 +502,17 @@ export default function BestellungDetail() {
}
}
},
didDrawCell: (data: any) => {
if (data.section === 'body' && data.column.index === 0) {
const cell0 = String(data.row.raw?.[0] ?? '');
if (!cell0.startsWith(' •') && data.row.index > 0) {
const { doc, row, settings } = data;
doc.setDrawColor(200, 200, 200);
doc.setLineWidth(0.2);
doc.line(settings.margin.left, row.y, doc.internal.pageSize.width - settings.margin.right, row.y);
}
}
},
foot: [
['', '', '', 'Netto:', formatCurrency(totalNetto)],
['', '', '', `Brutto (${bestellung.steuersatz ?? 20}% USt.):`, formatCurrency(totalBrutto)],
@@ -531,9 +540,7 @@ export default function BestellungDetail() {
margin: { left: 10, right: 10 },
styles: { fontSize: 9, cellPadding: 2 },
columnStyles: {
0: { cellWidth: 100 },
1: { cellWidth: 40 },
2: { cellWidth: 33, halign: 'right' },
2: { halign: 'right' },
},
didParseCell: (data: any) => {
if (data.section === 'body') {
@@ -545,6 +552,17 @@ export default function BestellungDetail() {
}
}
},
didDrawCell: (data: any) => {
if (data.section === 'body' && data.column.index === 0) {
const cell0 = String(data.row.raw?.[0] ?? '');
if (!cell0.startsWith(' •') && data.row.index > 0) {
const { doc, row, settings } = data;
doc.setDrawColor(200, 200, 200);
doc.setLineWidth(0.2);
doc.line(settings.margin.left, row.y, doc.internal.pageSize.width - settings.margin.right, row.y);
}
}
},
didDrawPage: addPdfFooter(doc, settings),
});
}