Singleincomemoney.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. // Singleincomemoney.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "Singleincomemoney.h"
  6. //#include "InputMemberno.h"
  7. #include "SelPayType.h"
  8. #include "Login2.h"
  9. #include "SelExpendType.h"
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15. /////////////////////////////////////////////////////////////////////////////
  16. // Singleincomemoney dialog IDC_EDIT3
  17. Singleincomemoney::Singleincomemoney(CWnd* pParent /*=NULL*/)
  18. : CDialog(Singleincomemoney::IDD, pParent)
  19. {
  20. //{{AFX_DATA_INIT(Singleincomemoney)
  21. m_money = _T("");
  22. m_time1 = g_date;
  23. m_ren2 = g_user.name;
  24. m_money1 = _T("");
  25. m_money2 = _T("");
  26. m_money3 = _T("");
  27. m_phone = _T("");
  28. m_sitem = _T("");
  29. m_id = _T("");
  30. m_name = _T("");
  31. //}}AFX_DATA_INIT
  32. }
  33. void Singleincomemoney::DoDataExchange(CDataExchange* pDX)
  34. {
  35. CDialog::DoDataExchange(pDX);
  36. //{{AFX_DATA_MAP(Singleincomemoney)
  37. DDX_Control(pDX, IDC_LIST1, m_List1);
  38. DDX_Control(pDX, IDC_EDIT2, m_editdate1);
  39. DDX_Control(pDX, IDC_EDIT1, m_editctrl1);
  40. DDX_Text(pDX, IDC_EDIT1, m_money);
  41. DDX_Text(pDX, IDC_EDIT2, m_time1);
  42. DDX_Text(pDX, IDC_EDITren2, m_ren2);
  43. DDX_Text(pDX, IDC_EDITmoney2, m_money1);
  44. DDX_Text(pDX, IDC_EDITmoney3, m_money2);
  45. DDX_Text(pDX, IDC_EDITmoney5, m_money3);
  46. DDX_Text(pDX, IDC_EDITphone, m_phone);
  47. DDX_Text(pDX, IDC_EDITsitem, m_sitem);
  48. DDX_Text(pDX, IDC_EDITid, m_id);
  49. DDX_Text(pDX, IDC_EDITname1, m_name);
  50. //}}AFX_DATA_MAP
  51. }
  52. BEGIN_MESSAGE_MAP(Singleincomemoney, CDialog)
  53. //{{AFX_MSG_MAP(Singleincomemoney)
  54. ON_WM_LBUTTONDOWN()
  55. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  56. ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
  57. ON_BN_CLICKED(IDC_BUTTON8, OnButton8)
  58. //}}AFX_MSG_MAP
  59. END_MESSAGE_MAP()
  60. /////////////////////////////////////////////////////////////////////////////
  61. // Singleincomemoney message handlers
  62. BOOL Singleincomemoney::OnInitDialog()
  63. {
  64. CDialog::OnInitDialog();
  65. GetDlgItem(IDC_BUTTON1)->EnableWindow(IsHasRights2new(49));
  66. // if(IsHasRights2new(49)==0)((CEdit*)GetDlgItem(IDC_EDIT2))->SetReadOnly ();
  67. // else
  68. ((CEdit*)GetDlgItem(IDC_EDIT2))->SetReadOnly();
  69. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  70. m_List1.SetHeadings("id,0;金额,80;日期,120;收款人,120;支付方式,120;接单点,80");
  71. else
  72. m_List1.SetHeadings("id,0;金额,80;日期,120;收款人,120;支付方式,120");
  73. m_List1.LoadColumnInfo(300);
  74. // TODO: Add extra initialization here
  75. g_sendhead.bsql = 0;
  76. g_sendhead.code[0] = 197;
  77. g_sendhead.tabcount = 1;
  78. CString filter = "id='" + m_id + "'";
  79. g_pMainWnd->ProcessChatMessageRequest2(filter);
  80. if (g_bSendOK == 0)
  81. {
  82. CDialog::OnCancel();
  83. return 0;
  84. }
  85. DataToArray(&m_List1array);
  86. CenterWindow(g_pMainWnd);
  87. FillGrid();
  88. return TRUE; // return TRUE unless you set the focus to a control
  89. // EXCEPTION: OCX Property Pages should return FALSE
  90. }
  91. void Singleincomemoney::OnOK() // 保存按钮 ;
  92. {
  93. UpdateData();
  94. if (m_money.IsEmpty())
  95. {
  96. AfxMessageBox("资料不全!", MB_ICONINFORMATION);
  97. return;
  98. }
  99. if (!CheckDateOK(m_time1))return;
  100. CString m_date = m_time1;
  101. BOOL bexist1 = 0;
  102. BOOL bexist2 = 0;
  103. if (bexist1 == 0)
  104. {
  105. for (int i = 0; i < m_List1array.GetSize(); i++)
  106. {
  107. if (m_List1array.ElementAt(i).ElementAt(0) == m_money)
  108. {
  109. bexist1 = 1;
  110. break;
  111. }
  112. }
  113. }
  114. if (bexist2 == 0)
  115. {
  116. for (int i = 0; i < m_List1array.GetSize(); i++)
  117. {
  118. if (m_List1array.ElementAt(i).ElementAt(1) == m_time1)
  119. {
  120. bexist2 = 1;
  121. break;
  122. }
  123. }
  124. }
  125. if (bexist1 && bexist2)
  126. {
  127. if (AfxMessageBox("已有相似的记录, 确认没有重复吗? 是否继续?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
  128. return;
  129. }
  130. CString sql;
  131. CString paytype;
  132. SelPayType seltype;
  133. seltype.m_paymoney = m_money;
  134. if (seltype.DoModal() != IDOK)return;
  135. if (seltype.m_radio1 == 0)
  136. paytype = "现金";
  137. else if (seltype.m_radio1 == 1)
  138. paytype = "POS机刷卡";
  139. else if (seltype.m_radio1 == 2)
  140. paytype = "储值卡扣款";
  141. else if (seltype.m_radio1 == 3)
  142. paytype = "积分兑换";
  143. else if (seltype.m_radio1 == 4)
  144. paytype = "银行转账";
  145. #if JEFF_TEST_ON
  146. else if (seltype.m_radio1 == 5)
  147. paytype = "代金券";
  148. #endif
  149. else if(seltype.m_radio1 == 6)
  150. paytype = "支付宝";
  151. else if(seltype.m_radio1 == 7)
  152. paytype = "财付通";
  153. else if(seltype.m_radio1 == 8)
  154. paytype = "微信支付";
  155. else if(seltype.m_radio1 == 9)
  156. paytype = seltype.m_strCustomPayType;
  157. #if JEFF_DELETE_ON // old coding;
  158. CString jdd; // 接单点;
  159. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  160. {
  161. SelExpendType dlg;
  162. dlg.m_mode = 3;
  163. if (dlg.DoModal() == IDOK)
  164. jdd = dlg.m_sel;
  165. }
  166. sql.Format("insert into [singleincomemoney]([id],[money],[date],[clerk],[paytype],[time],[jdd])values('%s','%s','%s','%s','%s','curtimereplace','%s')***refresh singleincomemoney%s",
  167. m_id, m_money, m_date, m_ren2, paytype, jdd, m_id);
  168. CString m_id = "其它二销:" + m_sitem;
  169. if (paytype == "储值卡扣款")
  170. {
  171. if (seltype.m_bChildMoneyCard)
  172. {
  173. sql += "***insert into [membercard3childusereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + m_date + "')";
  174. sql += "***refresh balance memberreg4" + seltype.m_parentno + ";" + seltype.m_cardno;
  175. }
  176. else
  177. {
  178. sql += "***insert into [membercard3usereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + m_date + "')";
  179. sql += "***refresh balance memberreg3"; sql += seltype.m_cardno;
  180. }
  181. }
  182. else if (paytype == "积分兑换")
  183. {
  184. CString point;
  185. float rate = atof(g_cominfoarray.ElementAt(0).ElementAt(38)) / 100.0;
  186. point.Format("%d", (int)(atof(m_money)*GetPointScale2() / rate));
  187. sql += "***insert into [memberreg2]([memberno],[dindanid],[money],[point],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + point + "','" + g_date + "')";
  188. sql += "***refresh balance memberreg2";
  189. sql += seltype.m_cardno;
  190. }
  191. g_sendhead.bsql = 1;
  192. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  193. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  194. GetData();
  195. // CDialog::OnOK();
  196. #else
  197. CString strBranchName = seltype.m_branch; // 当前选择的分店名;
  198. CString strOurBranchName = GetNameFromDomain(g_domain); // 本店店名;
  199. // 无分店,非集团版;
  200. // 选择的分店与连接的分店相同;
  201. // 连接的分店空且分店名与本店名相同;
  202. // 使用集团版,但只有一家店;
  203. // 使用的数据和要保存的数据都属于一家分店的情况;
  204. if ( strBranchName == _T("") || strBranchName == g_branchname ||
  205. (g_branchname == "" && strBranchName == strOurBranchName))
  206. {
  207. CString jdd; // 接单点;
  208. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  209. {
  210. SelExpendType dlg;
  211. dlg.m_mode = 3;
  212. if (dlg.DoModal() == IDOK)
  213. jdd = dlg.m_sel;
  214. }
  215. sql.Format("insert into [singleincomemoney]([id],[money],[date],[clerk],[paytype],[time],[jdd])values('%s','%s','%s','%s','%s','curtimereplace','%s')***refresh singleincomemoney%s",
  216. m_id, m_money, m_date, m_ren2, paytype, jdd, m_id);
  217. CString m_id = "其它二销:" + m_sitem;
  218. if (paytype == "储值卡扣款")
  219. {
  220. if (seltype.m_bChildMoneyCard)
  221. {
  222. sql += "***insert into [membercard3childusereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + m_date + "')";
  223. sql += "***refresh balance memberreg4" + seltype.m_parentno + ";" + seltype.m_cardno;
  224. }
  225. else
  226. {
  227. sql += "***insert into [membercard3usereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + m_date + "')";
  228. sql += "***refresh balance memberreg3"; sql += seltype.m_cardno;
  229. }
  230. }
  231. else if (paytype == "积分兑换")
  232. {
  233. CString point;
  234. float rate = atof(g_cominfoarray.ElementAt(0).ElementAt(38)) / 100.0;
  235. point.Format("%d", (int)(atof(m_money)*GetPointScale2() / rate));
  236. sql += "***insert into [memberreg2]([memberno],[dindanid],[money],[point],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + point + "','" + g_date + "')";
  237. sql += "***refresh balance memberreg2";
  238. sql += seltype.m_cardno;
  239. }
  240. g_sendhead.bsql = 1;
  241. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  242. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  243. GetData();
  244. }
  245. else
  246. {
  247. CString sql3;
  248. BOOL bBranchModifyBak = g_bBranchModify;
  249. CString strbranchnameBak = g_branchname;
  250. CString strbranchipBak = g_branchip;
  251. CString strCurbranch;
  252. if (g_branchname != "")
  253. strCurbranch = g_branchname;
  254. else
  255. strCurbranch = strOurBranchName;
  256. // 逻辑问题:这里不能显示接单点与id组合的字符串,因为表singleincome的是自增id;
  257. //CString m_id2 = strCurbranch + m_id;
  258. CString jdd; // 接单点;
  259. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  260. {
  261. SelExpendType dlg;
  262. dlg.m_mode = 3;
  263. if (dlg.DoModal() == IDOK)
  264. jdd = dlg.m_sel;
  265. }
  266. sql.Format("insert into [singleincomemoney]([id],[money],[date],[clerk],[paytype],[time],[jdd])values('%s','%s','%s','%s','%s','curtimereplace','%s')***refresh singleincomemoney%s",
  267. m_id, m_money, m_date, m_ren2, paytype, jdd, m_id);
  268. CString strSQL = _T("");
  269. CString id = strCurbranch + _T("其它二销:") + m_sitem;
  270. if (paytype == "储值卡扣款")
  271. {
  272. if (seltype.m_bChildMoneyCard)
  273. {
  274. strSQL += "***insert into [membercard3childusereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + id + "','" + m_money + "','" + m_date + "')";
  275. strSQL += "***refresh balance memberreg4" + seltype.m_parentno + ";" + seltype.m_cardno;
  276. }
  277. else
  278. {
  279. strSQL += "***insert into [membercard3usereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + id + "','" + m_money + "','" + m_date + "')";
  280. strSQL += "***refresh balance memberreg3";
  281. strSQL += seltype.m_cardno;
  282. }
  283. }
  284. else if (paytype == "积分兑换")
  285. {
  286. CString point;
  287. float rate = atof(g_cominfoarray.ElementAt(0).ElementAt(38)) / 100.0;
  288. point.Format("%d", (int)(atof(m_money)*GetPointScale2() / rate));
  289. strSQL += "***insert into [memberreg2]([memberno],[dindanid],[money],[point],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + point + "','" + g_date + "')";
  290. strSQL += "***refresh balance memberreg2";
  291. strSQL += seltype.m_cardno;
  292. }
  293. // 断开软件选择的分店连接,获取选择的接单点分店ip;
  294. // 连接接单点分店并写入数据到接单点数据库;
  295. g_pMainWnd->OnDisconnect();
  296. g_branchip = GetIP(strBranchName);
  297. g_pMainWnd->OnDisconnect();
  298. g_branchname = strBranchName;
  299. g_bBranchModify = 1;
  300. g_sendhead.bsql = 1;
  301. strSQL.TrimLeft("***");
  302. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  303. if (g_bSendOK == 0)return;
  304. // 恢复软件选择的分店连接;
  305. // 并写入数据;
  306. g_pMainWnd->OnDisconnect();
  307. g_bBranchModify = 0;
  308. g_branchip = g_branchname = "";
  309. g_bBranchModify = bBranchModifyBak;
  310. g_branchname = strbranchnameBak;
  311. g_branchip = strbranchipBak;
  312. g_sendhead.bsql = 1;
  313. g_pMainWnd->ProcessChatMessageRequest2(sql);
  314. if (g_bSendOK == 0)return;
  315. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  316. GetData();
  317. }
  318. #endif
  319. }
  320. HBRUSH Singleincomemoney::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
  321. {
  322. HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
  323. // TODO: Change any attributes of the DC here
  324. if (nCtlColor == CTLCOLOR_STATIC)
  325. {
  326. pDC->SetBkMode(TRANSPARENT); //设置字体背景为透明
  327. return (HBRUSH)::GetStockObject(NULL_BRUSH); // 设置背景色
  328. }
  329. // TODO: Return a different brush if the default is not desired
  330. return hbr;
  331. }
  332. void Singleincomemoney::OnLButtonDown(UINT nFlags, CPoint point)
  333. {
  334. CDialog::OnLButtonDown(nFlags, point);
  335. }
  336. void Singleincomemoney::GetData()
  337. {
  338. g_sendhead.bsql = 0;
  339. g_sendhead.code[0] = 197;
  340. g_sendhead.tabcount = 1;
  341. CString filter = "id='" + m_id + "'";
  342. g_pMainWnd->ProcessChatMessageRequest2(filter);
  343. if (g_bSendOK == 0)return;
  344. DataToArray(&m_List1array);
  345. FillGrid();
  346. float payed = 0;
  347. for (int i = 0; i < m_List1.GetItemCount(); i++)
  348. {
  349. payed += atof(m_List1.GetItemText(i, 1));
  350. }
  351. m_money2.Format("%0.1f", payed);
  352. m_money3.Format("%0.1f", atof(m_money1) - atof(m_money2));
  353. UpdateData(0);
  354. }
  355. void Singleincomemoney::FillGrid()
  356. {
  357. m_List1.DeleteAllItems2();
  358. int ii = 0;
  359. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  360. int count = 0;
  361. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  362. {
  363. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  364. }
  365. m_List1.m_arLabels.SetSize(count, 1);
  366. ii = count;
  367. m_List1.m_LabelCount = ii;
  368. m_List1.SetItemCountEx(ii);
  369. }
  370. BOOL Singleincomemoney::PreTranslateMessage(MSG* pMsg)
  371. {
  372. if (pMsg->message == WM_KEYDOWN)
  373. {
  374. switch (pMsg->wParam)
  375. {
  376. case VK_RETURN:
  377. return 1;
  378. }
  379. }
  380. return CDialog::PreTranslateMessage(pMsg);
  381. }
  382. void Singleincomemoney::OnButton1() // 删除按钮;
  383. {
  384. if (IsHasRights2new(49) == 0)return;
  385. POSITION pos;
  386. pos = m_List1.GetFirstSelectedItemPosition();
  387. if (pos == NULL)
  388. {
  389. AfxMessageBox("请先选中您要删除的项目!", MB_ICONINFORMATION);
  390. return;
  391. }
  392. if (AfxMessageBox("是否删除此项目?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
  393. int iItem = m_List1.GetNextSelectedItem(pos);
  394. CString id = m_List1.GetItemText(iItem, 0);
  395. CString money = m_List1.GetItemText(iItem, 1);
  396. CString bz = m_List1.GetItemText(iItem, 2) + m_List1.GetItemText(iItem, 3);
  397. CString sql;
  398. sql.Format("delete from singleincomemoney where [autoid]=%d***refresh singleincomemoney%s", atol(id), m_id);
  399. g_sendhead.bsql = 1;
  400. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  401. GetData();
  402. CString str;
  403. str = m_List1.GetItemText(iItem, 3);
  404. str += "删除客人";
  405. str += m_name;
  406. str += m_List1.GetItemText(iItem, 2);
  407. str += "其它二销收款:";
  408. str += money;
  409. WriteLog(_T("其它二销"), str);
  410. }
  411. void Singleincomemoney::OnButton3() // 更改按钮;
  412. {
  413. // TODO: Add your control notification handler code here
  414. Login2 dlg;
  415. dlg.m_mode = 3;
  416. if (dlg.DoModal() != IDOK)return;
  417. if (IsHasRightsnew2(49, dlg.m_rights) == 0)return;
  418. ((CEdit*)GetDlgItem(IDC_EDIT2))->SetReadOnly(0);
  419. }
  420. void Singleincomemoney::OnButton8() // 打单按钮;
  421. {
  422. // TODO: Add your control notification handler code here
  423. //AfxMessageBox("789");
  424. POSITION pos;
  425. pos = m_List1.GetFirstSelectedItemPosition();
  426. if (pos == NULL)
  427. {
  428. AfxMessageBox("请先选中您要打单的项目!", MB_ICONINFORMATION);
  429. return;
  430. }
  431. int iItem;
  432. CStringArray array;
  433. array.Add("");
  434. array.Add(g_cominfoarray.ElementAt(0).ElementAt(48));
  435. array.Add("NO." + m_id);
  436. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  437. str += " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  438. array.Add(str);
  439. CString name = m_name;
  440. CString phone = m_phone;
  441. array.Add("客户姓名:" + name);
  442. if (IsHasRights2new(31) == 0)
  443. array.Add("");
  444. else
  445. array.Add("联系电话:" + phone);
  446. CString date;
  447. date.Format("日期:%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
  448. array.Add(date);
  449. array.Add(" 收 款 项 目 ");
  450. // Jeff 显示打印支付方式;
  451. int isSmall = atoi(g_cominfoarray.ElementAt(0).ElementAt(87));//小单
  452. if(isSmall == 0)
  453. array.Add(" 支付方式 ");
  454. array.Add(" 金 额 ");
  455. array.Add(" 开单人 ");
  456. int count = 0;
  457. float money = 0;
  458. while (pos)
  459. {
  460. count++;
  461. if (m_bz != "" && count > 3)break;
  462. if (count > 4)break;
  463. iItem = m_List1.GetNextSelectedItem(pos);
  464. array.Add(m_sitem);
  465. // 显示打印支付方式;
  466. if(isSmall == 0)
  467. array.Add(m_List1.GetItemText(iItem, 4)); // add by Jeff:添加支付方式;
  468. array.Add(m_List1.GetItemText(iItem, 1));
  469. money += atof(m_List1.GetItemText(iItem, 1));
  470. array.Add(m_ren);
  471. }
  472. if (m_bz != "" && count == 1)
  473. {
  474. array.Add("");
  475. array.Add("");
  476. array.Add("");
  477. array.Add("");
  478. array.Add("");
  479. array.Add("");
  480. array.Add("");
  481. array.Add("");
  482. array.Add(m_bz);
  483. array.Add("");
  484. array.Add("");
  485. array.Add("");
  486. }
  487. if (m_bz != "" && count == 2)
  488. {
  489. array.Add("");
  490. array.Add("");
  491. array.Add("");
  492. array.Add("");
  493. array.Add(m_bz);
  494. array.Add("");
  495. array.Add("");
  496. array.Add("");
  497. }
  498. if (m_bz != "" && count == 3)
  499. {
  500. array.Add(m_bz);
  501. array.Add("");
  502. array.Add("");
  503. array.Add("");
  504. }
  505. if (m_bz != "" && count == 4)
  506. {
  507. array.Add(m_bz);
  508. array.Add("");
  509. array.Add("");
  510. array.Add("");
  511. }
  512. //while(array.GetSize ()<22) array.Add ("");
  513. while (array.GetSize() < 27) array.Add(""); // 显示打印支付方式;
  514. CString smoney;
  515. smoney.Format("%0.1f", money);
  516. if(isSmall == 0)//小单
  517. {
  518. str = "付款情况 应付:" + m_money1;
  519. str += " 实付:" + m_money2;
  520. str += " 欠款:" + m_money3;
  521. }
  522. else
  523. {
  524. str = "付款情况 应付:" + m_money1;
  525. str += " 实付:" + m_money2;
  526. str += " 欠款:" + m_money3;
  527. }
  528. array.Add(str);
  529. if(isSmall == 0)//小单
  530. {
  531. str.Format("合计人民币(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元", \
  532. GetHMoney(GetW(smoney)), GetHMoney(GetK(smoney)), GetHMoney(GetB(smoney)), GetHMoney(GetS(smoney)), GetHMoney(GetG(smoney)));
  533. }
  534. else
  535. {
  536. str.Format("合计人民币(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元", \
  537. GetHMoney(GetW(smoney)), GetHMoney(GetK(smoney)), GetHMoney(GetB(smoney)), GetHMoney(GetS(smoney)), GetHMoney(GetG(smoney)));
  538. }
  539. array.Add(str);
  540. array.Add(g_cominfoarray.ElementAt(0).ElementAt(120));
  541. array.Add(" 收银:" + g_user.name);
  542. array.Add("顾客签名:");
  543. array.Add("");//第\r\n一\r\n联\r\n存\r\n根\r\n∧\r\n白\r\n∨\r\n第\r\n二\r\n联\r\n财\r\n务\r\n∧\r\n黄\r\n∨\r\n第\r\n三\r\n联\r\n客\r\n户\r\n∧\r\n红\r\n∨");
  544. g_pMainWnd->PrintReceipt_02(&array); // 2销收入,应该使用PrintReceipt_01,需要显示支付方式 Jeff
  545. }
  546. /*
  547. insert into [singleincomemoney]([id],[money],[date],[clerk],[paytype]) select [id],[money],[dat],[renyuan2],[paytype] from singleincome where payed is null***update [singleincome] set [payed]=(select sum(cast(money as float)) from [singleincomemoney] where [singleincome].[id]=[singleincomemoney].[id])***update [singleincome] set [balance]=cast(money as float)-cast(payed as float)
  548. */