Merge branch 'master' of e.coding.net:rosydev/baseapi
This commit is contained in:
@@ -139,16 +139,16 @@ var orderNameEmpty = StrRepeat(" ", NEX_ROW_CHAR_LEN)
|
|||||||
|
|
||||||
//test函数
|
//test函数
|
||||||
func FormatPrintOrderItem(foodName string, quantity int, price float64) string {
|
func FormatPrintOrderItem(foodName string, quantity int, price float64) string {
|
||||||
|
|
||||||
//foodNameLen := CalcGbkLenForPrint(foodName)
|
//foodNameLen := CalcGbkLenForPrint(foodName)
|
||||||
|
|
||||||
quantityStr := strconv.Itoa(quantity)
|
quantityStr := strconv.Itoa(quantity)
|
||||||
quantityLen := CalcAsciiLenForPrint(quantityStr)
|
quantityLen := CalcAsciiLenForPrint(quantityStr)
|
||||||
|
|
||||||
priceStr := fmt.Sprintf("%.2f", price)
|
temprice := price / 100
|
||||||
|
priceStr := fmt.Sprintf("%.2f", temprice)
|
||||||
priceLen := CalcAsciiLenForPrint(priceStr)
|
priceLen := CalcAsciiLenForPrint(priceStr)
|
||||||
|
|
||||||
subtotalStr := fmt.Sprintf("%.2f", utils.Int2Float64(quantity)*price)
|
subtotalStr := fmt.Sprintf("%.2f", utils.Int2Float64(quantity)*temprice)
|
||||||
//subtotalLen := CalcAsciiLenForPrint(subtotalStr)
|
//subtotalLen := CalcAsciiLenForPrint(subtotalStr)
|
||||||
|
|
||||||
result := foodName + "<BR>"
|
result := foodName + "<BR>"
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ func (a *API) AddPrinters(sn, printerName string) error {
|
|||||||
t := strings.Split(v.(string), ":")
|
t := strings.Split(v.(string), ":")
|
||||||
failMsg += t[0] + XpuErrMsg[t[1]]
|
failMsg += t[0] + XpuErrMsg[t[1]]
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Errorf("添加打印机错误:%v", failMsg)
|
return fmt.Errorf("添加打印机错误:%v", failMsg)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user