Singleincomemoney.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  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_DELETE_ON // old coding;
  146. CString jdd; // 接单点;
  147. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  148. {
  149. SelExpendType dlg;
  150. dlg.m_mode = 3;
  151. if (dlg.DoModal() == IDOK)
  152. jdd = dlg.m_sel;
  153. }
  154. sql.Format("insert into [singleincomemoney]([id],[money],[date],[clerk],[paytype],[time],[jdd])values('%s','%s','%s','%s','%s','curtimereplace','%s')***refresh singleincomemoney%s",
  155. m_id, m_money, m_date, m_ren2, paytype, jdd, m_id);
  156. CString m_id = "其它二销:" + m_sitem;
  157. if (paytype == "储值卡扣款")
  158. {
  159. if (seltype.m_bChildMoneyCard)
  160. {
  161. sql += "***insert into [membercard3childusereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + m_date + "')";
  162. sql += "***refresh balance memberreg4" + seltype.m_parentno + ";" + seltype.m_cardno;
  163. }
  164. else
  165. {
  166. sql += "***insert into [membercard3usereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + m_date + "')";
  167. sql += "***refresh balance memberreg3"; sql += seltype.m_cardno;
  168. }
  169. }
  170. else if (paytype == "积分兑换")
  171. {
  172. CString point;
  173. float rate = atof(g_cominfoarray.ElementAt(0).ElementAt(38)) / 100.0;
  174. point.Format("%d", (int)(atof(m_money)*GetPointScale2() / rate));
  175. sql += "***insert into [memberreg2]([memberno],[dindanid],[money],[point],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + point + "','" + g_date + "')";
  176. sql += "***refresh balance memberreg2";
  177. sql += seltype.m_cardno;
  178. }
  179. g_sendhead.bsql = 1;
  180. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  181. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  182. GetData();
  183. // CDialog::OnOK();
  184. #else
  185. CString strBranchName = seltype.m_branch; // 当前选择的分店名;
  186. CString strOurBranchName = GetNameFromDomain(g_domain); // 本店店名;
  187. // AfxMessageBox(strBranchName);
  188. // AfxMessageBox(strOurBranchName);
  189. // AfxMessageBox(g_branchname);
  190. // 无分店,非集团版;
  191. // 选择的分店与连接的分店相同;
  192. // 连接的分店空且分店名与本店名相同;
  193. // 使用集团版,但只有一家店;
  194. // 使用的数据和要保存的数据都属于一家分店的情况;
  195. if ( strBranchName == _T("") || strBranchName == g_branchname ||
  196. (g_branchname == "" && strBranchName == strOurBranchName))
  197. {
  198. CString jdd; // 接单点;
  199. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  200. {
  201. SelExpendType dlg;
  202. dlg.m_mode = 3;
  203. if (dlg.DoModal() == IDOK)
  204. jdd = dlg.m_sel;
  205. }
  206. sql.Format("insert into [singleincomemoney]([id],[money],[date],[clerk],[paytype],[time],[jdd])values('%s','%s','%s','%s','%s','curtimereplace','%s')***refresh singleincomemoney%s",
  207. m_id, m_money, m_date, m_ren2, paytype, jdd, m_id);
  208. CString m_id = "其它二销:" + m_sitem;
  209. if (paytype == "储值卡扣款")
  210. {
  211. if (seltype.m_bChildMoneyCard)
  212. {
  213. sql += "***insert into [membercard3childusereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + m_date + "')";
  214. sql += "***refresh balance memberreg4" + seltype.m_parentno + ";" + seltype.m_cardno;
  215. }
  216. else
  217. {
  218. sql += "***insert into [membercard3usereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + m_date + "')";
  219. sql += "***refresh balance memberreg3"; sql += seltype.m_cardno;
  220. }
  221. }
  222. else if (paytype == "积分兑换")
  223. {
  224. CString point;
  225. float rate = atof(g_cominfoarray.ElementAt(0).ElementAt(38)) / 100.0;
  226. point.Format("%d", (int)(atof(m_money)*GetPointScale2() / rate));
  227. sql += "***insert into [memberreg2]([memberno],[dindanid],[money],[point],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + point + "','" + g_date + "')";
  228. sql += "***refresh balance memberreg2";
  229. sql += seltype.m_cardno;
  230. }
  231. g_sendhead.bsql = 1;
  232. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  233. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  234. GetData();
  235. }
  236. else
  237. {
  238. CString sql3;
  239. BOOL bBranchModifyBak = g_bBranchModify;
  240. CString strbranchnameBak = g_branchname;
  241. CString strbranchipBak = g_branchip;
  242. CString strCurbranch;
  243. if (g_branchname != "")
  244. strCurbranch = g_branchname;
  245. else
  246. strCurbranch = strOurBranchName;
  247. // 逻辑问题:这里不能显示接单点与id组合的字符串,因为表singleincome的是自增id;
  248. //CString m_id2 = strCurbranch + m_id;
  249. CString jdd; // 接单点;
  250. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  251. {
  252. SelExpendType dlg;
  253. dlg.m_mode = 3;
  254. if (dlg.DoModal() == IDOK)
  255. jdd = dlg.m_sel;
  256. }
  257. sql.Format("insert into [singleincomemoney]([id],[money],[date],[clerk],[paytype],[time],[jdd])values('%s','%s','%s','%s','%s','curtimereplace','%s')***refresh singleincomemoney%s",
  258. m_id, m_money, m_date, m_ren2, paytype, jdd, m_id);
  259. CString strSQL = _T("");
  260. CString id = strCurbranch + _T("其它二销:") + m_sitem;
  261. if (paytype == "储值卡扣款")
  262. {
  263. if (seltype.m_bChildMoneyCard)
  264. {
  265. strSQL += "***insert into [membercard3childusereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + id + "','" + m_money + "','" + m_date + "')";
  266. strSQL += "***refresh balance memberreg4" + seltype.m_parentno + ";" + seltype.m_cardno;
  267. }
  268. else
  269. {
  270. strSQL += "***insert into [membercard3usereg]([memberno],[dindanid],[money],[date])values('" + seltype.m_cardno + "','" + id + "','" + m_money + "','" + m_date + "')";
  271. strSQL += "***refresh balance memberreg3";
  272. strSQL += seltype.m_cardno;
  273. }
  274. }
  275. else if (paytype == "积分兑换")
  276. {
  277. CString point;
  278. float rate = atof(g_cominfoarray.ElementAt(0).ElementAt(38)) / 100.0;
  279. point.Format("%d", (int)(atof(m_money)*GetPointScale2() / rate));
  280. strSQL += "***insert into [memberreg2]([memberno],[dindanid],[money],[point],[date])values('" + seltype.m_cardno + "','" + m_id + "','" + m_money + "','" + point + "','" + g_date + "')";
  281. strSQL += "***refresh balance memberreg2";
  282. strSQL += seltype.m_cardno;
  283. }
  284. // 断开软件选择的分店连接,获取选择的接单点分店ip;
  285. // 连接接单点分店并写入数据到接单点数据库;
  286. g_pMainWnd->OnDisconnect();
  287. g_branchip = GetIP(strBranchName);
  288. g_pMainWnd->OnDisconnect();
  289. g_branchname = strBranchName;
  290. g_bBranchModify = 1;
  291. g_sendhead.bsql = 1;
  292. strSQL.TrimLeft("***");
  293. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  294. if (g_bSendOK == 0)return;
  295. // 恢复软件选择的分店连接;
  296. // 并写入数据;
  297. g_pMainWnd->OnDisconnect();
  298. g_bBranchModify = 0;
  299. g_branchip = g_branchname = "";
  300. g_bBranchModify = bBranchModifyBak;
  301. g_branchname = strbranchnameBak;
  302. g_branchip = strbranchipBak;
  303. g_sendhead.bsql = 1;
  304. g_pMainWnd->ProcessChatMessageRequest2(sql);
  305. if (g_bSendOK == 0)return;
  306. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  307. GetData();
  308. }
  309. #endif
  310. }
  311. HBRUSH Singleincomemoney::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
  312. {
  313. HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
  314. // TODO: Change any attributes of the DC here
  315. if (nCtlColor == CTLCOLOR_STATIC)
  316. {
  317. pDC->SetBkMode(TRANSPARENT); //设置字体背景为透明
  318. return (HBRUSH)::GetStockObject(NULL_BRUSH); // 设置背景色
  319. }
  320. // TODO: Return a different brush if the default is not desired
  321. return hbr;
  322. }
  323. void Singleincomemoney::OnLButtonDown(UINT nFlags, CPoint point)
  324. {
  325. CDialog::OnLButtonDown(nFlags, point);
  326. }
  327. void Singleincomemoney::GetData()
  328. {
  329. g_sendhead.bsql = 0;
  330. g_sendhead.code[0] = 197;
  331. g_sendhead.tabcount = 1;
  332. CString filter = "id='" + m_id + "'";
  333. g_pMainWnd->ProcessChatMessageRequest2(filter);
  334. if (g_bSendOK == 0)return;
  335. DataToArray(&m_List1array);
  336. FillGrid();
  337. float payed = 0;
  338. for (int i = 0; i < m_List1.GetItemCount(); i++)
  339. {
  340. payed += atof(m_List1.GetItemText(i, 1));
  341. }
  342. m_money2.Format("%0.1f", payed);
  343. m_money3.Format("%0.1f", atof(m_money1) - atof(m_money2));
  344. UpdateData(0);
  345. }
  346. void Singleincomemoney::FillGrid()
  347. {
  348. m_List1.DeleteAllItems2();
  349. int ii = 0;
  350. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  351. int count = 0;
  352. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  353. {
  354. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  355. }
  356. m_List1.m_arLabels.SetSize(count, 1);
  357. ii = count;
  358. m_List1.m_LabelCount = ii;
  359. m_List1.SetItemCountEx(ii);
  360. }
  361. BOOL Singleincomemoney::PreTranslateMessage(MSG* pMsg)
  362. {
  363. if (pMsg->message == WM_KEYDOWN)
  364. {
  365. switch (pMsg->wParam)
  366. {
  367. case VK_RETURN:
  368. return 1;
  369. }
  370. }
  371. return CDialog::PreTranslateMessage(pMsg);
  372. }
  373. void Singleincomemoney::OnButton1() // 删除按钮;
  374. {
  375. if (IsHasRights2new(49) == 0)return;
  376. POSITION pos;
  377. pos = m_List1.GetFirstSelectedItemPosition();
  378. if (pos == NULL)
  379. {
  380. AfxMessageBox("请先选中您要删除的项目!", MB_ICONINFORMATION);
  381. return;
  382. }
  383. if (AfxMessageBox("是否删除此项目?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
  384. int iItem = m_List1.GetNextSelectedItem(pos);
  385. CString id = m_List1.GetItemText(iItem, 0);
  386. CString money = m_List1.GetItemText(iItem, 1);
  387. CString bz = m_List1.GetItemText(iItem, 2) + m_List1.GetItemText(iItem, 3);
  388. CString sql;
  389. sql.Format("delete from singleincomemoney where [autoid]=%d***refresh singleincomemoney%s", atol(id), m_id);
  390. g_sendhead.bsql = 1;
  391. g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
  392. GetData();
  393. CString str;
  394. str = m_List1.GetItemText(iItem, 3);
  395. str += "删除客人";
  396. str += m_name;
  397. str += m_List1.GetItemText(iItem, 2);
  398. str += "其它二销收款:";
  399. str += money;
  400. WriteLog(str);
  401. }
  402. void Singleincomemoney::OnButton3() // 更改按钮;
  403. {
  404. // TODO: Add your control notification handler code here
  405. Login2 dlg;
  406. dlg.m_mode = 3;
  407. if (dlg.DoModal() != IDOK)return;
  408. if (IsHasRightsnew2(49, dlg.m_rights) == 0)return;
  409. ((CEdit*)GetDlgItem(IDC_EDIT2))->SetReadOnly(0);
  410. }
  411. void Singleincomemoney::OnButton8() // 打单按钮;
  412. {
  413. // TODO: Add your control notification handler code here
  414. //AfxMessageBox("789");
  415. POSITION pos;
  416. pos = m_List1.GetFirstSelectedItemPosition();
  417. if (pos == NULL)
  418. {
  419. AfxMessageBox("请先选中您要打单的项目!", MB_ICONINFORMATION);
  420. return;
  421. }
  422. int iItem;
  423. CStringArray array;
  424. array.Add("");
  425. array.Add(g_cominfoarray.ElementAt(0).ElementAt(48));
  426. array.Add("NO." + m_id);
  427. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  428. str += " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  429. array.Add(str);
  430. CString name = m_name;
  431. CString phone = m_phone;
  432. array.Add("客户姓名:" + name);
  433. if (IsHasRights2new(31) == 0)
  434. array.Add("");
  435. else
  436. array.Add("联系电话:" + phone);
  437. CString date;
  438. date.Format("日期:%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
  439. array.Add(date);
  440. array.Add(" 收 款 项 目 ");
  441. #if 1 // Jeff 显示打印支付方式;
  442. array.Add(" 支付方式 ");
  443. #endif
  444. array.Add(" 金 额 ");
  445. array.Add(" 开单人 ");
  446. int count = 0;
  447. float money = 0;
  448. while (pos)
  449. {
  450. count++;
  451. if (m_bz != "" && count > 3)break;
  452. if (count > 4)break;
  453. iItem = m_List1.GetNextSelectedItem(pos);
  454. array.Add(m_sitem);
  455. #if 1 // 显示打印支付方式;
  456. array.Add(m_List1.GetItemText(iItem, 4)); // add by Jeff:添加支付方式;
  457. #endif
  458. array.Add(m_List1.GetItemText(iItem, 1));
  459. money += atof(m_List1.GetItemText(iItem, 1));
  460. array.Add(m_ren);
  461. }
  462. if (m_bz != "" && count == 1)
  463. {
  464. array.Add("");
  465. array.Add("");
  466. array.Add("");
  467. array.Add("");
  468. array.Add("");
  469. array.Add("");
  470. array.Add("");
  471. array.Add("");
  472. array.Add(m_bz);
  473. array.Add("");
  474. array.Add("");
  475. array.Add("");
  476. }
  477. if (m_bz != "" && count == 2)
  478. {
  479. array.Add("");
  480. array.Add("");
  481. array.Add("");
  482. array.Add("");
  483. array.Add(m_bz);
  484. array.Add("");
  485. array.Add("");
  486. array.Add("");
  487. }
  488. if (m_bz != "" && count == 3)
  489. {
  490. array.Add(m_bz);
  491. array.Add("");
  492. array.Add("");
  493. array.Add("");
  494. }
  495. if (m_bz != "" && count == 4)
  496. {
  497. array.Add(m_bz);
  498. array.Add("");
  499. array.Add("");
  500. array.Add("");
  501. }
  502. //while(array.GetSize ()<22) array.Add ("");
  503. while (array.GetSize() < 27) array.Add(""); // 显示打印支付方式;
  504. CString smoney;
  505. smoney.Format("%0.1f", money);
  506. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  507. {
  508. str = "付款情况 应付:" + m_money1;
  509. str += " 实付:" + m_money2;
  510. str += " 欠款:" + m_money3;
  511. }
  512. else
  513. {
  514. str = "付款情况 应付:" + m_money1;
  515. str += " 实付:" + m_money2;
  516. str += " 欠款:" + m_money3;
  517. }
  518. array.Add(str);
  519. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  520. {
  521. str.Format("合计人民币(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元", \
  522. GetHMoney(GetW(smoney)), GetHMoney(GetK(smoney)), GetHMoney(GetB(smoney)), GetHMoney(GetS(smoney)), GetHMoney(GetG(smoney)));
  523. }
  524. else
  525. {
  526. str.Format("合计人民币(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元", \
  527. GetHMoney(GetW(smoney)), GetHMoney(GetK(smoney)), GetHMoney(GetB(smoney)), GetHMoney(GetS(smoney)), GetHMoney(GetG(smoney)));
  528. }
  529. array.Add(str);
  530. array.Add(g_cominfoarray.ElementAt(0).ElementAt(120));
  531. array.Add(" 收银:" + g_user.name);
  532. array.Add("顾客签名:");
  533. 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∨");
  534. g_pMainWnd->PrintReceipt_02(&array); // 2销收入,应该使用PrintReceipt_01,需要显示支付方式 Jeff
  535. }
  536. /*
  537. 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)
  538. */