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

@@ -79,8 +79,11 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
<BR>
商品明细: <BR>
品名 数量 单价 小计<BR>
--------------------------------<BR>`
`
priceQuote := `品名 数量<BR>
--------------------------------<BR>` // 报价
pricePoints := `品名 数量 单价 小计<BR>
--------------------------------<BR>` // 扣点
// <BOLD>实际支付:</BOLD>%s<BR>
orderParams = append(orderParams,
jxutils.GetVendorName(order.VendorID),
@@ -95,11 +98,23 @@ 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
}
for _, sku := range order.Skus {
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)))
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>`
@@ -186,8 +201,18 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
for _, sku := range order.Skus {
orderFmt += `<B>%s<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)))
switch order.EarningType {
case model.EarningTypePoints: // 扣点
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)))
case model.EarningTypeQuote: // 报价
orderFmt += `<B>%25s<BR><BR></B>`
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)))
//标品需要打印条形码
if sku.Upc != "" {
orderFmt += `upc码 %s<BR>`