This commit is contained in:
邹宗楠
2025-06-09 15:45:59 +08:00
parent 57f5c312fe
commit 13950ec978
4 changed files with 136 additions and 33 deletions

View File

@@ -75,9 +75,19 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
<FS>%s</FS>\n
\n
\n
商品明细: \n
商品明细: \n`
points := `
品名 数量 小计\n
--------------------------------\n`
quote := `
品名 数量 \n
--------------------------------\n`
switch order.EarningType {
case model.EarningTypePoints: // 扣点
orderFmt += points
case model.EarningTypeQuote: // 报价
orderFmt += quote
}
orderParams = append(orderParams,
jxutils.GetVendorName(order.VendorID),
order.OrderSeq,
@@ -93,11 +103,16 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
)
for _, sku := range order.Skus {
orderFmt += `<FH>%s</FH>\n`
//orderFmt += `%8s%10s%10s\n`
orderFmt += `<FH>%20s%8s</FH>\n`
//orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count)))
orderParams = append(orderParams, sku.SkuName, "X"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count)))
switch order.EarningType {
case model.EarningTypePoints: // 扣点
orderFmt += `<FH>%s</FH>\n`
orderFmt += `<FH>%20s%8s</FH>\n`
orderParams = append(orderParams, sku.SkuName, "X"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count)))
case model.EarningTypeQuote: // 报价
orderFmt += `<FH>%s%25s</FH>\n`
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count))
}
//标品需要打印条形码
if sku.Upc != "" {
orderFmt += `upc码 %s\n`
@@ -158,9 +173,20 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
<FS>%s</FS>\n
\n
\n
<FS>商品明细: \n</FS>
品名 数量 小计\n
<FS>商品明细: \n</FS>`
points := `品名 数量 小计\n
--------------------------------\n`
quote := `品名 小计\n
--------------------------------\n`
switch order.EarningType {
case model.EarningTypePoints: // 扣点
orderFmt += points
case model.EarningTypeQuote: // 报价
orderFmt += quote
}
orderParams = append(orderParams,
jxutils.GetVendorName(order.VendorID),
order.OrderSeq,
@@ -176,11 +202,16 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
)
for _, sku := range order.Skus {
orderFmt += `<FH2>%s\n</FH2>`
//orderFmt += `<FS2>%s %s %s\n\n</FS2>`
orderFmt += `<FS><FB>%15s%8s</FB>\n</FS>`
//orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count)))
orderParams = append(orderParams, sku.SkuName, "X"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count)))
switch order.EarningType {
case model.EarningTypePoints: // 扣点
orderFmt += `<FH2>%s\n</FH2>`
orderFmt += `<FS><FB>%15s%8s</FB>\n</FS>`
orderParams = append(orderParams, sku.SkuName, "X"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count)))
case model.EarningTypeQuote: // 报价
orderFmt += `<FH2>%s%25s\n</FH2>`
orderParams = append(orderParams, sku.SkuName, "X"+utils.Int2Str(sku.Count))
}
//标品需要打印条形码
if sku.Upc != "" {
orderFmt += `<FS>upc码 %s\n</FS>`