This commit is contained in:
邹宗楠
2025-08-14 09:52:20 +08:00
parent ba3ef50091
commit 7ee7f6f259
4 changed files with 65 additions and 62 deletions

View File

@@ -68,12 +68,12 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
<big>%s*
商品明细: *
`
priceQuote := `品名 数量
--------------------------------*
`
pricePoints := `品名 数量 单价 小计
orderFmt += `品名 数量
--------------------------------*
`
// pricePoints := `品名 数量 单价 小计
//--------------------------------*
//`
// <S011>实际支付: %s*
orderParams := []interface{}{
globals.StoreName,
@@ -89,23 +89,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
}
//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*`
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 += `%s %25s*`
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(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 += `