Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -335,7 +335,6 @@ type pdfGroupTotalRow struct {
|
||||
func (c *costingPDF) drawHeaderSummaryTables() {
|
||||
pdf := c.pdf
|
||||
|
||||
partRows := c.computePartSummary()
|
||||
groupRows, grandTRY, grandUSD, grandEUR := c.computeGroupTotals()
|
||||
|
||||
// Table styling (use same brand palette as statements PDF)
|
||||
@@ -345,28 +344,6 @@ func (c *costingPDF) drawHeaderSummaryTables() {
|
||||
pdf.CellFormat(0, 5.5, "Ozet", "", 1, "L", false, 0, "")
|
||||
pdf.SetTextColor(0, 0, 0)
|
||||
|
||||
// Part-based summary table
|
||||
pdf.SetFont("dejavu", "B", 8.2)
|
||||
pdf.CellFormat(0, 4.8, "Parca Bazli Maliyet Ozellikleri", "", 1, "L", false, 0, "")
|
||||
partCols := []string{"Parca", "TRY", "USD", "EUR"}
|
||||
partW := []float64{70, 22, 22, 22}
|
||||
// Add TOTAL row
|
||||
totalTry, totalUsd, totalEur := 0.0, 0.0, 0.0
|
||||
for _, r := range partRows {
|
||||
totalTry += r.try
|
||||
totalUsd += r.usd
|
||||
totalEur += r.eur
|
||||
}
|
||||
partRowsWithTotal := append(partRows, pdfPartSummaryRow{name: "TOPLAM", try: totalTry, usd: totalUsd, eur: totalEur})
|
||||
c.drawMiniTable(partCols, partW, func(i int) []string {
|
||||
if i >= len(partRowsWithTotal) {
|
||||
return nil
|
||||
}
|
||||
r := partRowsWithTotal[i]
|
||||
return []string{r.name, pdfMoney(r.try), pdfMoney(r.usd), pdfMoney(r.eur)}
|
||||
}, len(partRowsWithTotal), true, true)
|
||||
pdf.Ln(2)
|
||||
|
||||
// Group totals table
|
||||
pdf.SetFont("dejavu", "B", 8.2)
|
||||
pdf.CellFormat(0, 4.8, "Grup Toplamlari", "", 1, "L", false, 0, "")
|
||||
@@ -515,6 +492,7 @@ func (c *costingPDF) drawMiniTable(cols []string, widths []float64, rowFn func(i
|
||||
pdf.SetXY(x0, y+rh)
|
||||
}
|
||||
pdf.SetTextColor(0, 0, 0)
|
||||
pdf.SetFont("dejavu", "", 7.4)
|
||||
}
|
||||
|
||||
func formatDateTRDot(s string) string {
|
||||
@@ -537,6 +515,9 @@ func formatDateTRDot(s string) string {
|
||||
|
||||
func (c *costingPDF) drawGroup(g models.ProductionHasCostDetailGroup, firstGroup bool) {
|
||||
pdf := c.pdf
|
||||
// Reset any font/color left over from header summary tables.
|
||||
pdf.SetFont("dejavu", "", 7.2)
|
||||
pdf.SetTextColor(0, 0, 0)
|
||||
|
||||
// Group bar
|
||||
c.drawGroupBar(g, false)
|
||||
|
||||
Reference in New Issue
Block a user