添加商品种金额打印

This commit is contained in:
邹宗楠
2022-06-17 09:34:53 +08:00
parent 2722be9785
commit 63557fa357

View File

@@ -78,7 +78,6 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
商品明细: \n
品名 数量 小计\n
--------------------------------\n`
// <FB>实际支付:</FB>%s\n
orderParams = append(orderParams,
utils.Time2Str(order.OrderCreatedAt),
utils.Time2Str(expectedDeliveryTime),
@@ -90,7 +89,6 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
order.ConsigneeMobile,
order.ConsigneeAddress,
order.BuyerComment,
// jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice),
)
for _, sku := range order.Skus {
@@ -106,8 +104,8 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
}
}
orderFmt += `\n
<FB>共%d种%d件商品</FB>
\n
<FB>共%d种%d件商品</FB>\n
<FB>实际支付:</FB>%s\n
--------------------------------\n
<center><FH2>商品质量问题请联系:</FH2></center>
<center><FH2>%s:%s</FH2></center>\n
@@ -116,7 +114,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
--------------------------------\n
`
// <QR>http://weixin.qq.com/r/tkkDGzTERmk5rXB49xyk</QR>
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, order.StoreName, storeTel, globals.StoreName)
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice), order.StoreName, storeTel, globals.StoreName)
return strings.Replace(fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...), "\\n", "\r\n", -1)
}
@@ -162,7 +160,6 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
<FS>商品明细: \n</FS>
品名 数量 小计\n
--------------------------------\n`
// <FS2><FB>实际支付:</FB>%s\n</FS2>
orderParams = append(orderParams,
utils.Time2Str(order.OrderCreatedAt),
utils.Time2Str(expectedDeliveryTime),
@@ -174,7 +171,6 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
order.ConsigneeMobile,
order.ConsigneeAddress,
order.BuyerComment,
// jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice),
)
for _, sku := range order.Skus {
@@ -190,8 +186,8 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
}
}
orderFmt += `\n
<FS><FB>共%d种%d件商品</FB></FS>
\n
<FS><FB>共%d种%d件商品</FB></FS>\n
<FS2><FB>实际支付:</FB>%s\n</FS2>
--------------------------------\n
<center><FH2>商品质量问题请联系:</FH2></center>\n
<center><FH2>%s:%s</FH2></center>\n
@@ -200,7 +196,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
--------------------------------\n
`
// <QR>http://weixin.qq.com/r/tkkDGzTERmk5rXB49xyk</QR>
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, order.StoreName, storeTel, globals.StoreName)
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice), order.StoreName, storeTel, globals.StoreName)
return strings.Replace(fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...), "\\n", "\r\n", -1)
}
@@ -275,14 +271,13 @@ func (c *PrinterHandler) getCancelOrRefundOrderContent(order *model.GoodsOrder,
}
}
orderFmt += `\n
<FB>共%d种%d件商品</FB>
\n
<FB>共%d种%d件商品</FB>\n
<FB>实际支付:%s</FB>\n
--------------------------------\n
--------------------------------\n
`
// <QR>http://weixin.qq.com/r/tkkDGzTERmk5rXB49xyk</QR>
orderParams = append(orderParams, order.SkuCount, order.GoodsCount)
globals.SugarLogger.Debug("string=========================", strings.Replace(fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...), "\\n", "\r\n", -1))
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice))
return strings.Replace(fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...), "\\n", "\r\n", -1)
}
@@ -352,14 +347,13 @@ func (c *PrinterHandler) getCancelOrRefundOrderContentBig(order *model.GoodsOrde
}
}
orderFmt += `\n
<FS><FB>共%d种%d件商品</FB></FS>
\n
<FS><FB>共%d种%d件商品</FB></FS>\n
<FS2><FB>实际支付:</FB>%s\n</FS2>\n
--------------------------------\n
--------------------------------\n
`
// <QR>http://weixin.qq.com/r/tkkDGzTERmk5rXB49xyk</QR>
orderParams = append(orderParams, order.SkuCount, order.GoodsCount)
globals.SugarLogger.Debug("string=========================", strings.Replace(fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...), "\\n", "\r\n", -1))
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice))
return strings.Replace(fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...), "\\n", "\r\n", -1)
}