This commit is contained in:
2026-08-19 12:39:14 +02:00
parent 28d4f51d7d
commit 4012170172
5 changed files with 12 additions and 3 deletions
+10 -1
View File
@@ -103,7 +103,16 @@ export async function createPdfReport(data,{year,accountId}={}){
const cols=[{label:'Art',width:88},{label:'Bezeichnung',width:167},{label:'Kategorie',width:105},{label:'Zufluss',width:68,align:'right'},{label:'Abfluss',width:67,align:'right'}];
for(let monthIndex=0;monthIndex<12;monthIndex++){
const monthRows=rows.filter(r=>r.monthIndex===monthIndex);const month=forecast.rows[monthIndex];
addPageIfNeeded(doc,115);doc.fillColor('#17233B').font('Helvetica-Bold').fontSize(14).text(month.name);doc.moveDown(.35);
// Jeder Monat beginnt auf einer eigenen Seite. Der Monatsname steht immer
// links und nutzt die volle Inhaltsbreite, damit er niemals umbrechen kann.
doc.addPage();
drawPdfHeader(doc,`Kontoauszug ${reportYear}`,account.name);
const monthY=doc.y;
doc.fillColor('#17233B').font('Helvetica-Bold').fontSize(16)
.text(month.name,50,monthY,{width:495,align:'left',lineBreak:false});
doc.y=monthY+24;
pdfMetricRow(doc,[{label:'Zuflüsse',value:pdfMoney(month.displayIncome),positive:true},{label:'Abflüsse',value:pdfMoney(month.displayExpense),negative:true},{label:'Nettofluss',value:pdfMoney(month.balance),positive:month.balance>=0,negative:month.balance<0}]);
if(!monthRows.length){doc.fillColor('#667085').font('Helvetica').fontSize(8).text('Keine geplanten Kontobewegungen.');doc.moveDown(.8);continue;}
pdfTableHeader(doc,cols);