Ver código fonte

修复小票打印的一个bug

zhangyang 6 anos atrás
pai
commit
a4b6e5f322

BIN
bin/Win32/Debug/zhipuzi_pos_windows/db/pos.db


BIN
bin/Win32/Debug/zhipuzi_pos_windows/zhipuzi_pos_windows.exe


+ 28 - 6
zhipuzi_pos_windows/tool/CPosPrinter.cpp

@@ -223,9 +223,20 @@ void CPosPrinter::PrintWaimaiOrderShouyin(CWaimaiOrder& order)
             }
 
             std::string firstLine = m_names[0];
-            std::string priceShow = HandleFoodItemPrice(food_price, 2);
-            std::string quantityShow = HandleFoodQuantity(quantity, 2);
-            std::string priceTotalShow = HandleFoodTotalPrice(food_total_price, 2);
+            
+			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;
 
@@ -504,9 +515,20 @@ void CPosPrinter::PrintWaimaiOrderChufang(CWaimaiOrder& order)
                 }
 
                 std::string firstLine = m_names[0];
-                std::string priceShow = HandleFoodItemPrice(food_price, 2);
-                std::string quantityShow = HandleFoodQuantity(quantity, 2);
-                std::string priceTotalShow = HandleFoodTotalPrice(food_total_price, 2);
+                
+				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;