From 84466e87babdef64f3db7884be2416c4862784b3 Mon Sep 17 00:00:00 2001 From: M_Kececi Date: Tue, 17 Mar 2026 11:08:43 +0300 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- svc/routes/customer_balance_pdf.go | 2 ++ svc/routes/statement_aging_screen_pdf.go | 26 +++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/svc/routes/customer_balance_pdf.go b/svc/routes/customer_balance_pdf.go index ceace52..3d76412 100644 --- a/svc/routes/customer_balance_pdf.go +++ b/svc/routes/customer_balance_pdf.go @@ -434,6 +434,8 @@ func drawCustomerBalancePDF( if needPage(rowH) { header() drawSummaryHeader() + pdf.SetFont("dejavu", "", 7.2) + pdf.SetTextColor(20, 20, 20) } y := pdf.GetY() diff --git a/svc/routes/statement_aging_screen_pdf.go b/svc/routes/statement_aging_screen_pdf.go index f5dc1b7..24dbe08 100644 --- a/svc/routes/statement_aging_screen_pdf.go +++ b/svc/routes/statement_aging_screen_pdf.go @@ -206,11 +206,14 @@ func drawStatementAgingScreenPDF(pdf *gofpdf.Fpdf, selectedDate, accountCode str } pdf.SetY(y + h) } + setDataTextStyle := func(size float64, r, g, b int) { + pdf.SetFont("dejavu", "", size) + pdf.SetTextColor(r, g, b) + } header() drawHeaderRow(masterCols, masterW, 6.2, 149, 113, 22, 7.2) - pdf.SetFont("dejavu", "", 7) - pdf.SetTextColor(25, 25, 25) + setDataTextStyle(7, 25, 25, 25) for _, m := range masters { masterLine := []string{ @@ -228,9 +231,9 @@ func drawStatementAgingScreenPDF(pdf *gofpdf.Fpdf, selectedDate, accountCode str if needPage(rowH) { header() drawHeaderRow(masterCols, masterW, 6.2, 149, 113, 22, 7.2) - pdf.SetFont("dejavu", "", 7) - pdf.SetTextColor(25, 25, 25) + setDataTextStyle(7, 25, 25, 25) } + setDataTextStyle(7, 25, 25, 25) y := pdf.GetY() x := marginL @@ -252,15 +255,13 @@ func drawStatementAgingScreenPDF(pdf *gofpdf.Fpdf, selectedDate, accountCode str if needPage(11.2) { header() drawHeaderRow(masterCols, masterW, 6.2, 149, 113, 22, 7.2) - pdf.SetFont("dejavu", "", 7) - pdf.SetTextColor(25, 25, 25) + setDataTextStyle(7, 25, 25, 25) } pdf.SetFont("dejavu", "B", 7) drawHeaderRow(currencyCols, currencyW, 5.6, 76, 95, 122, 6.8) - pdf.SetFont("dejavu", "", 6.8) - pdf.SetTextColor(35, 35, 35) + setDataTextStyle(6.8, 35, 35, 35) currencyLine := []string{ c.DocCurrencyCode, strconv.Itoa(c.SatirSayisi), @@ -291,8 +292,7 @@ func drawStatementAgingScreenPDF(pdf *gofpdf.Fpdf, selectedDate, accountCode str pdf.SetY(y + cRowH) drawHeaderRow(detailCols, detailW, 5.6, 31, 59, 91, 6.8) - pdf.SetFont("dejavu", "", 6.6) - pdf.SetTextColor(30, 30, 30) + setDataTextStyle(6.6, 30, 30, 30) for _, d := range detailsByCurrency[c.GroupKey] { line := []string{ @@ -317,8 +317,7 @@ func drawStatementAgingScreenPDF(pdf *gofpdf.Fpdf, selectedDate, accountCode str drawHeaderRow(masterCols, masterW, 6.2, 149, 113, 22, 7.2) pdf.SetFont("dejavu", "B", 7) drawHeaderRow(currencyCols, currencyW, 5.6, 76, 95, 122, 6.8) - pdf.SetFont("dejavu", "", 6.8) - pdf.SetTextColor(35, 35, 35) + setDataTextStyle(6.8, 35, 35, 35) y = pdf.GetY() x = marginL for i, v := range currencyLine { @@ -335,8 +334,7 @@ func drawStatementAgingScreenPDF(pdf *gofpdf.Fpdf, selectedDate, accountCode str } pdf.SetY(y + cRowH) drawHeaderRow(detailCols, detailW, 5.6, 31, 59, 91, 6.8) - pdf.SetFont("dejavu", "", 6.6) - pdf.SetTextColor(30, 30, 30) + setDataTextStyle(6.6, 30, 30, 30) } rowY := pdf.GetY()