diff --git a/svc/routes/order_pdf.go b/svc/routes/order_pdf.go index 24f6269..f8331b1 100644 --- a/svc/routes/order_pdf.go +++ b/svc/routes/order_pdf.go @@ -444,6 +444,20 @@ func contains(list []string, v string) bool { return false } +func formatPdfSizeLabel(cat, size string) string { + s := strings.TrimSpace(size) + if s == "" { + return s + } + if cat == catYas { + up := strings.ToUpper(s) + if _, err := strconv.Atoi(up); err == nil { + return up + "Y" + } + } + return s +} + /* =========================================================== 2) PDF OLUŞTURUCU (A4 YATAY + FOOTER) =========================================================== */ @@ -987,8 +1001,9 @@ func drawGridHeader(pdf *gofpdf.Fpdf, layout pdfLayout, startY float64, catSizes for i := 0; i < 16; i++ { pdf.Rect(xx, cy, colW, layout.HeaderSizeH, "") if i < len(sizes) { + label := formatPdfSizeLabel(cat, sizes[i]) pdf.SetXY(xx, cy+1) - pdf.CellFormat(colW, layout.HeaderSizeH-2, sizes[i], "", 0, "C", false, 0, "") + pdf.CellFormat(colW, layout.HeaderSizeH-2, label, "", 0, "C", false, 0, "") } xx += colW }