- 调整网络打印机的打印格式

This commit is contained in:
gazebo
2019-04-02 09:35:49 +08:00
parent 7d813f12b6
commit 22f9ba419d
2 changed files with 7 additions and 3 deletions

View File

@@ -193,6 +193,10 @@ func IntPrice2StandardString(value int64) string {
return fmt.Sprintf("%.2f", IntPrice2Standard(value))
}
func IntPrice2StandardCurrencyString(value int64) string {
return fmt.Sprintf("¥%.2f", IntPrice2Standard(value))
}
func CallMsgHandler(handler func(), primaryID string) {
routinePool.CallFun(func() {
handler()

View File

@@ -62,7 +62,7 @@ func GetFeieOrderContent(order *model.GoodsOrder, storeTel string) (content stri
<BOLD>实际支付:</BOLD>%.2f<BR>
<BR>
商品明细: <BR>
品名 数量 单价 小计
品名 数量 单价 小计
--------------------------------<BR>`
orderParams := []interface{}{
utils.Time2Str(order.OrderCreatedAt),
@@ -80,8 +80,8 @@ func GetFeieOrderContent(order *model.GoodsOrder, storeTel string) (content stri
for _, sku := range order.Skus {
orderFmt += `%s<BR>`
orderFmt += `%10d%10.2f%10.2f<BR>`
orderParams = append(orderParams, sku.SkuName, sku.Count, jxutils.IntPrice2Standard(sku.SalePrice), jxutils.IntPrice2Standard(sku.SalePrice*int64(sku.Count)))
orderFmt += `%10s%10s%10s<BR>`
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count)))
}
orderFmt += `<BR>
<BOLD>共%d种%d件商品</BOLD>