|
|
@@ -4474,12 +4474,26 @@ std::string CPosPrinterData::PrintShangpintiaomaBiaoqian(CFood& foodinfo, std::s
|
|
|
nRow++;
|
|
|
}
|
|
|
|
|
|
- BIAOQIAN_BARCODEOUT(foodinfo.barcode, 12, 22 + 30 * nRow);
|
|
|
+ std::string barcode;
|
|
|
+ if (foodinfo.is_weight == "1")
|
|
|
+ {
|
|
|
+ //按照13位【FFWWWWWNNNNNC】格式
|
|
|
+ std::string weightString = CLewaimaiString::DoubleToString(atof(weight.c_str()) * 1000, 0);
|
|
|
+ weightString = CLewaimaiString::BuZifuLeft(weightString, 5 - weightString.length(), '0');
|
|
|
+
|
|
|
+ barcode = "21" + CLewaimaiString::BuZifuLeft(foodinfo.weight_plu_code, 5 - foodinfo.weight_plu_code.length(), '0') + weightString + "1";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ barcode = foodinfo.barcode;
|
|
|
+ }
|
|
|
+
|
|
|
+ BIAOQIAN_BARCODEOUT(barcode, 12, 22 + 30 * nRow);
|
|
|
|
|
|
int nPriceY;
|
|
|
if (biaoqian_height == 30)
|
|
|
{
|
|
|
- nPriceY = 180;
|
|
|
+ nPriceY = 160;
|
|
|
}
|
|
|
else if (biaoqian_height == 25)
|
|
|
{
|
|
|
@@ -4490,9 +4504,37 @@ std::string CPosPrinterData::PrintShangpintiaomaBiaoqian(CFood& foodinfo, std::s
|
|
|
nPriceY = 100;
|
|
|
}
|
|
|
|
|
|
- //打印价格
|
|
|
- std::string priceInfo = CLewaimaiString::UTF8ToANSI(food_price) + "元";
|
|
|
- textData += BIAOQIAN_TEXTGet(priceInfo, 12, nPriceY, 1, 1);
|
|
|
+ if (foodinfo.is_weight == "1")
|
|
|
+ {
|
|
|
+ //打印单价
|
|
|
+ std::string priceInfo = "单价:";
|
|
|
+ textData += BIAOQIAN_TEXTGet(priceInfo, 12, nPriceY, 1, 1);
|
|
|
+
|
|
|
+ std::string priceShow = CLewaimaiString::UTF8ToANSI(food_price) + "元";
|
|
|
+ textData += BIAOQIAN_TEXTGet(priceShow, 12, nPriceY + 30, 1, 1);
|
|
|
+
|
|
|
+
|
|
|
+ //打印净重
|
|
|
+ std::string weightInfo = "净重:";
|
|
|
+ textData += BIAOQIAN_TEXTGet(weightInfo, 112, nPriceY, 1, 1);
|
|
|
+
|
|
|
+ std::string weightShow = weight + "kg";
|
|
|
+ textData += BIAOQIAN_TEXTGet(weightShow, 112, nPriceY + 30, 1, 1);
|
|
|
+
|
|
|
+ //打印净重
|
|
|
+ std::string zongjiaInfo = "总价:";
|
|
|
+ textData += BIAOQIAN_TEXTGet(zongjiaInfo, 212, nPriceY, 1, 1);
|
|
|
+
|
|
|
+ std::string zongjiaShow = CLewaimaiString::DoubleToString(atof(CLewaimaiString::UTF8ToANSI(food_price).c_str()) * atof(weight.c_str()), 3) + "元";
|
|
|
+ textData += BIAOQIAN_TEXTGet(zongjiaShow, 212, nPriceY + 30, 1, 1);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //打印价格
|
|
|
+ std::string priceInfo = "单价:" + CLewaimaiString::UTF8ToANSI(food_price) + "元";
|
|
|
+ textData += BIAOQIAN_TEXTGet(priceInfo, 12, nPriceY, 1, 1);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
WriteData(textData);
|
|
|
|