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

@@ -62,7 +62,11 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
客户备注: *
<big>%s*
商品明细: *
品名 数量 单价 小计
`
priceQuote := `品名 数量
--------------------------------*
`
pricePoints := `品名 数量 单价 小计
--------------------------------*
`
// <S011>实际支付: %s*
@@ -80,10 +84,24 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
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*`
orderFmt += `%8s%10s%10s*`
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*`
orderFmt += `%8s%10s%10s*`
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*`
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count))
}
}
orderFmt += `
*
@@ -154,9 +172,15 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
// jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice),
}
for _, sku := range order.Skus {
orderFmt += `<big>%s*`
orderFmt += `<big>%s %s %s*`
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 += `<big>%s*`
orderFmt += `<big>%s %s %s*`
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 += `<big>%s %s*`
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count))
}
}
orderFmt += `
<big>共%d种%d件商品*