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