|
|
@@ -11,6 +11,8 @@
|
|
|
|
|
|
#include "../wnd/CMainWnd.h"
|
|
|
|
|
|
+#include "../print/CPosPrinter.h"
|
|
|
+
|
|
|
CShoukuanPageUI::CShoukuanPageUI()
|
|
|
{
|
|
|
|
|
|
@@ -215,7 +217,7 @@ void CShoukuanPageUI::HandleClickMsg(TNotifyUI& msg)
|
|
|
std::wstring name = msg.pSender->GetText();
|
|
|
std::wstring selfpay_id = msg.pSender->GetCustomAttribute(L"selfpay_id");
|
|
|
|
|
|
-
|
|
|
+ this->StartZidingyiShoukuan(name, selfpay_id);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -614,19 +616,172 @@ void CShoukuanPageUI::StartHuiyuanShoukuan()
|
|
|
//开始进行现金收款
|
|
|
void CShoukuanPageUI::StartXianjinShoukuan()
|
|
|
{
|
|
|
+ if (m_is_show_modal_wnd == true)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (atof(GetMoney().c_str()) < 0.0001)
|
|
|
+ {
|
|
|
+ m_pMainWnd->ShowToast(L"收款金额不能为0");
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ CXianjinShoukuanWnd* pShoukuanWnd = new CXianjinShoukuanWnd();
|
|
|
+ if (pShoukuanWnd != NULL)
|
|
|
+ {
|
|
|
+ m_is_show_modal_wnd = true;
|
|
|
+ m_curModalWnd = pShoukuanWnd;
|
|
|
+
|
|
|
+ pShoukuanWnd->SetType(4);
|
|
|
+
|
|
|
+ pShoukuanWnd->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
|
|
|
+ pShoukuanWnd->SetIcon(IDI_ICON_DUILIB);
|
|
|
+ pShoukuanWnd->CenterWindow();
|
|
|
+
|
|
|
+ std::string format_string = GetMoney();
|
|
|
+ std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
|
|
|
+ pShoukuanWnd->InitMoney(watchValue);
|
|
|
+
|
|
|
+ //这里要对提交订单的参数进行组装,然后方便请求
|
|
|
+ pShoukuanWnd->SetCommonParams(GetSendorderParams());
|
|
|
+
|
|
|
+ /*
|
|
|
+ if (m_is_start_catch && m_catch_string.length() == 18)
|
|
|
+ {
|
|
|
+ pShoukuanWnd->InitFukuanma(m_catch_string);
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ UINT ret = pShoukuanWnd->ShowModal();
|
|
|
+ if (ret == IDOK)
|
|
|
+ {
|
|
|
+ m_shishou_value = pShoukuanWnd->m_shishou;
|
|
|
+ m_zhaoling_value = pShoukuanWnd->m_zhaoling;
|
|
|
+
|
|
|
+ //说明收款成功了,需要进行一些后续的处理
|
|
|
+ this->StartWorkAfterShoukuan(pShoukuanWnd->m_show_trade_no, "xianjinzhifu");
|
|
|
|
|
|
+ m_pMainWnd->ShowToast(L"收款成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ m_is_show_modal_wnd = false;
|
|
|
+ delete pShoukuanWnd;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//开始进行福利卡收款
|
|
|
void CShoukuanPageUI::StartFulikaShoukuan()
|
|
|
{
|
|
|
+ if (m_is_show_modal_wnd == true)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (atof(GetMoney().c_str()) < 0.0001)
|
|
|
+ {
|
|
|
+ m_pMainWnd->ShowToast(L"收款金额不能为0");
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ CFulikaShoukuanWnd* pShoukuanWnd = new CFulikaShoukuanWnd();
|
|
|
+ if (pShoukuanWnd != NULL)
|
|
|
+ {
|
|
|
+ m_is_show_modal_wnd = true;
|
|
|
+ m_curModalWnd = pShoukuanWnd;
|
|
|
|
|
|
+ pShoukuanWnd->SetType(4);
|
|
|
+
|
|
|
+ pShoukuanWnd->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
|
|
|
+ pShoukuanWnd->SetIcon(IDI_ICON_DUILIB);
|
|
|
+ pShoukuanWnd->CenterWindow();
|
|
|
+
|
|
|
+ std::string format_string = GetMoney();
|
|
|
+ std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
|
|
|
+ pShoukuanWnd->InitMoney(watchValue);
|
|
|
+
|
|
|
+ //这里要对提交订单的参数进行组装,然后方便请求
|
|
|
+ pShoukuanWnd->SetCommonParams(GetSendorderParams());
|
|
|
+
|
|
|
+ /*
|
|
|
+ if (m_is_start_catch && m_catch_string.length() == 18)
|
|
|
+ {
|
|
|
+ pShoukuanWnd->InitFukuanma(m_catch_string);
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ UINT ret = pShoukuanWnd->ShowModal();
|
|
|
+ if (ret == IDOK)
|
|
|
+ {
|
|
|
+ //说明收款成功了,需要进行一些后续的处理
|
|
|
+ this->StartWorkAfterShoukuan(pShoukuanWnd->m_show_trade_no, "fulikazhifu");
|
|
|
+
|
|
|
+ m_pMainWnd->ShowToast(L"收款成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ m_is_show_modal_wnd = false;
|
|
|
+ delete pShoukuanWnd;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//开始自定义支付收款
|
|
|
void CShoukuanPageUI::StartZidingyiShoukuan(std::wstring name, std::wstring selfpay_id)
|
|
|
{
|
|
|
+ if (m_is_show_modal_wnd == true)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (atof(GetMoney().c_str()) < 0.0001)
|
|
|
+ {
|
|
|
+ m_pMainWnd->ShowToast(L"收款金额不能为0");
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ CZidingyiShoukuanWnd* pShoukuanWnd = new CZidingyiShoukuanWnd();
|
|
|
+ if (pShoukuanWnd != NULL)
|
|
|
+ {
|
|
|
+ m_is_show_modal_wnd = true;
|
|
|
+ m_curModalWnd = pShoukuanWnd;
|
|
|
+
|
|
|
+ pShoukuanWnd->SetType(4);
|
|
|
+
|
|
|
+ pShoukuanWnd->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
|
|
|
+ pShoukuanWnd->SetIcon(IDI_ICON_DUILIB);
|
|
|
+ pShoukuanWnd->CenterWindow();
|
|
|
+
|
|
|
+ std::string format_string = GetMoney();
|
|
|
+ std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
|
|
|
+ pShoukuanWnd->InitMoney(watchValue);
|
|
|
+
|
|
|
+ //这里要对提交订单的参数进行组装,然后方便请求
|
|
|
+ pShoukuanWnd->SetCommonParams(GetSendorderParams());
|
|
|
|
|
|
+ /*
|
|
|
+ if (m_is_start_catch && m_catch_string.length() == 18)
|
|
|
+ {
|
|
|
+ pShoukuanWnd->InitFukuanma(m_catch_string);
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ pShoukuanWnd->SetZidingyiName(name);
|
|
|
+ pShoukuanWnd->SetZidingyiId(selfpay_id);
|
|
|
+
|
|
|
+ UINT ret = pShoukuanWnd->ShowModal();
|
|
|
+ if (ret == IDOK)
|
|
|
+ {
|
|
|
+ //说明收款成功了,需要进行一些后续的处理
|
|
|
+ this->StartWorkAfterShoukuan(pShoukuanWnd->m_show_trade_no, "zidingyizhifu");
|
|
|
+
|
|
|
+ m_pMainWnd->ShowToast(L"收款成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ m_is_show_modal_wnd = false;
|
|
|
+ delete pShoukuanWnd;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//获取通用参数,任何支付方式都要用到的参数,个性化参数在弹框里面处理
|
|
|
@@ -648,7 +803,75 @@ std::map<string, string> CShoukuanPageUI::GetSendorderParams()
|
|
|
|
|
|
void CShoukuanPageUI::StartWorkAfterShoukuan(std::string show_trade_no, std::string shoukuan_type, std::string balance, std::string member_number)
|
|
|
{
|
|
|
+ //针对现金收款成功,单独做一个打开钱箱的判断处理
|
|
|
+ if (shoukuan_type == "xianjinzhifu")
|
|
|
+ {
|
|
|
+ std::string setting_is_diannei_xianjin_qianxiang = CSetting::GetInstance()->GetParam("setting_is_diannei_xianjin_qianxiang");
|
|
|
+ if (setting_is_diannei_xianjin_qianxiang == "1")
|
|
|
+ {
|
|
|
+ //打开钱箱
|
|
|
+ CPosPrinter printer;
|
|
|
+ printer.OpenQianxiang();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //处理小票打印
|
|
|
+ //处理打印
|
|
|
+ CShoukuanOrder order = this->GetPrintOrderinfo(show_trade_no, shoukuan_type, balance, member_number);
|
|
|
+
|
|
|
+ CPosPrinter printer;
|
|
|
+ printer.PrintShoukuanOrder(order);
|
|
|
+
|
|
|
+ //最后还原收款金额
|
|
|
this->InitMoney();
|
|
|
+
|
|
|
+ this->UpdateJiesuanInfo();
|
|
|
+}
|
|
|
+
|
|
|
+CShoukuanOrder CShoukuanPageUI::GetPrintOrderinfo(std::string show_trade_no, std::string shoukuan_type, std::string balance, std::string member_number)
|
|
|
+{
|
|
|
+ CShoukuanOrder newOrder;
|
|
|
+
|
|
|
+ newOrder.m_money = this->GetMoney();
|
|
|
+
|
|
|
+ newOrder.shopname = CShopinfo::GetInstance()->m_shop_name;
|
|
|
+ newOrder.show_trade_no = show_trade_no;
|
|
|
+ newOrder.balance = balance;
|
|
|
+ newOrder.member_number = member_number;
|
|
|
+
|
|
|
+ if (shoukuan_type == "weixinzhifu")
|
|
|
+ {
|
|
|
+ newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"微信支付");
|
|
|
+ }
|
|
|
+ else if (shoukuan_type == "zhifubao")
|
|
|
+ {
|
|
|
+ newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"支付宝");
|
|
|
+ }
|
|
|
+ else if (shoukuan_type == "yunshanfu")
|
|
|
+ {
|
|
|
+ newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"云闪付");
|
|
|
+ }
|
|
|
+ else if (shoukuan_type == "huiyuanzhifu")
|
|
|
+ {
|
|
|
+ newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"会员支付");
|
|
|
+ }
|
|
|
+ else if (shoukuan_type == "xianjinzhifu")
|
|
|
+ {
|
|
|
+ newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"现金支付");
|
|
|
+ }
|
|
|
+ else if (shoukuan_type == "fulikazhifu")
|
|
|
+ {
|
|
|
+ newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"福利卡支付");
|
|
|
+ }
|
|
|
+ else if (shoukuan_type == "zidingyizhifu")
|
|
|
+ {
|
|
|
+ newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"自定义支付");
|
|
|
+ }
|
|
|
+
|
|
|
+ newOrder.order_from = 1;
|
|
|
+ newOrder.init_time = CLewaimaiTime::DatetimeToString(time(NULL));
|
|
|
+
|
|
|
+ return newOrder;
|
|
|
}
|
|
|
|
|
|
void CShoukuanPageUI::SetPos(RECT rc, bool bNeedInvalidate)
|