This commit is contained in:
邹宗楠
2025-08-13 17:52:19 +08:00
parent 686154836d
commit ba3ef50091

View File

@@ -85,10 +85,10 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
<BR> <BR>
商品明细: <BR> 商品明细: <BR>
` `
priceQuote := `品名 数量<BR> orderFmt += `品名 数量<BR>
--------------------------------<BR>` // 报价 --------------------------------<BR>` // 报价
pricePoints := `品名 数量 单价 小计<BR> // pricePoints := `品名 数量 单价 小计<BR>
--------------------------------<BR>` // 扣点 //--------------------------------<BR>` // 扣点
// <BOLD>实际支付:</BOLD>%s<BR> // <BOLD>实际支付:</BOLD>%s<BR>
orderParams = append(orderParams, orderParams = append(orderParams,
jxutils.GetVendorName(order.VendorID), jxutils.GetVendorName(order.VendorID),
@@ -104,23 +104,29 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
order.BuyerComment, order.BuyerComment,
// jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice), // jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice),
) )
switch order.EarningType { //switch order.EarningType {
case model.EarningTypePoints: // 扣点 //case model.EarningTypePoints: // 扣点
orderFmt += pricePoints // orderFmt += pricePoints
case model.EarningTypeQuote: // 报价 //case model.EarningTypeQuote: // 报价
orderFmt += priceQuote // orderFmt += priceQuote
} //}
for _, sku := range order.Skus { for _, sku := range order.Skus {
switch order.EarningType { if sku.Count > 1 {
case model.EarningTypePoints: // 扣点 orderFmt += `%s <RIGHT><BOLD>%s</BOLD></RIGHT><BR>`
orderFmt += `%s<BR>` } else {
orderFmt += `%8s%10s%10s<BR>` orderFmt += `%s <RIGHT>%s</RIGHT><BR>`
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count)))
case model.EarningTypeQuote: // 报价
orderFmt += `%s %25s<BR>`
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count))
} }
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count))
//switch order.EarningType {
//case model.EarningTypePoints: // 扣点
// orderFmt += `%s<BR>`
// orderFmt += `%8s%10s%10s<BR>`
// orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count)))
//case model.EarningTypeQuote: // 报价
// orderFmt += `%s %25s<BR>`
// orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count))
//}
//标品需要打印条形码 //标品需要打印条形码
if sku.Upc != "" { if sku.Upc != "" {
orderFmt += `upc码 %s<BR>` orderFmt += `upc码 %s<BR>`
@@ -129,7 +135,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
} }
orderFmt += `<BR> orderFmt += `<BR>
<BOLD>共%d种%d件商品</BOLD><BR> <BOLD>共%d种%d件商品</BOLD><BR>
<BOLD>实付:%s</BOLD> <BOLD>实付:%s</BOLD><BR>
--------------------------------<BR> --------------------------------<BR>
<C><BOLD>商品质量问题请联系:</BOLD><BR></C> <C><BOLD>商品质量问题请联系:</BOLD><BR></C>
更多信息请关注官方微信: %s<BR> 更多信息请关注官方微信: %s<BR>
@@ -215,16 +221,22 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
) )
for _, sku := range order.Skus { for _, sku := range order.Skus {
orderFmt += `<B>%s</B><BR>` if sku.Count > 1 {
switch order.EarningType { orderFmt += `<B>%s <RIGHT><BOLD>%s</BOLD></RIGHT></B><BR>`
case model.EarningTypePoints: // 扣点 } else {
orderFmt += `<B>%s %s %s</B><BR>` orderFmt += `<B>%s <RIGHT>%s</RIGHT></B><BR>`
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count)))
case model.EarningTypeQuote: // 报价
orderFmt += `<CB>%s</CB><BR>`
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count))
} }
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count))
//orderFmt += `<B>%s</B><BR>`
//switch order.EarningType {
//case model.EarningTypePoints: // 扣点
// orderFmt += `<B>%s %s %s</B><BR>`
// orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count)))
//case model.EarningTypeQuote: // 报价
// orderFmt += `<CB>%s</CB><BR>`
// orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count))
//}
//orderFmt += `<B>%s %s %s<BR><BR></B>` //orderFmt += `<B>%s %s %s<BR><BR></B>`
//orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count))) //orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count)))
//标品需要打印条形码 //标品需要打印条形码
@@ -235,8 +247,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
} }
orderFmt += `<BR> orderFmt += `<BR>
<BOLD>共%d种%d件商品</BOLD> <BOLD>共%d种%d件商品</BOLD>
<BOLD>实付:%s</BOLD> <BOLD>实付:%s</BOLD><BR>
<BR>
--------------------------------<BR> --------------------------------<BR>
<C><BOLD>商品质量问题请联系:</BOLD><BR></C> <C><BOLD>商品质量问题请联系:</BOLD><BR></C>
更多信息请关注官方微信: %s<BR> 更多信息请关注官方微信: %s<BR>