|
@@ -1907,6 +1907,107 @@ void CPosPrinter::PrintWaimaiOrderTuikuan(CWaimaiOrder& order)
|
|
|
|
|
|
|
|
POS_FeedLine();
|
|
POS_FeedLine();
|
|
|
|
|
|
|
|
|
|
+ //商品标题
|
|
|
|
|
+ bool setting_printer_shangpin_big = false;
|
|
|
|
|
+
|
|
|
|
|
+ if (CSetting::GetParam("setting_printer_shangpin_big") == "1")
|
|
|
|
|
+ {
|
|
|
|
|
+ setting_printer_shangpin_big = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (guige == "58")
|
|
|
|
|
+ {
|
|
|
|
|
+ POS_TextOut("商品 单价 数量 金额", false, setting_printer_shangpin_big);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ POS_TextOut("商品 单价 数量 金额", false, setting_printer_shangpin_big);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
+
|
|
|
|
|
+ if (order.m_manzeng_name.length() > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ CWaimaiOrderItem manzengItem;
|
|
|
|
|
+ manzengItem.m_food_name = CLewaimaiString::ANSIToUTF8("【满赠】" + CLewaimaiString::UTF8ToANSI(order.m_manzeng_name));
|
|
|
|
|
+
|
|
|
|
|
+ order.m_order_items.push_back(manzengItem);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //商品内容
|
|
|
|
|
+ for (std::vector<CWaimaiOrderItem>::iterator it = order.m_order_items.begin(); it != order.m_order_items.end(); it++)
|
|
|
|
|
+ {
|
|
|
|
|
+ std::string food_name = (*it).m_food_name;
|
|
|
|
|
+ std::string food_price = (*it).m_item_price;
|
|
|
|
|
+ std::string quantity = (*it).m_quantity;
|
|
|
|
|
+
|
|
|
|
|
+ //计算总价
|
|
|
|
|
+ double item_price = atof(food_price.c_str()) * atof(quantity.c_str());
|
|
|
|
|
+ std::string food_total_price = CLewaimaiString::DoubleToString(item_price, 2);
|
|
|
|
|
+
|
|
|
|
|
+ if (food_total_price == "0.00")
|
|
|
|
|
+ {
|
|
|
|
|
+ //这里是特殊处理满赠的展示
|
|
|
|
|
+ food_total_price = "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ food_name = CLewaimaiString::UTF8ToANSI(food_name);
|
|
|
|
|
+
|
|
|
|
|
+ //先输出商品名字
|
|
|
|
|
+ std::vector<string> m_names;
|
|
|
|
|
+
|
|
|
|
|
+ if (guige == "58")
|
|
|
|
|
+ {
|
|
|
|
|
+ m_names = HandleFoodname(food_name, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ m_names = HandleFoodname(food_name, 2);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ std::string firstLine = m_names[0];
|
|
|
|
|
+ int nGuige;
|
|
|
|
|
+
|
|
|
|
|
+ if (guige == "58")
|
|
|
|
|
+ {
|
|
|
|
|
+ nGuige = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ nGuige = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ std::string priceShow = HandleFoodItemPrice(food_price, nGuige);
|
|
|
|
|
+ std::string quantityShow = HandleFoodQuantity(quantity, nGuige);
|
|
|
|
|
+ std::string priceTotalShow = HandleFoodTotalPrice(food_total_price, nGuige);
|
|
|
|
|
+ std::string firstLineShow = firstLine + priceShow + quantityShow + priceTotalShow;
|
|
|
|
|
+
|
|
|
|
|
+ POS_TextOut(firstLineShow, false, setting_printer_shangpin_big);
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
+
|
|
|
|
|
+ for (std::vector<string>::iterator it = m_names.begin() + 1; it != m_names.end(); it++)
|
|
|
|
|
+ {
|
|
|
|
|
+ POS_TextOut((*it), false, setting_printer_shangpin_big);
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //判断是否有备注
|
|
|
|
|
+ if (order.m_memo.length() > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ bool setting_printer_memo_big = false;
|
|
|
|
|
+
|
|
|
|
|
+ if (CSetting::GetParam("setting_printer_memo_big") == "1")
|
|
|
|
|
+ {
|
|
|
|
|
+ setting_printer_memo_big = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
+ string address = "顾客备注:" + CLewaimaiString::UTF8ToANSI(order.m_memo);
|
|
|
|
|
+ POS_TextOut(address, false, setting_printer_memo_big);
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//结束商品详情打印
|
|
//结束商品详情打印
|
|
|
POS_TextOut(lines);
|
|
POS_TextOut(lines);
|
|
|
POS_FeedLine();
|
|
POS_FeedLine();
|