Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -5,8 +5,6 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gorilla/mux"
|
|
||||||
"github.com/jung-kurt/gofpdf"
|
|
||||||
"log"
|
"log"
|
||||||
"math"
|
"math"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -15,6 +13,9 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/jung-kurt/gofpdf"
|
||||||
)
|
)
|
||||||
|
|
||||||
/* ===========================================================
|
/* ===========================================================
|
||||||
@@ -416,7 +417,7 @@ func newOrderPdf() (*gofpdf.Fpdf, error) {
|
|||||||
pdf.AliasNbPages("")
|
pdf.AliasNbPages("")
|
||||||
pdf.SetFooterFunc(func() {
|
pdf.SetFooterFunc(func() {
|
||||||
pdf.SetY(-10)
|
pdf.SetY(-10)
|
||||||
pdf.SetFont("dejavu", "", 8)
|
pdf.SetFont("dejavu", "B", 8)
|
||||||
txt := fmt.Sprintf("Sayfa %d/{nb}", pdf.PageNo())
|
txt := fmt.Sprintf("Sayfa %d/{nb}", pdf.PageNo())
|
||||||
pdf.CellFormat(0, 10, txt, "", 0, "R", false, 0, "")
|
pdf.CellFormat(0, 10, txt, "", 0, "R", false, 0, "")
|
||||||
})
|
})
|
||||||
@@ -724,7 +725,7 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 {
|
|||||||
pdf.SetFillColor(149, 113, 22) // Baggi altın
|
pdf.SetFillColor(149, 113, 22) // Baggi altın
|
||||||
pdf.Rect(titleX, titleY, titleW, 10, "F")
|
pdf.Rect(titleX, titleY, titleW, 10, "F")
|
||||||
|
|
||||||
pdf.SetFont("dejavu-b", "", 13)
|
pdf.SetFont("dejavu", "B", 13)
|
||||||
pdf.SetTextColor(255, 255, 255)
|
pdf.SetTextColor(255, 255, 255)
|
||||||
pdf.SetXY(titleX+4, titleY+2)
|
pdf.SetXY(titleX+4, titleY+2)
|
||||||
pdf.CellFormat(titleW-8, 6, "BAGGI TEKSTİL - SİPARİŞ FORMU", "", 0, "L", false, 0, "")
|
pdf.CellFormat(titleW-8, 6, "BAGGI TEKSTİL - SİPARİŞ FORMU", "", 0, "L", false, 0, "")
|
||||||
@@ -740,7 +741,7 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 {
|
|||||||
pdf.SetDrawColor(180, 180, 180)
|
pdf.SetDrawColor(180, 180, 180)
|
||||||
pdf.Rect(boxX, boxY, boxW, boxH, "")
|
pdf.Rect(boxX, boxY, boxW, boxH, "")
|
||||||
|
|
||||||
pdf.SetFont("dejavu-b", "", 9)
|
pdf.SetFont("dejavu", "B", 9)
|
||||||
pdf.SetTextColor(149, 113, 22)
|
pdf.SetTextColor(149, 113, 22)
|
||||||
rep := strings.TrimSpace(h.CustomerRep)
|
rep := strings.TrimSpace(h.CustomerRep)
|
||||||
if rep == "" {
|
if rep == "" {
|
||||||
@@ -795,7 +796,7 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 {
|
|||||||
pdf.Rect(marginL, y, pageW-marginL*2, descBoxH, "")
|
pdf.Rect(marginL, y, pageW-marginL*2, descBoxH, "")
|
||||||
|
|
||||||
// Başlık
|
// Başlık
|
||||||
pdf.SetFont("dejavu-b", "", 8)
|
pdf.SetFont("dejavu", "B", 8)
|
||||||
pdf.SetTextColor(149, 113, 22)
|
pdf.SetTextColor(149, 113, 22)
|
||||||
pdf.SetXY(marginL+3, y+2)
|
pdf.SetXY(marginL+3, y+2)
|
||||||
pdf.CellFormat(40, 4, "Sipariş Genel Açıklaması:", "", 0, "L", false, 0, "")
|
pdf.CellFormat(40, 4, "Sipariş Genel Açıklaması:", "", 0, "L", false, 0, "")
|
||||||
@@ -823,7 +824,7 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 {
|
|||||||
===========================================================
|
===========================================================
|
||||||
*/
|
*/
|
||||||
func drawGridHeader(pdf *gofpdf.Fpdf, layout pdfLayout, startY float64, catSizes CategorySizeMap) float64 {
|
func drawGridHeader(pdf *gofpdf.Fpdf, layout pdfLayout, startY float64, catSizes CategorySizeMap) float64 {
|
||||||
pdf.SetFont("dejavu-b", "", 6)
|
pdf.SetFont("dejavu", "B", 6)
|
||||||
pdf.SetDrawColor(baggiGrayBorderR, baggiGrayBorderG, baggiGrayBorderB)
|
pdf.SetDrawColor(baggiGrayBorderR, baggiGrayBorderG, baggiGrayBorderB)
|
||||||
pdf.SetFillColor(baggiCreamR, baggiCreamG, baggiCreamB)
|
pdf.SetFillColor(baggiCreamR, baggiCreamG, baggiCreamB)
|
||||||
pdf.SetTextColor(20, 20, 20) // 🟣 TÜM HEADER YAZILARI SİYAH
|
pdf.SetTextColor(20, 20, 20) // 🟣 TÜM HEADER YAZILARI SİYAH
|
||||||
@@ -1191,7 +1192,7 @@ func drawTotalsBox(
|
|||||||
valueX := x + w - 70 // değerlerin sağda hizalanacağı kolon
|
valueX := x + w - 70 // değerlerin sağda hizalanacağı kolon
|
||||||
|
|
||||||
pdf.SetTextColor(149, 113, 22) // Sol başlık gold
|
pdf.SetTextColor(149, 113, 22) // Sol başlık gold
|
||||||
pdf.SetFont("dejavu-b", "", 8.5)
|
pdf.SetFont("dejavu", "B", 8.5)
|
||||||
|
|
||||||
y := startY + 2
|
y := startY + 2
|
||||||
|
|
||||||
@@ -1202,7 +1203,7 @@ func drawTotalsBox(
|
|||||||
pdf.CellFormat(80, lineH, "TOPLAM TUTAR", "", 0, "L", false, 0, "")
|
pdf.CellFormat(80, lineH, "TOPLAM TUTAR", "", 0, "L", false, 0, "")
|
||||||
|
|
||||||
pdf.SetTextColor(201, 162, 39)
|
pdf.SetTextColor(201, 162, 39)
|
||||||
pdf.SetFont("dejavu-b", "", 9)
|
pdf.SetFont("dejavu", "B", 9)
|
||||||
|
|
||||||
pdf.SetXY(valueX, y)
|
pdf.SetXY(valueX, y)
|
||||||
pdf.CellFormat(65, lineH,
|
pdf.CellFormat(65, lineH,
|
||||||
@@ -1217,7 +1218,7 @@ func drawTotalsBox(
|
|||||||
if hasVat {
|
if hasVat {
|
||||||
|
|
||||||
pdf.SetTextColor(149, 113, 22) // gold başlık
|
pdf.SetTextColor(149, 113, 22) // gold başlık
|
||||||
pdf.SetFont("dejavu-b", "", 8.5)
|
pdf.SetFont("dejavu", "B", 8.5)
|
||||||
|
|
||||||
pdf.SetXY(labelX, y)
|
pdf.SetXY(labelX, y)
|
||||||
pdf.CellFormat(80, lineH,
|
pdf.CellFormat(80, lineH,
|
||||||
@@ -1225,7 +1226,7 @@ func drawTotalsBox(
|
|||||||
"", 0, "L", false, 0, "")
|
"", 0, "L", false, 0, "")
|
||||||
|
|
||||||
pdf.SetTextColor(20, 20, 20)
|
pdf.SetTextColor(20, 20, 20)
|
||||||
pdf.SetFont("dejavu-b", "", 9)
|
pdf.SetFont("dejavu", "B", 9)
|
||||||
|
|
||||||
pdf.SetXY(valueX, y)
|
pdf.SetXY(valueX, y)
|
||||||
pdf.CellFormat(65, lineH,
|
pdf.CellFormat(65, lineH,
|
||||||
@@ -1238,13 +1239,13 @@ func drawTotalsBox(
|
|||||||
3️⃣ KDV DAHİL TOPLAM
|
3️⃣ KDV DAHİL TOPLAM
|
||||||
---------------------------------------------------- */
|
---------------------------------------------------- */
|
||||||
pdf.SetTextColor(201, 162, 39)
|
pdf.SetTextColor(201, 162, 39)
|
||||||
pdf.SetFont("dejavu-b", "", 8.5)
|
pdf.SetFont("dejavu", "B", 8.5)
|
||||||
|
|
||||||
pdf.SetXY(labelX, y)
|
pdf.SetXY(labelX, y)
|
||||||
pdf.CellFormat(80, lineH, "KDV DAHİL TOPLAM TUTAR", "", 0, "L", false, 0, "")
|
pdf.CellFormat(80, lineH, "KDV DAHİL TOPLAM TUTAR", "", 0, "L", false, 0, "")
|
||||||
|
|
||||||
pdf.SetTextColor(20, 20, 20)
|
pdf.SetTextColor(20, 20, 20)
|
||||||
pdf.SetFont("dejavu-b", "", 9)
|
pdf.SetFont("dejavu", "B", 9)
|
||||||
|
|
||||||
pdf.SetXY(valueX, y)
|
pdf.SetXY(valueX, y)
|
||||||
pdf.CellFormat(65, lineH,
|
pdf.CellFormat(65, lineH,
|
||||||
@@ -1273,7 +1274,7 @@ func drawGroupSummaryBar(pdf *gofpdf.Fpdf, layout pdfLayout, groupName string, t
|
|||||||
pdf.SetDrawColor(214, 192, 106)
|
pdf.SetDrawColor(214, 192, 106)
|
||||||
pdf.Rect(x, y, w, h, "DF")
|
pdf.Rect(x, y, w, h, "DF")
|
||||||
|
|
||||||
pdf.SetFont("dejavu-b", "", 8.5)
|
pdf.SetFont("dejavu", "B", 8.5)
|
||||||
pdf.SetTextColor(20, 20, 20)
|
pdf.SetTextColor(20, 20, 20)
|
||||||
|
|
||||||
leftTxt := strings.ToUpper(strings.TrimSpace(groupName))
|
leftTxt := strings.ToUpper(strings.TrimSpace(groupName))
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ func resolveAssetPath(fileName string, relativeDirs []string) (string, error) {
|
|||||||
return "", fmt.Errorf("asset not found: %s (tried: %s)", fileName, strings.Join(tried, ", "))
|
return "", fmt.Errorf("asset not found: %s (tried: %s)", fileName, strings.Join(tried, ", "))
|
||||||
}
|
}
|
||||||
|
|
||||||
func registerDejavuFonts(pdf *gofpdf.Fpdf) error {
|
func registerDejavuFonts(pdf *gofpdf.Fpdf, s string, s2 string) error {
|
||||||
|
|
||||||
regPath, err := resolvePdfAssetPath("DejaVuSans.ttf")
|
regPath, err := resolvePdfAssetPath("DejaVuSans.ttf")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user