Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -265,8 +266,9 @@ func (c *costingPDF) drawHeaderFull() {
|
||||
firmaLabel = fmt.Sprintf("%s - %s", firmaLabel, strings.TrimSpace(c.header.UretimiYapanFirma))
|
||||
}
|
||||
line3 := fmt.Sprintf(
|
||||
"Firma: %s | Kaydeden: %s | Son Guncelleme: %s (%s)",
|
||||
"Firma: %s | 2.Firma: %s | Kaydeden: %s | Son Guncelleme: %s (%s)",
|
||||
firmaLabel,
|
||||
strings.TrimSpace(c.header.SonIsEmriVeren),
|
||||
strings.TrimSpace(c.header.SKullaniciAdi),
|
||||
formatDateTRDot(c.header.DteGuncellemeTarihi),
|
||||
strings.TrimSpace(c.header.SGuncellemeKullaniciAdi),
|
||||
@@ -509,7 +511,17 @@ func (c *costingPDF) drawGroup(g models.ProductionHasCostDetailGroup, firstGroup
|
||||
wn := []float64{8, 20, 22, 32, 70, 14, 14, 10, 16, 16, 16, 16} // sum = 250
|
||||
|
||||
c.drawTableHeader(cols, wn)
|
||||
for i, it := range g.Items {
|
||||
// PDF-specific ordering: by hammadde turu no, then code.
|
||||
items := append([]models.ProductionHasCostDetailGroupItem(nil), g.Items...)
|
||||
sort.Slice(items, func(i, j int) bool {
|
||||
ai, _ := strconv.Atoi(strings.TrimSpace(items[i].NHammaddeTuruNo))
|
||||
aj, _ := strconv.Atoi(strings.TrimSpace(items[j].NHammaddeTuruNo))
|
||||
if ai != aj {
|
||||
return ai < aj
|
||||
}
|
||||
return strings.TrimSpace(items[i].SKodu) < strings.TrimSpace(items[j].SKodu)
|
||||
})
|
||||
for i, it := range items {
|
||||
c.drawRowWithGroup(it, wn, cols, g, i)
|
||||
}
|
||||
pdf.Ln(2)
|
||||
|
||||
Reference in New Issue
Block a user