|
|
@@ -3285,7 +3285,7 @@ void CZhengcanDiandanPageUI::ClickYulan()
|
|
|
CZhengcanOrder order = this->GetPrintOrderinfoYulan();
|
|
|
|
|
|
CPosPrinter printer;
|
|
|
- printer.PrintZhengcanOrderXiadan(order);
|
|
|
+ printer.PrintZhengcanOrderYulan(order);
|
|
|
}
|
|
|
|
|
|
//获取通用参数,任何支付方式都要用到的参数,个性化参数在弹框里面处理
|
|
|
@@ -3480,7 +3480,7 @@ void CZhengcanDiandanPageUI::StartWeixinzhifuShoukuan(std::string fukuanma)
|
|
|
}
|
|
|
|
|
|
//说明收款成功了,需要进行一些后续的处理
|
|
|
- this->StartWorkAfterShoukuan(pShoukuanWnd->m_kucun_string, pShoukuanWnd->m_take_food_code, pShoukuanWnd->m_show_trade_no, zhifu_type);
|
|
|
+ this->StartWorkAfterShoukuan(zhifu_type);
|
|
|
|
|
|
m_pMainWnd->ShowToast(L"收款成功!");
|
|
|
|
|
|
@@ -3540,7 +3540,7 @@ void CZhengcanDiandanPageUI::StartHuiyuanShoukuan()
|
|
|
std::string member_number = pShoukuanWnd->m_member_number;
|
|
|
|
|
|
//说明收款成功了,需要进行一些后续的处理
|
|
|
- this->StartWorkAfterShoukuan(pShoukuanWnd->m_kucun_string, pShoukuanWnd->m_take_food_code, pShoukuanWnd->m_show_trade_no, "huiyuanzhifu", balance, member_number);
|
|
|
+ this->StartWorkAfterShoukuan("huiyuanzhifu", balance, member_number);
|
|
|
|
|
|
m_pMainWnd->ShowToast(L"收款成功!");
|
|
|
|
|
|
@@ -3601,7 +3601,7 @@ void CZhengcanDiandanPageUI::StartXianjinShoukuan()
|
|
|
m_zhaoling_value = pShoukuanWnd->m_zhaoling;
|
|
|
|
|
|
//说明收款成功了,需要进行一些后续的处理
|
|
|
- this->StartWorkAfterShoukuan(pShoukuanWnd->m_kucun_string, pShoukuanWnd->m_take_food_code, pShoukuanWnd->m_show_trade_no, "xianjinzhifu");
|
|
|
+ this->StartWorkAfterShoukuan("xianjinzhifu");
|
|
|
|
|
|
m_pMainWnd->ShowToast(L"收款成功!");
|
|
|
|
|
|
@@ -3658,7 +3658,7 @@ void CZhengcanDiandanPageUI::StartFulikaShoukuan()
|
|
|
if (ret == IDOK)
|
|
|
{
|
|
|
//说明收款成功了,需要进行一些后续的处理
|
|
|
- this->StartWorkAfterShoukuan(pShoukuanWnd->m_kucun_string, pShoukuanWnd->m_take_food_code, pShoukuanWnd->m_show_trade_no, "fulikazhifu");
|
|
|
+ this->StartWorkAfterShoukuan("fulikazhifu");
|
|
|
|
|
|
m_pMainWnd->ShowToast(L"收款成功!");
|
|
|
|
|
|
@@ -3718,7 +3718,7 @@ void CZhengcanDiandanPageUI::StartZidingyiShoukuan(std::wstring name, std::wstri
|
|
|
if (ret == IDOK)
|
|
|
{
|
|
|
//说明收款成功了,需要进行一些后续的处理
|
|
|
- this->StartWorkAfterShoukuan(pShoukuanWnd->m_kucun_string, pShoukuanWnd->m_take_food_code, pShoukuanWnd->m_show_trade_no, "zidingyizhifu");
|
|
|
+ this->StartWorkAfterShoukuan("zidingyizhifu");
|
|
|
|
|
|
m_pMainWnd->ShowToast(L"收款成功!");
|
|
|
|
|
|
@@ -4151,7 +4151,7 @@ void CZhengcanDiandanPageUI::StartWorkAfterTuicai(std::string kucunstring, CZhen
|
|
|
CZhengcanOrder order = this->GetPrintOrderinfoTuicai(tuicaiItem, tuicai_num);
|
|
|
|
|
|
CPosPrinter printer;
|
|
|
- printer.PrintZhengcanOrderXiadan(order);
|
|
|
+ printer.PrintZhengcanOrderTuicai(order);
|
|
|
|
|
|
//如果走到这里说明退菜成功了,这个时候刷新显示
|
|
|
this->InitShow();
|
|
|
@@ -4173,7 +4173,7 @@ void CZhengcanDiandanPageUI::StartWorkAfterXiadan(std::string kucunstring, std::
|
|
|
m_pMainWnd->SwitchPage(CMainWnd::ZHENGCAN);
|
|
|
}
|
|
|
|
|
|
-void CZhengcanDiandanPageUI::StartWorkAfterShoukuan(std::string kucunstring, std::string take_food_code, std::string show_trade_no, std::string shoukuan_type, std::string balance, std::string member_number)
|
|
|
+void CZhengcanDiandanPageUI::StartWorkAfterShoukuan(std::string shoukuan_type, std::string balance, std::string member_number)
|
|
|
{
|
|
|
//针对现金收款成功,单独做一个打开钱箱的判断处理
|
|
|
if (shoukuan_type == "xianjinzhifu")
|
|
|
@@ -4187,11 +4187,8 @@ void CZhengcanDiandanPageUI::StartWorkAfterShoukuan(std::string kucunstring, std
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //更新商品库存
|
|
|
- this->UpdateFoodStock(kucunstring);
|
|
|
-
|
|
|
//处理打印
|
|
|
- CZhengcanOrder order = this->GetPrintOrderinfo(take_food_code, show_trade_no, shoukuan_type, balance, member_number);
|
|
|
+ CZhengcanOrder order = this->GetPrintOrderinfoJiesuan(shoukuan_type, balance, member_number);
|
|
|
|
|
|
CPosPrinter printer;
|
|
|
printer.PrintZhengcanOrderXiadan(order);
|
|
|
@@ -4369,68 +4366,68 @@ CZhengcanOrder CZhengcanDiandanPageUI::GetPrintOrderinfoYulan()
|
|
|
m_cur_diandan_order.m_zhekou_value = m_zhekou_value;
|
|
|
|
|
|
m_cur_diandan_order.m_dabao_money = CLewaimaiString::DoubleToString(m_cur_diandan_order.getDabaoMoney(), 2);
|
|
|
+ m_cur_diandan_order.m_chawei_money = CLewaimaiString::DoubleToString(m_chawei, 2);
|
|
|
+ m_cur_diandan_order.m_kaitai_money = CLewaimaiString::DoubleToString(m_kaitai, 2);
|
|
|
m_cur_diandan_order.m_total_price = CLewaimaiString::DoubleToString(m_cur_total_price, 2);
|
|
|
|
|
|
- for (std::vector<CZhengcanOrderItem>::iterator it = m_cur_diandan_order.m_items.begin(); it != m_cur_diandan_order.m_items.end(); it++)
|
|
|
- {
|
|
|
- CZhengcanOrderItemPrint itemPrint;
|
|
|
-
|
|
|
- itemPrint.m_food_name = it->getNameWanzhengShow();
|
|
|
- itemPrint.m_quantity = it->num;
|
|
|
- itemPrint.m_item_price = it->getSinglePrice();
|
|
|
- itemPrint.m_type_id = it->type_id;
|
|
|
+ //清空之前的打印记录
|
|
|
+ m_cur_diandan_order.m_items_print.clear();
|
|
|
|
|
|
- if (it->m_is_taocan == true)
|
|
|
+ for (std::vector<CZhengcanOrderHistoryXiadan>::iterator it = m_cur_diandan_order.m_order_history_array.begin(); it != m_cur_diandan_order.m_order_history_array.end(); it++)
|
|
|
+ {
|
|
|
+ for (std::vector<CZhengcanOrderItem>::iterator it1 = it->m_items.begin(); it1 != it->m_items.end(); it1++)
|
|
|
{
|
|
|
- itemPrint.is_taocan = true;
|
|
|
- }
|
|
|
+ CZhengcanOrderItemPrint itemPrint;
|
|
|
|
|
|
- m_cur_diandan_order.m_items_print.push_back(itemPrint);
|
|
|
-
|
|
|
- if (it->m_is_taocan == true)
|
|
|
- {
|
|
|
- //开始保存套餐里面的商品详情,主要用于厨房打印
|
|
|
- CFoodpackage foodpackageinfo;
|
|
|
- foodpackageinfo = it->GetFoodpackageInfo();
|
|
|
+ CZhengcanOrderItem tuicaiItem = *it1;
|
|
|
|
|
|
- std::string nature = foodpackageinfo.nature;
|
|
|
+ itemPrint.m_quantity = tuicaiItem.num;
|
|
|
+ itemPrint.m_item_price = tuicaiItem.price;
|
|
|
+ itemPrint.m_type_id = tuicaiItem.type_id;
|
|
|
|
|
|
- rapidjson::Document document;
|
|
|
- document.Parse(nature.c_str());
|
|
|
+ if (tuicaiItem.m_is_taocan == true)
|
|
|
+ {
|
|
|
+ itemPrint.is_taocan = true;
|
|
|
|
|
|
- if (document.HasParseError())
|
|
|
+ itemPrint.m_food_name = tuicaiItem.foodpackage_name; //不带属性商品
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- //属性json报错,直接不处理了
|
|
|
- continue;
|
|
|
+ itemPrint.m_food_name = tuicaiItem.food_name; //带属性值
|
|
|
}
|
|
|
|
|
|
- rapidjson::Value& data = document;
|
|
|
+ m_cur_diandan_order.m_items_print.push_back(itemPrint);
|
|
|
|
|
|
- //接下来要把这个套餐的详情也保存下来
|
|
|
- for (std::vector<FoodNatureSelectValue>::iterator it_2 = it->natureSelectedArray.begin(); it_2 != it->natureSelectedArray.end(); it_2++)
|
|
|
+ if (tuicaiItem.m_is_taocan == true)
|
|
|
{
|
|
|
- std::string food_id = data[it_2->nNameIndex]["value"][it_2->nature_select_index].GetString();
|
|
|
+ //开始保存套餐里面的商品详情,主要用于厨房打印
|
|
|
|
|
|
- //要根据商品ID找出商品的名字
|
|
|
- CFood foodinfo;
|
|
|
- CSqlite3 sqlite;
|
|
|
- bool is_found = sqlite.GetFoodById(food_id, foodinfo);
|
|
|
- if (!is_found)
|
|
|
+ //接下来要把这个套餐的详情也保存下来
|
|
|
+ for (std::vector<CZhengcanOrderItem>::iterator it = tuicaiItem.m_taocan_items.begin(); it != tuicaiItem.m_taocan_items.end(); it++)
|
|
|
{
|
|
|
- continue;
|
|
|
- }
|
|
|
+ std::string food_id = it->food_id;
|
|
|
|
|
|
- CZhengcanOrderItemPrint foodpackageitemPrint;
|
|
|
+ //要根据商品ID找出商品的名字
|
|
|
+ CFood foodinfo;
|
|
|
+ CSqlite3 sqlite;
|
|
|
+ bool is_found = sqlite.GetFoodById(food_id, foodinfo);
|
|
|
+ if (!is_found)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
- foodpackageitemPrint.m_food_name = foodinfo.name;
|
|
|
- foodpackageitemPrint.m_quantity = it->num;
|
|
|
- foodpackageitemPrint.m_item_price = foodinfo.price;
|
|
|
- foodpackageitemPrint.m_type_id = foodinfo.type_id;
|
|
|
+ CZhengcanOrderItemPrint foodpackageitemPrint;
|
|
|
|
|
|
- foodpackageitemPrint.is_taocan = false;
|
|
|
- foodpackageitemPrint.is_taocan_item = true;
|
|
|
+ foodpackageitemPrint.m_food_name = foodinfo.name;
|
|
|
+ foodpackageitemPrint.m_quantity = tuicaiItem.num;
|
|
|
+ foodpackageitemPrint.m_item_price = foodinfo.price;
|
|
|
+ foodpackageitemPrint.m_type_id = foodinfo.type_id;
|
|
|
|
|
|
- m_cur_diandan_order.m_items_print.push_back(foodpackageitemPrint);
|
|
|
+ foodpackageitemPrint.is_taocan = false;
|
|
|
+ foodpackageitemPrint.is_taocan_item = true;
|
|
|
+
|
|
|
+ m_cur_diandan_order.m_items_print.push_back(foodpackageitemPrint);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -4438,10 +4435,10 @@ CZhengcanOrder CZhengcanDiandanPageUI::GetPrintOrderinfoYulan()
|
|
|
return m_cur_diandan_order;
|
|
|
}
|
|
|
|
|
|
-CZhengcanOrder CZhengcanDiandanPageUI::GetPrintOrderinfo(std::string take_food_code, std::string show_trade_no, std::string shoukuan_type, std::string balance, std::string member_number)
|
|
|
+CZhengcanOrder CZhengcanDiandanPageUI::GetPrintOrderinfoJiesuan(std::string shoukuan_type, std::string balance, std::string member_number)
|
|
|
{
|
|
|
m_cur_diandan_order.shopname = CShopinfo::GetInstance()->m_shop_name;
|
|
|
- m_cur_diandan_order.show_trade_no = show_trade_no;
|
|
|
+
|
|
|
m_cur_diandan_order.balance = balance;
|
|
|
m_cur_diandan_order.member_number = member_number;
|
|
|
|
|
|
@@ -4496,68 +4493,68 @@ CZhengcanOrder CZhengcanDiandanPageUI::GetPrintOrderinfo(std::string take_food_c
|
|
|
m_cur_diandan_order.m_zhekou_value = m_zhekou_value;
|
|
|
|
|
|
m_cur_diandan_order.m_dabao_money = CLewaimaiString::DoubleToString(m_cur_diandan_order.getDabaoMoney(), 2);
|
|
|
+ m_cur_diandan_order.m_chawei_money = CLewaimaiString::DoubleToString(m_chawei, 2);
|
|
|
+ m_cur_diandan_order.m_kaitai_money = CLewaimaiString::DoubleToString(m_kaitai, 2);
|
|
|
m_cur_diandan_order.m_total_price = CLewaimaiString::DoubleToString(m_cur_total_price, 2);
|
|
|
|
|
|
- for (std::vector<CZhengcanOrderItem>::iterator it = m_cur_diandan_order.m_items.begin(); it != m_cur_diandan_order.m_items.end(); it++)
|
|
|
- {
|
|
|
- CZhengcanOrderItemPrint itemPrint;
|
|
|
-
|
|
|
- itemPrint.m_food_name = it->getNameWanzhengShow();
|
|
|
- itemPrint.m_quantity = it->num;
|
|
|
- itemPrint.m_item_price = it->getSinglePrice();
|
|
|
- itemPrint.m_type_id = it->type_id;
|
|
|
+ //清空之前的打印记录
|
|
|
+ m_cur_diandan_order.m_items_print.clear();
|
|
|
|
|
|
- if (it->m_is_taocan == true)
|
|
|
+ for (std::vector<CZhengcanOrderHistoryXiadan>::iterator it = m_cur_diandan_order.m_order_history_array.begin(); it != m_cur_diandan_order.m_order_history_array.end(); it++)
|
|
|
+ {
|
|
|
+ for (std::vector<CZhengcanOrderItem>::iterator it1 = it->m_items.begin(); it1 != it->m_items.end(); it1++)
|
|
|
{
|
|
|
- itemPrint.is_taocan = true;
|
|
|
- }
|
|
|
+ CZhengcanOrderItemPrint itemPrint;
|
|
|
|
|
|
- m_cur_diandan_order.m_items_print.push_back(itemPrint);
|
|
|
-
|
|
|
- if (it->m_is_taocan == true)
|
|
|
- {
|
|
|
- //开始保存套餐里面的商品详情,主要用于厨房打印
|
|
|
- CFoodpackage foodpackageinfo;
|
|
|
- foodpackageinfo = it->GetFoodpackageInfo();
|
|
|
+ CZhengcanOrderItem tuicaiItem = *it1;
|
|
|
|
|
|
- std::string nature = foodpackageinfo.nature;
|
|
|
+ itemPrint.m_quantity = tuicaiItem.num;
|
|
|
+ itemPrint.m_item_price = tuicaiItem.price;
|
|
|
+ itemPrint.m_type_id = tuicaiItem.type_id;
|
|
|
|
|
|
- rapidjson::Document document;
|
|
|
- document.Parse(nature.c_str());
|
|
|
+ if (tuicaiItem.m_is_taocan == true)
|
|
|
+ {
|
|
|
+ itemPrint.is_taocan = true;
|
|
|
|
|
|
- if (document.HasParseError())
|
|
|
+ itemPrint.m_food_name = tuicaiItem.foodpackage_name; //不带属性商品
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- //属性json报错,直接不处理了
|
|
|
- continue;
|
|
|
+ itemPrint.m_food_name = tuicaiItem.food_name; //带属性值
|
|
|
}
|
|
|
|
|
|
- rapidjson::Value& data = document;
|
|
|
+ m_cur_diandan_order.m_items_print.push_back(itemPrint);
|
|
|
|
|
|
- //接下来要把这个套餐的详情也保存下来
|
|
|
- for (std::vector<FoodNatureSelectValue>::iterator it_2 = it->natureSelectedArray.begin(); it_2 != it->natureSelectedArray.end(); it_2++)
|
|
|
+ if (tuicaiItem.m_is_taocan == true)
|
|
|
{
|
|
|
- std::string food_id = data[it_2->nNameIndex]["value"][it_2->nature_select_index].GetString();
|
|
|
+ //开始保存套餐里面的商品详情,主要用于厨房打印
|
|
|
|
|
|
- //要根据商品ID找出商品的名字
|
|
|
- CFood foodinfo;
|
|
|
- CSqlite3 sqlite;
|
|
|
- bool is_found = sqlite.GetFoodById(food_id, foodinfo);
|
|
|
- if (!is_found)
|
|
|
+ //接下来要把这个套餐的详情也保存下来
|
|
|
+ for (std::vector<CZhengcanOrderItem>::iterator it = tuicaiItem.m_taocan_items.begin(); it != tuicaiItem.m_taocan_items.end(); it++)
|
|
|
{
|
|
|
- continue;
|
|
|
- }
|
|
|
+ std::string food_id = it->food_id;
|
|
|
|
|
|
- CZhengcanOrderItemPrint foodpackageitemPrint;
|
|
|
+ //要根据商品ID找出商品的名字
|
|
|
+ CFood foodinfo;
|
|
|
+ CSqlite3 sqlite;
|
|
|
+ bool is_found = sqlite.GetFoodById(food_id, foodinfo);
|
|
|
+ if (!is_found)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
- foodpackageitemPrint.m_food_name = foodinfo.name;
|
|
|
- foodpackageitemPrint.m_quantity = it->num;
|
|
|
- foodpackageitemPrint.m_item_price = foodinfo.price;
|
|
|
- foodpackageitemPrint.m_type_id = foodinfo.type_id;
|
|
|
+ CZhengcanOrderItemPrint foodpackageitemPrint;
|
|
|
|
|
|
- foodpackageitemPrint.is_taocan = false;
|
|
|
- foodpackageitemPrint.is_taocan_item = true;
|
|
|
+ foodpackageitemPrint.m_food_name = foodinfo.name;
|
|
|
+ foodpackageitemPrint.m_quantity = tuicaiItem.num;
|
|
|
+ foodpackageitemPrint.m_item_price = foodinfo.price;
|
|
|
+ foodpackageitemPrint.m_type_id = foodinfo.type_id;
|
|
|
|
|
|
- m_cur_diandan_order.m_items_print.push_back(foodpackageitemPrint);
|
|
|
+ foodpackageitemPrint.is_taocan = false;
|
|
|
+ foodpackageitemPrint.is_taocan_item = true;
|
|
|
+
|
|
|
+ m_cur_diandan_order.m_items_print.push_back(foodpackageitemPrint);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|