YearForm.cpp 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915
  1. // YearForm.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "YearForm.h"
  6. #include "MyMdi.H"
  7. #include "SelExpendType.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. IMPLEMENT_DYNCREATE(YearForm, MyFormView)
  14. YearForm::YearForm()
  15. : MyFormView(YearForm::IDD)
  16. {
  17. m_year = atoi(g_date.Mid(0, 4));
  18. m_month = atoi(g_date.Mid(5, 2));
  19. m_day = atoi(g_date.Mid(8, 2));
  20. m_radio1 = 0;
  21. m_bInit = 0;
  22. m_timestmap = 0;
  23. m_radio2 = 0;
  24. m_bForKF = 0;
  25. }
  26. YearForm::~YearForm()
  27. {
  28. }
  29. void YearForm::DoDataExchange(CDataExchange* pDX)
  30. {
  31. MyFormView::DoDataExchange(pDX);
  32. DDX_Control(pDX, IDC_SPIN3, m_spinday);
  33. DDX_Control(pDX, IDC_SPIN2, m_spinmonth);
  34. DDX_Control(pDX, IDC_SPIN1, m_spinyear);
  35. DDX_Control(pDX, IDC_LIST2, m_List1);
  36. DDX_Control(pDX, IDC_STATIC1, m_static1);
  37. DDX_Text(pDX, IDC_EDITyear, m_year);
  38. DDV_MinMaxUInt(pDX, m_year, 1900, 3000);
  39. DDX_Text(pDX, IDC_EDITmonth, m_month);
  40. DDV_MinMaxUInt(pDX, m_month, 1, 12);
  41. DDX_Text(pDX, IDC_EDITday, m_day);
  42. DDV_MinMaxUInt(pDX, m_day, 1, 31);
  43. DDX_Radio(pDX, IDC_RADIO3, m_radio1);
  44. DDX_Radio(pDX, IDC_RADIO14, m_radio2);
  45. }
  46. BEGIN_MESSAGE_MAP(YearForm, MyFormView)
  47. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  48. ON_EN_CHANGE(IDC_EDITyear, OnChangeEDITyear)
  49. ON_EN_CHANGE(IDC_EDITmonth, OnChangeEDITmonth)
  50. ON_EN_CHANGE(IDC_EDITday, OnChangeEDITday)
  51. ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
  52. ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
  53. ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
  54. ON_BN_CLICKED(IDC_RADIO6, OnRadio6)
  55. ON_BN_CLICKED(IDC_RADIO7, OnRadio7)
  56. ON_BN_CLICKED(IDC_RADIO8, OnRadio8)
  57. ON_BN_CLICKED(IDC_RADIO9, OnRadio9)
  58. ON_BN_CLICKED(IDC_RADIO10, OnRadio10)
  59. ON_BN_CLICKED(IDC_RADIO11, OnRadio11)
  60. ON_BN_CLICKED(IDC_RADIO12, OnRadio12)
  61. ON_BN_CLICKED(IDC_RADIO13, OnRadio13)
  62. ON_BN_CLICKED(IDC_BUTprint, OnBUTprint)
  63. ON_BN_CLICKED(IDC_BUTprint5, OnBUTprint5)
  64. ON_BN_CLICKED(IDC_BUTprint4, OnBUTprint4)
  65. ON_BN_CLICKED(IDC_RADIO14, OnRadio14)
  66. ON_BN_CLICKED(IDC_RADIO15, OnRadio15)
  67. ON_BN_CLICKED(IDC_RADIO16, OnRadio16)
  68. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList)
  69. END_MESSAGE_MAP()
  70. #ifdef _DEBUG
  71. void YearForm::AssertValid() const
  72. {
  73. MyFormView::AssertValid();
  74. }
  75. void YearForm::Dump(CDumpContext& dc) const
  76. {
  77. MyFormView::Dump(dc);
  78. }
  79. #endif //_DEBUG
  80. void YearForm::OnInitialUpdate()
  81. {
  82. MyFormView::OnInitialUpdate();
  83. #ifdef DDF_VERSION
  84. GetDlgItem(IDC_STATIC10)->ShowWindow(SW_SHOW);
  85. GetDlgItem(IDC_RADIO14)->ShowWindow(SW_SHOW);
  86. GetDlgItem(IDC_RADIO15)->ShowWindow(SW_SHOW);
  87. #endif
  88. CMyMdi Mdi;
  89. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  90. CRect rc2;
  91. GetWindowRect(rc2);
  92. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  93. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  94. m_static1.SetFont(&g_titlefont);
  95. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  96. GetDlgItem(IDC_BUTprint4)->ShowWindow(SW_SHOW);
  97. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  98. m_List1.SetHeadings("id,0;项目名称,300;金额,100;项目类别,100;收入/支出,100;日期,100;支付方式,100;收银,100;财务审核,100;接单点,100");
  99. else
  100. m_List1.SetHeadings("id,0;项目名称,300;金额,100;项目类别,100;收入/支出,100;日期,100;支付方式,100;收银,100;财务审核,100");
  101. m_List1.LoadColumnInfo(107);
  102. m_spinyear.SetRange(1900, 3000);
  103. m_spinmonth.SetRange(1, 12);
  104. m_spinday.SetRange(1, 31);
  105. #ifdef CHILD_VERSION
  106. SetDlgItemText(IDC_RADIO10, _T("引导二销"));
  107. #endif
  108. m_bInit = 1;
  109. DateChange();
  110. }
  111. void YearForm::FillGrid()
  112. {
  113. m_List1.DeleteAllItems2();
  114. int ii = 0;
  115. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  116. int count = 0;
  117. CString str;
  118. if (m_filter.IsEmpty() && m_jdd.IsEmpty())
  119. {
  120. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  121. {
  122. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  123. }
  124. }
  125. else if (m_jdd.IsEmpty() == 0)
  126. {
  127. float income = 0;
  128. int dindanshu = 0;
  129. float payout = 0;
  130. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  131. {
  132. if (m_List1array.ElementAt(ii).ElementAt(9) == m_jdd)
  133. {
  134. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  135. if(m_List1array.ElementAt(ii).ElementAt(4) == _T("支出"))
  136. payout += atof(m_List1array.ElementAt(ii).ElementAt(2));
  137. else
  138. income += atof(m_List1array.ElementAt(ii).ElementAt(2));
  139. if (m_List1array.ElementAt(ii).ElementAt(3) == _T("预约收款"))
  140. dindanshu++;
  141. }
  142. }
  143. CString str;
  144. str.Format("%0.2f", income);
  145. ::ConvertToPrice(str);
  146. SetDlgItemText(IDC_EDITmoney1, str);
  147. str.Format("%0.2f", income);
  148. ::ConvertToPrice(str);
  149. SetDlgItemText(IDC_EDITmoney5, str);
  150. str.Format("%0.2f", payout);
  151. ::ConvertToPrice(str);
  152. SetDlgItemText(IDC_EDITmoney2, str);
  153. str.Format("%0.2f", income - payout);
  154. ::ConvertToPrice(str);
  155. SetDlgItemText(IDC_EDITmoney3, str);
  156. str.Format("%d", dindanshu);
  157. SetDlgItemText(IDC_EDITmoney4, str);
  158. }
  159. else
  160. {
  161. float payout = 0;
  162. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  163. {
  164. if (m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter + ";") != -1)
  165. {
  166. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  167. payout += atof(m_List1array.ElementAt(ii).ElementAt(2));
  168. }
  169. }
  170. str.Format("%0.2f", payout);
  171. ::ConvertToPrice(str);
  172. SetDlgItemText(IDC_EDITmoney2, str);
  173. str.Format("%0.2f", -payout);
  174. ::ConvertToPrice(str);
  175. SetDlgItemText(IDC_EDITmoney3, str);
  176. }
  177. m_List1.m_arLabels.SetSize(count, 1);
  178. ii = count;
  179. m_List1.m_LabelCount = ii;
  180. m_List1.SetItemCountEx(ii);
  181. str.Format("单数:%d", ii);
  182. SetDlgItemText(IDC_STATIC2, str);
  183. CRect rc;
  184. GetDlgItem(IDC_STATIC2)->GetWindowRect(rc);
  185. ScreenToClient(rc);
  186. InvalidateRect(rc);
  187. }
  188. void YearForm::OnBUTclose()
  189. {
  190. GetParent()->SendMessage(WM_CLOSE);
  191. }
  192. void YearForm::OnChangeEDITyear()
  193. {
  194. DateChange();
  195. }
  196. void YearForm::OnChangeEDITmonth()
  197. {
  198. }
  199. void YearForm::OnChangeEDITday()
  200. {
  201. }
  202. void YearForm::DateChange() // 与服务器交互数据;
  203. {
  204. if (m_bInit == 0)return;
  205. m_spinyear.EnableWindow(0);
  206. m_spinmonth.EnableWindow(0);
  207. m_spinday.EnableWindow(0);
  208. UpdateData();
  209. int i;
  210. int g_nYearposTemp = g_nYearpos;
  211. BOOL bLastYear = 0;
  212. BOOL bThisYear = 0;
  213. #if JEFF_TEST_ON // 2015开始禁用跨年数据;
  214. int g_nYearposPre = -1;
  215. if (m_year >= 2014 && m_year <= atoi(g_date.Left(4)) && g_hisyeararray.GetSize())
  216. {
  217. g_nYearpos = -1;
  218. bThisYear = 1;
  219. if (m_year == 2014)
  220. {
  221. g_nYearposPre = GetYearPos(m_year - 1);
  222. }
  223. }
  224. else if (m_year <= 2013 && g_hisyeararray.GetSize())
  225. {
  226. g_nYearpos = GetYearPos(m_year);
  227. if (g_nYearpos != -1)
  228. g_nYearposPre = GetYearPos(m_year - 1);
  229. bLastYear = 1;
  230. }
  231. #else
  232. if (m_year == atoi(g_date.Left(4)) && g_hisyeararray.GetSize())
  233. bThisYear = 1;
  234. else if (m_year <= atoi(g_date.Left(4)) - 1 && g_hisyeararray.GetSize())
  235. bLastYear = 1;
  236. g_nYearpos = GetYearPos(m_year);
  237. int g_nYearposPre = GetYearPos(m_year - 1);
  238. #endif
  239. g_sendhead.bsql = 0;
  240. g_sendhead.code[0] = 14; // 其它收入数据表;
  241. g_sendhead.code[1] = 13; // 支出;
  242. g_sendhead.code[2] = 16; // 订单补款视图;
  243. g_sendhead.code[3] = 198; // 其它2销录入表;
  244. g_sendhead.code[4] = 216; // 会员卡视图;
  245. g_sendhead.tabcount = 5;
  246. CString sql, strdate, strdate2;
  247. strdate.Format("%04d-%02d-%02d", m_year, 1, 1);
  248. strdate2.Format("%04d-%02d-%02d", m_year, 12, 31);
  249. CRect rc;
  250. m_static1.GetWindowRect(rc);
  251. ScreenToClient(rc);
  252. InvalidateRect(rc);
  253. m_static1.SetWindowText(strdate.Left(4) + "年财务表");
  254. sql.Format("dat>='" + strdate + "' and dat<='" + strdate2 + "' and (sale2type is null or sale2type='');dat>='" + strdate + "' and dat<='" + strdate2 + "';date>='" + strdate + "' and date<='" + strdate2 + "';date>='" + strdate + "' and date<='" + strdate2 + "';date>='" + strdate + "' and date<='" + strdate2 + "'");
  255. g_pMainWnd->ProcessChatMessageRequest2(sql);
  256. if (g_bSendOK == 0)
  257. {
  258. g_nYearpos = g_nYearposTemp;
  259. m_spinyear.EnableWindow(1);
  260. m_spinmonth.EnableWindow(1);
  261. m_spinday.EnableWindow(1);
  262. return;
  263. }
  264. DataToArray(&List2array, &List3array, &List11array, &other2salearray, &memberarray);
  265. if (bLastYear)//如果是去年, 则加今年的补款
  266. {
  267. g_nYearpos = -1;//今年
  268. g_sendhead.bsql = 0;
  269. g_sendhead.code[0] = 14; // 其它收入数据表;
  270. g_sendhead.code[1] = 13; // 支出;
  271. g_sendhead.code[2] = 16; // 订单补款视图;
  272. g_sendhead.code[3] = 198; // 其它2销录入表;
  273. g_sendhead.code[4] = 216; // 会员卡视图;
  274. g_sendhead.tabcount = 5;
  275. g_pMainWnd->ProcessChatMessageRequest2(sql);
  276. if (g_bSendOK == 0)
  277. {
  278. g_nYearpos = g_nYearposTemp;
  279. m_spinyear.EnableWindow(1);
  280. m_spinmonth.EnableWindow(1);
  281. m_spinday.EnableWindow(1);
  282. return;
  283. }
  284. CArray<CStringArray, CStringArray>ThisYearList11array;
  285. CArray<CStringArray, CStringArray>ThisYearList3array;
  286. CArray<CStringArray, CStringArray>ThisYearList2array;
  287. CArray<CStringArray, CStringArray>ThisYearother2salearray;
  288. CArray<CStringArray, CStringArray>ThisYearmemberarray;
  289. DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray, &ThisYearmemberarray);
  290. int oldsize = List11array.GetSize();
  291. List11array.SetSize(oldsize + ThisYearList11array.GetSize());
  292. for (i = oldsize; i < oldsize + ThisYearList11array.GetSize(); i++)
  293. {
  294. List11array.ElementAt(i).Copy(ThisYearList11array.ElementAt(i - oldsize));
  295. }
  296. oldsize = List3array.GetSize();
  297. List3array.SetSize(oldsize + ThisYearList3array.GetSize());
  298. for (i = oldsize; i < oldsize + ThisYearList3array.GetSize(); i++)
  299. {
  300. List3array.ElementAt(i).Copy(ThisYearList3array.ElementAt(i - oldsize));
  301. }
  302. oldsize = List2array.GetSize();
  303. List2array.SetSize(oldsize + ThisYearList2array.GetSize());
  304. for (i = oldsize; i < oldsize + ThisYearList2array.GetSize(); i++)
  305. {
  306. List2array.ElementAt(i).Copy(ThisYearList2array.ElementAt(i - oldsize));
  307. }
  308. oldsize = other2salearray.GetSize();
  309. other2salearray.SetSize(oldsize + ThisYearother2salearray.GetSize());
  310. for (i = oldsize; i < oldsize + ThisYearother2salearray.GetSize(); i++)
  311. {
  312. other2salearray.ElementAt(i).Copy(ThisYearother2salearray.ElementAt(i - oldsize));
  313. }
  314. oldsize = memberarray.GetSize();
  315. memberarray.SetSize(oldsize + ThisYearmemberarray.GetSize());
  316. for (i = oldsize; i < oldsize + ThisYearmemberarray.GetSize(); i++)
  317. {
  318. memberarray.ElementAt(i).Copy(ThisYearmemberarray.ElementAt(i - oldsize));
  319. }
  320. }
  321. if (g_nYearposPre != -1)//如果是今年, 则加去年的补款
  322. {
  323. g_nYearpos = g_nYearposPre;//去年
  324. g_sendhead.bsql = 0;
  325. g_sendhead.code[0] = 14; // 其它收入数据表;
  326. g_sendhead.code[1] = 13; // 支出;
  327. g_sendhead.code[2] = 16; // 订单补款视图;
  328. g_sendhead.code[3] = 198; // 其它2销录入表;
  329. g_sendhead.tabcount = 4;
  330. g_pMainWnd->ProcessChatMessageRequest2(sql);
  331. if (g_bSendOK == 0)
  332. {
  333. g_nYearpos = g_nYearposTemp;
  334. m_spinyear.EnableWindow(1);
  335. m_spinmonth.EnableWindow(1);
  336. m_spinday.EnableWindow(1);
  337. return;
  338. }
  339. CArray<CStringArray, CStringArray>ThisYearList11array;
  340. CArray<CStringArray, CStringArray>ThisYearList3array;
  341. CArray<CStringArray, CStringArray>ThisYearList2array;
  342. CArray<CStringArray, CStringArray>ThisYearother2salearray;
  343. DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray);
  344. int oldsize = List11array.GetSize();
  345. List11array.SetSize(oldsize + ThisYearList11array.GetSize());
  346. for (i = oldsize; i < oldsize + ThisYearList11array.GetSize(); i++)
  347. {
  348. List11array.ElementAt(i).Copy(ThisYearList11array.ElementAt(i - oldsize));
  349. }
  350. oldsize = List3array.GetSize();
  351. List3array.SetSize(oldsize + ThisYearList3array.GetSize());
  352. for (i = oldsize; i < oldsize + ThisYearList3array.GetSize(); i++)
  353. {
  354. List3array.ElementAt(i).Copy(ThisYearList3array.ElementAt(i - oldsize));
  355. }
  356. oldsize = List2array.GetSize();
  357. List2array.SetSize(oldsize + ThisYearList2array.GetSize());
  358. for (i = oldsize; i < oldsize + ThisYearList2array.GetSize(); i++)
  359. {
  360. List2array.ElementAt(i).Copy(ThisYearList2array.ElementAt(i - oldsize));
  361. }
  362. oldsize = other2salearray.GetSize();
  363. other2salearray.SetSize(oldsize + ThisYearother2salearray.GetSize());
  364. for (i = oldsize; i < oldsize + ThisYearother2salearray.GetSize(); i++)
  365. {
  366. other2salearray.ElementAt(i).Copy(ThisYearother2salearray.ElementAt(i - oldsize));
  367. }
  368. }
  369. g_nYearpos = g_nYearposTemp;
  370. KindChange();
  371. m_spinyear.EnableWindow(1);
  372. m_spinmonth.EnableWindow(1);
  373. m_spinday.EnableWindow(1);
  374. }
  375. void YearForm::KindChange()
  376. {
  377. if (m_bForKF)
  378. {
  379. KindChange2();
  380. return;
  381. }
  382. m_jdd = "";
  383. CString str;
  384. int pos = 0;
  385. int dindanshu = 0;
  386. float income = 0;
  387. float income2 = 0;
  388. float payout = 0;
  389. int count = List2array.GetSize() + List3array.GetSize() + List11array.GetSize() + other2salearray.GetSize() + memberarray.GetSize();
  390. m_List1array.RemoveAll();
  391. m_List1array.SetSize(count);
  392. int i = 0;
  393. if (m_radio1 == 3)
  394. {
  395. if (payoutdlg.GetSafeHwnd() == NULL)
  396. {
  397. payoutdlg.Create(IDD_DLGPayOutSet, this);
  398. CRect rc;
  399. m_List1.GetWindowRect(rc);
  400. payoutdlg.MoveWindow2(rc);
  401. payoutdlg.m_pParent = this;
  402. payoutdlg.m_mode = 1;
  403. }
  404. payoutdlg.ShowWindow(SW_SHOW);
  405. }
  406. else
  407. {
  408. m_filter.Empty();
  409. if (payoutdlg.GetSafeHwnd())payoutdlg.ShowWindow(SW_HIDE);
  410. }
  411. for (i = 0; i < memberarray.GetSize(); i++)
  412. {
  413. if (memberarray.ElementAt(i).ElementAt(6).IsEmpty())
  414. memberarray.ElementAt(i).SetAt(6, "未审核");
  415. memberarray.ElementAt(i).SetAt(0, memberarray.ElementAt(i).ElementAt(0) + ":4");
  416. }
  417. for (i = 0; i < List2array.GetSize(); i++)
  418. {
  419. if (List2array.ElementAt(i).ElementAt(10).IsEmpty())
  420. List2array.ElementAt(i).SetAt(10, "未审核");
  421. List2array.ElementAt(i).SetAt(0, List2array.ElementAt(i).ElementAt(0) + ":0");
  422. }
  423. for (i = 0; i < List3array.GetSize(); i++)
  424. {
  425. if (List3array.ElementAt(i).ElementAt(7).IsEmpty())
  426. List3array.ElementAt(i).SetAt(7, "未审核");
  427. List3array.ElementAt(i).SetAt(0, List3array.ElementAt(i).ElementAt(0) + ":1");
  428. }
  429. for (i = 0; i < List11array.GetSize(); i++)
  430. {
  431. if (List11array.ElementAt(i).ElementAt(11).IsEmpty())
  432. List11array.ElementAt(i).SetAt(11, "未审核");
  433. List11array.ElementAt(i).SetAt(10, List11array.ElementAt(i).ElementAt(10) + ":2");
  434. }
  435. for (i = 0; i < other2salearray.GetSize(); i++)
  436. {
  437. if (other2salearray.ElementAt(i).ElementAt(9).IsEmpty())
  438. other2salearray.ElementAt(i).SetAt(9, "未审核");
  439. other2salearray.ElementAt(i).SetAt(8, other2salearray.ElementAt(i).ElementAt(8) + ":3");
  440. }
  441. if (m_radio1 == 0)
  442. {
  443. for (i = 0; i < List11array.GetSize(); i++)
  444. {
  445. #ifdef DDF_VERSION
  446. if(List11array.ElementAt (i).ElementAt (5)=="客服二销")continue;
  447. #endif
  448. str = List11array.ElementAt(i).ElementAt(0);
  449. str += ";" + List11array.ElementAt(i).ElementAt(3);
  450. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  451. {
  452. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  453. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  454. str += "," + List11array.ElementAt(i).ElementAt(2);
  455. }
  456. else
  457. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  458. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  459. m_List1array.ElementAt(pos).Add(str);
  460. str = List11array.ElementAt(i).ElementAt(4);
  461. m_List1array.ElementAt(pos).Add(str);
  462. #if 0
  463. income+=atof(str);
  464. income2+=atof(str);
  465. #else
  466. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  467. {
  468. income += atof(str);
  469. }
  470. income2 += atof(str);
  471. #endif
  472. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  473. m_List1array.ElementAt(pos).Add("收入");
  474. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  475. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  476. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  477. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  478. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  479. if (List11array.ElementAt(i).ElementAt(5) == "预约收款")
  480. dindanshu++;
  481. pos++;
  482. }
  483. for (i = 0; i < List2array.GetSize(); i++)
  484. {
  485. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  486. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  487. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  488. str.Replace(";;;", ";"); str.Replace(";;", ";");
  489. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  490. m_List1array.ElementAt(pos).Add(str);
  491. str = List2array.ElementAt(i).ElementAt(2);
  492. m_List1array.ElementAt(pos).Add(str);
  493. #if 0
  494. income+=atof(str);
  495. #else
  496. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  497. {
  498. income += atof(str);
  499. }
  500. #endif
  501. if (List2array.ElementAt(i).ElementAt(8) != "")
  502. {
  503. income2 += atof(str);
  504. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  505. }
  506. else
  507. m_List1array.ElementAt(pos).Add("其它收入");
  508. m_List1array.ElementAt(pos).Add("收入");
  509. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  510. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  511. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  512. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  513. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(12));
  514. pos++;
  515. }
  516. for (i = 0; i < other2salearray.GetSize(); i++)
  517. {
  518. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  519. str.Replace(";;;", ";"); str.Replace(";;", ";");
  520. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  521. m_List1array.ElementAt(pos).Add(str);
  522. str = other2salearray.ElementAt(i).ElementAt(4);
  523. m_List1array.ElementAt(pos).Add(str);
  524. #if 0
  525. income+=atof(str);
  526. income2+=atof(str);
  527. #else
  528. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  529. {
  530. income += atof(str);
  531. }
  532. income2 += atof(str);
  533. #endif
  534. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  535. m_List1array.ElementAt(pos).Add("收入");
  536. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  537. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  538. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  539. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  540. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  541. pos++;
  542. }
  543. for (i = 0; i < List3array.GetSize(); i++)
  544. {
  545. if (List3array.ElementAt(i).ElementAt(6).GetLength()>120)
  546. List3array.ElementAt(i).SetAt(6, List3array.ElementAt(i).ElementAt(6).Left(120) + "..");
  547. str = List3array.ElementAt(i).ElementAt(1) + ";" + List3array.ElementAt(i).ElementAt(4) + ";" + List3array.ElementAt(i).ElementAt(6);
  548. str.Replace(";;;;", ";"); str.Replace(";;;", ";"); str.Replace(";;", ";");
  549. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(0));
  550. m_List1array.ElementAt(pos).Add(str);
  551. str = List3array.ElementAt(i).ElementAt(2);
  552. m_List1array.ElementAt(pos).Add(str);
  553. payout += atof(str);
  554. #if JEFF_TEST_ON
  555. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(1));
  556. #else
  557. m_List1array.ElementAt(pos).Add("固定费用");
  558. #endif
  559. m_List1array.ElementAt(pos).Add("支出");
  560. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(3) + " " + List3array.ElementAt(i).ElementAt(8));
  561. m_List1array.ElementAt(pos).Add("现金");
  562. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(5));
  563. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(7));
  564. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(12));
  565. pos++;
  566. }
  567. for (i = 0; i < memberarray.GetSize(); i++)
  568. {
  569. str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";客户:" + memberarray.ElementAt(i).ElementAt(2);
  570. str.Replace(";;;", ";"); str.Replace(";;", ";");
  571. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
  572. m_List1array.ElementAt(pos).Add(str);
  573. str = memberarray.ElementAt(i).ElementAt(3);
  574. m_List1array.ElementAt(pos).Add(str);
  575. income += atof(str);
  576. m_List1array.ElementAt(pos).Add("会员充值");
  577. m_List1array.ElementAt(pos).Add("收入");
  578. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));
  579. if (memberarray.ElementAt(i).ElementAt(7) == "")
  580. m_List1array.ElementAt(pos).Add("现金");
  581. else
  582. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));
  583. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
  584. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
  585. m_List1array.ElementAt(pos).Add(" ");
  586. pos++;
  587. }
  588. }
  589. else if (m_radio1 == 1)//收入
  590. {
  591. for (i = 0; i < List11array.GetSize(); i++)
  592. {
  593. #ifdef DDF_VERSION
  594. if(List11array.ElementAt (i).ElementAt (5)=="客服二销")continue;
  595. #endif
  596. str = List11array.ElementAt(i).ElementAt(0);
  597. str += ";" + List11array.ElementAt(i).ElementAt(3);
  598. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  599. {
  600. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  601. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  602. str += "," + List11array.ElementAt(i).ElementAt(2);
  603. }
  604. else
  605. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  606. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  607. m_List1array.ElementAt(pos).Add(str);
  608. str = List11array.ElementAt(i).ElementAt(4);
  609. m_List1array.ElementAt(pos).Add(str);
  610. #if 0
  611. income+=atof(str);
  612. income2+=atof(str);
  613. #else
  614. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  615. {
  616. income += atof(str);
  617. }
  618. income2 += atof(str);
  619. #endif
  620. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  621. m_List1array.ElementAt(pos).Add("收入");
  622. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  623. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  624. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  625. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  626. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  627. if (List11array.ElementAt(i).ElementAt(5) == "预约收款")
  628. dindanshu++;
  629. pos++;
  630. }
  631. for (i = 0; i < List2array.GetSize(); i++)
  632. {
  633. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  634. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  635. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  636. str.Replace(";;;", ";"); str.Replace(";;", ";");
  637. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  638. m_List1array.ElementAt(pos).Add(str);
  639. str = List2array.ElementAt(i).ElementAt(2);
  640. m_List1array.ElementAt(pos).Add(str);
  641. #if 0
  642. income+=atof(str);
  643. #else
  644. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  645. {
  646. income += atof(str);
  647. }
  648. #endif
  649. if (List2array.ElementAt(i).ElementAt(8) != "")
  650. {
  651. income2 += atof(str);
  652. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  653. }
  654. else
  655. m_List1array.ElementAt(pos).Add("其它收入");
  656. m_List1array.ElementAt(pos).Add("收入");
  657. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  658. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  659. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  660. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  661. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(12));
  662. pos++;
  663. }
  664. for (i = 0; i < other2salearray.GetSize(); i++)
  665. {
  666. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  667. str.Replace(";;;", ";"); str.Replace(";;", ";");
  668. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  669. m_List1array.ElementAt(pos).Add(str);
  670. str = other2salearray.ElementAt(i).ElementAt(4);
  671. m_List1array.ElementAt(pos).Add(str);
  672. #if 0
  673. income+=atof(str);
  674. income2+=atof(str);
  675. #else
  676. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  677. {
  678. income += atof(str);
  679. }
  680. income2 += atof(str);
  681. #endif
  682. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  683. m_List1array.ElementAt(pos).Add("收入");
  684. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  685. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  686. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  687. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  688. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  689. pos++;
  690. }
  691. for (i = 0; i < memberarray.GetSize(); i++)
  692. {
  693. str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";客户:" + memberarray.ElementAt(i).ElementAt(2);
  694. str.Replace(";;;", ";"); str.Replace(";;", ";");
  695. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
  696. m_List1array.ElementAt(pos).Add(str);
  697. str = memberarray.ElementAt(i).ElementAt(3);
  698. m_List1array.ElementAt(pos).Add(str);
  699. income += atof(str);
  700. m_List1array.ElementAt(pos).Add("会员充值");
  701. m_List1array.ElementAt(pos).Add("收入");
  702. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));
  703. if (memberarray.ElementAt(i).ElementAt(7) == "")
  704. m_List1array.ElementAt(pos).Add("现金");
  705. else
  706. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));
  707. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
  708. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
  709. m_List1array.ElementAt(pos).Add(" ");
  710. pos++;
  711. }
  712. }
  713. else if (m_radio1 == 2)//营业收入
  714. {
  715. for (i = 0; i < List11array.GetSize(); i++)
  716. {
  717. #ifdef DDF_VERSION
  718. if(List11array.ElementAt (i).ElementAt (5)=="客服二销")continue;
  719. #endif
  720. str = List11array.ElementAt(i).ElementAt(0);
  721. str += ";" + List11array.ElementAt(i).ElementAt(3);
  722. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  723. {
  724. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  725. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  726. str += "," + List11array.ElementAt(i).ElementAt(2);
  727. }
  728. else
  729. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  730. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  731. m_List1array.ElementAt(pos).Add(str);
  732. str = List11array.ElementAt(i).ElementAt(4);
  733. m_List1array.ElementAt(pos).Add(str);
  734. #if 0
  735. income+=atof(str);
  736. income2+=atof(str);
  737. #else
  738. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  739. {
  740. income += atof(str);
  741. }
  742. income2 += atof(str);
  743. #endif
  744. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  745. m_List1array.ElementAt(pos).Add("收入");
  746. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  747. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  748. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  749. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  750. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  751. if (List11array.ElementAt(i).ElementAt(5) == "预约收款")
  752. dindanshu++;
  753. pos++;
  754. }
  755. for (i = 0; i < List2array.GetSize(); i++)
  756. {
  757. if (List2array.ElementAt(i).ElementAt(8) != "")
  758. {
  759. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  760. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  761. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  762. str.Replace(";;;", ";"); str.Replace(";;", ";");
  763. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  764. m_List1array.ElementAt(pos).Add(str);
  765. str = List2array.ElementAt(i).ElementAt(2);
  766. m_List1array.ElementAt(pos).Add(str);
  767. #if 0
  768. income+=atof(str);
  769. income2+=atof(str);
  770. #else
  771. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  772. {
  773. income += atof(str);
  774. }
  775. income2 += atof(str);
  776. #endif
  777. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  778. m_List1array.ElementAt(pos).Add("收入");
  779. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  780. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  781. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  782. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  783. m_List1array.ElementAt(pos).Add(" ");
  784. pos++;
  785. }
  786. }
  787. for (i = 0; i < other2salearray.GetSize(); i++)
  788. {
  789. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  790. str.Replace(";;;", ";"); str.Replace(";;", ";");
  791. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  792. m_List1array.ElementAt(pos).Add(str);
  793. str = other2salearray.ElementAt(i).ElementAt(4);
  794. m_List1array.ElementAt(pos).Add(str);
  795. #if 0
  796. income+=atof(str);
  797. income2+=atof(str);
  798. #else
  799. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  800. {
  801. income += atof(str);
  802. }
  803. income2 += atof(str);
  804. #endif
  805. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  806. m_List1array.ElementAt(pos).Add("收入");
  807. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  808. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  809. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  810. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  811. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  812. pos++;
  813. }
  814. }
  815. else if (m_radio1 == 3)//支出
  816. {
  817. for (i = 0; i < List3array.GetSize(); i++)
  818. {
  819. if (List3array.ElementAt(i).ElementAt(6).GetLength()>120)
  820. List3array.ElementAt(i).SetAt(6, List3array.ElementAt(i).ElementAt(6).Left(120) + "..");
  821. str = List3array.ElementAt(i).ElementAt(1) + ";" + List3array.ElementAt(i).ElementAt(4) + ";" + List3array.ElementAt(i).ElementAt(6);
  822. str.Replace(";;;;", ";"); str.Replace(";;;", ";"); str.Replace(";;", ";");
  823. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(0));
  824. m_List1array.ElementAt(pos).Add(str);
  825. str = List3array.ElementAt(i).ElementAt(2);
  826. m_List1array.ElementAt(pos).Add(str);
  827. payout += atof(str);
  828. #if JEFF_TEST_ON
  829. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(1));
  830. #else
  831. m_List1array.ElementAt(pos).Add("固定费用");
  832. #endif
  833. m_List1array.ElementAt(pos).Add("支出");
  834. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(3) + " " + List3array.ElementAt(i).ElementAt(8));
  835. m_List1array.ElementAt(pos).Add("现金");
  836. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(5));
  837. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(7));
  838. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(12));
  839. pos++;
  840. }
  841. }
  842. else if (m_radio1 == 4)//定单
  843. {
  844. for (i = 0; i < List11array.GetSize(); i++)
  845. {
  846. if (List11array.ElementAt(i).ElementAt(5) != "预约收款")continue;
  847. dindanshu++;
  848. str = List11array.ElementAt(i).ElementAt(0);
  849. str += ";" + List11array.ElementAt(i).ElementAt(3);
  850. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  851. {
  852. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  853. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  854. str += "," + List11array.ElementAt(i).ElementAt(2);
  855. }
  856. else
  857. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  858. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  859. m_List1array.ElementAt(pos).Add(str);
  860. str = List11array.ElementAt(i).ElementAt(4);
  861. m_List1array.ElementAt(pos).Add(str);
  862. #if 0
  863. income+=atof(str);
  864. income2+=atof(str);
  865. #else
  866. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  867. {
  868. income += atof(str);
  869. }
  870. income2 += atof(str);
  871. #endif
  872. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  873. m_List1array.ElementAt(pos).Add("收入");
  874. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  875. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  876. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  877. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  878. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  879. pos++;
  880. }
  881. }
  882. else if (m_radio1 == 5)//补款
  883. {
  884. for (i = 0; i < List11array.GetSize(); i++)
  885. {
  886. if (List11array.ElementAt(i).ElementAt(5) != "预约补款")continue;
  887. str = List11array.ElementAt(i).ElementAt(0);
  888. str += ";" + List11array.ElementAt(i).ElementAt(3);
  889. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  890. {
  891. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  892. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  893. str += "," + List11array.ElementAt(i).ElementAt(2);
  894. }
  895. else
  896. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  897. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  898. m_List1array.ElementAt(pos).Add(str);
  899. str = List11array.ElementAt(i).ElementAt(4);
  900. m_List1array.ElementAt(pos).Add(str);
  901. #if 0
  902. income+=atof(str);
  903. income2+=atof(str);
  904. #else
  905. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  906. {
  907. income += atof(str);
  908. }
  909. income2 += atof(str);
  910. #endif
  911. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  912. m_List1array.ElementAt(pos).Add("收入");
  913. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  914. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  915. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  916. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  917. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  918. pos++;
  919. }
  920. }
  921. else if (m_radio1 == 6)//摄影二销
  922. {
  923. for (i = 0; i < List11array.GetSize(); i++)
  924. {
  925. if (List11array.ElementAt(i).ElementAt(5) != "摄影二销")continue;
  926. str = List11array.ElementAt(i).ElementAt(0);
  927. str += ";" + List11array.ElementAt(i).ElementAt(3);
  928. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  929. {
  930. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  931. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  932. str += "," + List11array.ElementAt(i).ElementAt(2);
  933. }
  934. else
  935. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  936. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  937. m_List1array.ElementAt(pos).Add(str);
  938. str = List11array.ElementAt(i).ElementAt(4);
  939. m_List1array.ElementAt(pos).Add(str);
  940. #if 0
  941. income+=atof(str);
  942. income2+=atof(str);
  943. #else
  944. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  945. {
  946. income += atof(str);
  947. }
  948. income2 += atof(str);
  949. #endif
  950. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  951. m_List1array.ElementAt(pos).Add("收入");
  952. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  953. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  954. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  955. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  956. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  957. pos++;
  958. }
  959. for (i = 0; i < List2array.GetSize(); i++)
  960. {
  961. if (List2array.ElementAt(i).ElementAt(8) == "摄影二销")
  962. {
  963. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  964. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  965. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  966. str.Replace(";;;", ";"); str.Replace(";;", ";");
  967. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  968. m_List1array.ElementAt(pos).Add(str);
  969. str = List2array.ElementAt(i).ElementAt(2);
  970. m_List1array.ElementAt(pos).Add(str);
  971. #if 0
  972. income+=atof(str);
  973. income2+=atof(str);
  974. #else
  975. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(8) != "代金券")
  976. {
  977. income += atof(str);
  978. }
  979. income2 += atof(str);
  980. #endif
  981. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  982. m_List1array.ElementAt(pos).Add("收入");
  983. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  984. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  985. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  986. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  987. m_List1array.ElementAt(pos).Add(" ");
  988. pos++;
  989. }
  990. }
  991. for (i = 0; i < other2salearray.GetSize(); i++)
  992. {
  993. if (other2salearray.ElementAt(i).ElementAt(3) == "摄影二销")
  994. {
  995. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  996. str.Replace(";;;", ";"); str.Replace(";;", ";");
  997. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  998. m_List1array.ElementAt(pos).Add(str);
  999. str = other2salearray.ElementAt(i).ElementAt(4);
  1000. m_List1array.ElementAt(pos).Add(str);
  1001. #if 0
  1002. income+=atof(str);
  1003. income2+=atof(str);
  1004. #else
  1005. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  1006. {
  1007. income += atof(str);
  1008. }
  1009. income2 += atof(str);
  1010. #endif
  1011. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1012. m_List1array.ElementAt(pos).Add("收入");
  1013. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1014. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1015. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1016. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1017. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1018. pos++;
  1019. }
  1020. }
  1021. }
  1022. else if (m_radio1 == 7)//化妆二销
  1023. {
  1024. for (i = 0; i < List11array.GetSize(); i++)
  1025. {
  1026. #ifndef CHILD_VERSION
  1027. if (List11array.ElementAt(i).ElementAt(5) != "化妆二销")continue;
  1028. #else
  1029. if (List11array.ElementAt(i).ElementAt(5) != "引导二销")continue;//"引导二销"
  1030. #endif
  1031. str = List11array.ElementAt(i).ElementAt(0);
  1032. str += ";" + List11array.ElementAt(i).ElementAt(3);
  1033. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  1034. {
  1035. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  1036. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  1037. str += "," + List11array.ElementAt(i).ElementAt(2);
  1038. }
  1039. else
  1040. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  1041. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  1042. m_List1array.ElementAt(pos).Add(str);
  1043. str = List11array.ElementAt(i).ElementAt(4);
  1044. m_List1array.ElementAt(pos).Add(str);
  1045. #if 0
  1046. income+=atof(str);
  1047. income2+=atof(str);
  1048. #else
  1049. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  1050. {
  1051. income += atof(str);
  1052. }
  1053. income2 += atof(str);
  1054. #endif
  1055. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  1056. m_List1array.ElementAt(pos).Add("收入");
  1057. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  1058. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  1059. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  1060. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  1061. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  1062. pos++;
  1063. }
  1064. for (i = 0; i < List2array.GetSize(); i++)
  1065. {
  1066. #ifndef CHILD_VERSION
  1067. if (List2array.ElementAt(i).ElementAt(8) == "化妆二销")
  1068. #else
  1069. if (List2array.ElementAt(i).ElementAt(8) == "引导二销")//"引导二销"
  1070. #endif
  1071. {
  1072. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  1073. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  1074. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  1075. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1076. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  1077. m_List1array.ElementAt(pos).Add(str);
  1078. str = List2array.ElementAt(i).ElementAt(2);
  1079. m_List1array.ElementAt(pos).Add(str);
  1080. #if 0
  1081. income+=atof(str);
  1082. income2+=atof(str);
  1083. #else
  1084. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  1085. {
  1086. income += atof(str);
  1087. }
  1088. income2 += atof(str);
  1089. #endif
  1090. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  1091. m_List1array.ElementAt(pos).Add("收入");
  1092. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  1093. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  1094. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  1095. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  1096. m_List1array.ElementAt(pos).Add(" ");
  1097. pos++;
  1098. }
  1099. }
  1100. for (i = 0; i < other2salearray.GetSize(); i++)
  1101. {
  1102. #ifndef CHILD_VERSION
  1103. if (other2salearray.ElementAt(i).ElementAt(3) == "化妆二销")
  1104. #else
  1105. if (other2salearray.ElementAt(i).ElementAt(3) == "引导二销")//"引导二销"
  1106. #endif
  1107. {
  1108. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  1109. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1110. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  1111. m_List1array.ElementAt(pos).Add(str);
  1112. str = other2salearray.ElementAt(i).ElementAt(4);
  1113. m_List1array.ElementAt(pos).Add(str);
  1114. #if 0
  1115. income+=atof(str);
  1116. income2+=atof(str);
  1117. #else
  1118. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  1119. {
  1120. income += atof(str);
  1121. }
  1122. income2 += atof(str);
  1123. #endif
  1124. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1125. m_List1array.ElementAt(pos).Add("收入");
  1126. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1127. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1128. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1129. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1130. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1131. pos++;
  1132. }
  1133. }
  1134. }
  1135. else if (m_radio1 == 8)//套系升级二销
  1136. {
  1137. for (i = 0; i < memberarray.GetSize(); i++)
  1138. {
  1139. str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";客户:" + memberarray.ElementAt(i).ElementAt(2);
  1140. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1141. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
  1142. m_List1array.ElementAt(pos).Add(str);
  1143. str = memberarray.ElementAt(i).ElementAt(3);
  1144. m_List1array.ElementAt(pos).Add(str);
  1145. income += atof(str);
  1146. m_List1array.ElementAt(pos).Add("会员充值");
  1147. m_List1array.ElementAt(pos).Add("收入");
  1148. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));
  1149. if (memberarray.ElementAt(i).ElementAt(7) == "")
  1150. m_List1array.ElementAt(pos).Add("现金");
  1151. else
  1152. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));
  1153. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
  1154. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
  1155. m_List1array.ElementAt(pos).Add(" ");
  1156. pos++;
  1157. }
  1158. }
  1159. else if (m_radio1 == 9)//选片加挑
  1160. {
  1161. for (i = 0; i < List11array.GetSize(); i++)
  1162. {
  1163. if (List11array.ElementAt(i).ElementAt(5) != "选片二销")continue;
  1164. str = List11array.ElementAt(i).ElementAt(0);
  1165. str += ";" + List11array.ElementAt(i).ElementAt(3);
  1166. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  1167. {
  1168. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  1169. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  1170. str += "," + List11array.ElementAt(i).ElementAt(2);
  1171. }
  1172. else
  1173. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  1174. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  1175. m_List1array.ElementAt(pos).Add(str);
  1176. str = List11array.ElementAt(i).ElementAt(4);
  1177. m_List1array.ElementAt(pos).Add(str);
  1178. #if 0
  1179. income+=atof(str);
  1180. income2+=atof(str);
  1181. #else
  1182. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  1183. {
  1184. income += atof(str);
  1185. }
  1186. income2 += atof(str);
  1187. #endif
  1188. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  1189. m_List1array.ElementAt(pos).Add("收入");
  1190. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  1191. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  1192. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  1193. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  1194. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  1195. pos++;
  1196. }
  1197. for (i = 0; i < List2array.GetSize(); i++)
  1198. {
  1199. if (List2array.ElementAt(i).ElementAt(8) == "选片二销")
  1200. {
  1201. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  1202. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  1203. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  1204. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1205. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  1206. m_List1array.ElementAt(pos).Add(str);
  1207. str = List2array.ElementAt(i).ElementAt(2);
  1208. m_List1array.ElementAt(pos).Add(str);
  1209. #if 0
  1210. income+=atof(str);
  1211. income2+=atof(str);
  1212. #else
  1213. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  1214. {
  1215. income += atof(str);
  1216. }
  1217. income2 += atof(str);
  1218. #endif
  1219. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  1220. m_List1array.ElementAt(pos).Add("收入");
  1221. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  1222. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  1223. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  1224. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  1225. m_List1array.ElementAt(pos).Add(" ");
  1226. pos++;
  1227. }
  1228. }
  1229. for (i = 0; i < other2salearray.GetSize(); i++)
  1230. {
  1231. if (other2salearray.ElementAt(i).ElementAt(3) == "选片二销")
  1232. {
  1233. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  1234. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1235. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  1236. m_List1array.ElementAt(pos).Add(str);
  1237. str = other2salearray.ElementAt(i).ElementAt(4);
  1238. m_List1array.ElementAt(pos).Add(str);
  1239. #if 0
  1240. income+=atof(str);
  1241. income2+=atof(str);
  1242. #else
  1243. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  1244. {
  1245. income += atof(str);
  1246. }
  1247. income2 += atof(str);
  1248. #endif
  1249. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1250. m_List1array.ElementAt(pos).Add("收入");
  1251. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1252. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1253. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1254. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1255. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1256. pos++;
  1257. }
  1258. }
  1259. }
  1260. else if (m_radio1 == 10)//其它收入
  1261. {
  1262. for (i = 0; i < List2array.GetSize(); i++)
  1263. {
  1264. if (List2array.ElementAt(i).ElementAt(8) != "")continue;
  1265. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  1266. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  1267. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  1268. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1269. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  1270. m_List1array.ElementAt(pos).Add(str);
  1271. str = List2array.ElementAt(i).ElementAt(2);
  1272. m_List1array.ElementAt(pos).Add(str);
  1273. #if 0
  1274. income+=atof(str);
  1275. #else
  1276. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  1277. {
  1278. income += atof(str);
  1279. }
  1280. #endif
  1281. m_List1array.ElementAt(pos).Add("其它收入");
  1282. m_List1array.ElementAt(pos).Add("收入");
  1283. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  1284. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  1285. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  1286. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  1287. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(12));
  1288. pos++;
  1289. }
  1290. }
  1291. else if (m_radio1 == 11)//其它二销
  1292. {
  1293. for (i = 0; i < other2salearray.GetSize(); i++)
  1294. {
  1295. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  1296. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1297. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  1298. m_List1array.ElementAt(pos).Add(str);
  1299. str = other2salearray.ElementAt(i).ElementAt(4);
  1300. m_List1array.ElementAt(pos).Add(str);
  1301. #if 0
  1302. income+=atof(str);
  1303. income2+=atof(str);
  1304. #else
  1305. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  1306. {
  1307. income += atof(str);
  1308. }
  1309. income2 += atof(str);
  1310. #endif
  1311. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1312. m_List1array.ElementAt(pos).Add("收入");
  1313. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1314. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1315. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1316. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1317. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1318. pos++;
  1319. }
  1320. }
  1321. m_List1array.SetSize(pos);
  1322. str.Format("%0.2f", income);
  1323. ::ConvertToPrice(str);
  1324. SetDlgItemText(IDC_EDITmoney1, str);
  1325. str.Format("%0.2f", income2);
  1326. ::ConvertToPrice(str);
  1327. SetDlgItemText(IDC_EDITmoney5, str);
  1328. str.Format("%0.2f", payout);
  1329. ::ConvertToPrice(str);
  1330. SetDlgItemText(IDC_EDITmoney2, str);
  1331. str.Format("%0.2f", income - payout);
  1332. ::ConvertToPrice(str);
  1333. SetDlgItemText(IDC_EDITmoney3, str);
  1334. str.Format("%d", dindanshu);
  1335. SetDlgItemText(IDC_EDITmoney4, str);
  1336. FillGrid();
  1337. PaymentMethodCount();
  1338. }
  1339. void YearForm::OnRadio3()
  1340. {
  1341. UpdateData();
  1342. KindChange();
  1343. }
  1344. void YearForm::OnRadio4()
  1345. {
  1346. UpdateData();
  1347. KindChange();
  1348. }
  1349. void YearForm::OnRadio5()
  1350. {
  1351. UpdateData();
  1352. KindChange();
  1353. }
  1354. void YearForm::OnRadio6()
  1355. {
  1356. UpdateData();
  1357. m_filter.Empty();
  1358. KindChange();
  1359. }
  1360. void YearForm::OnRadio7()
  1361. {
  1362. UpdateData();
  1363. KindChange();
  1364. }
  1365. void YearForm::OnRadio8()
  1366. {
  1367. UpdateData();
  1368. KindChange();
  1369. }
  1370. void YearForm::OnRadio9()
  1371. {
  1372. UpdateData();
  1373. KindChange();
  1374. }
  1375. void YearForm::OnRadio10()
  1376. {
  1377. UpdateData();
  1378. KindChange();
  1379. }
  1380. void YearForm::OnRadio11()
  1381. {
  1382. UpdateData();
  1383. KindChange();
  1384. }
  1385. void YearForm::OnRadio12()
  1386. {
  1387. UpdateData();
  1388. KindChange();
  1389. }
  1390. void YearForm::OnRadio13()
  1391. {
  1392. UpdateData();
  1393. KindChange();
  1394. }
  1395. void YearForm::OnBUTprint()
  1396. {
  1397. if (m_List1.GetItemCount() == 0)
  1398. {
  1399. AfxMessageBox("无内容!", MB_ICONINFORMATION);
  1400. return;
  1401. }
  1402. CArray<CStringArray, CStringArray>Listarray;
  1403. CString str, temp;
  1404. m_static1.GetWindowText(str);
  1405. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + str;
  1406. int count = m_List1.GetItemCount() / 45;
  1407. if (m_List1.GetItemCount() % 45)count++;
  1408. Listarray.SetSize(m_List1.GetItemCount() + count, 1);
  1409. int pos = 0;
  1410. float otherpaytype1 = 0;
  1411. float otherpaytype2 = 0;
  1412. float otherpaytype3 = 0;
  1413. int addpos = 1;
  1414. for (int i = 0; i < m_List1.GetItemCount(); i++)
  1415. {
  1416. if (i % 45 == 0)
  1417. {
  1418. Listarray.ElementAt(pos).Add("项目名称");
  1419. Listarray.ElementAt(pos).Add("金额");
  1420. Listarray.ElementAt(pos).Add("项目类别");
  1421. Listarray.ElementAt(pos).Add("收入/支出");
  1422. pos++;
  1423. }
  1424. for (int j = 0; j < 3; j++)
  1425. Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, j + addpos));
  1426. Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 3 + addpos) + "/" + m_List1.GetItemText(i, 5 + addpos));
  1427. if (m_List1.GetItemText(i, 5 + addpos) == "POS机刷卡")
  1428. otherpaytype1 += atof(m_List1.GetItemText(i, 1 + addpos));
  1429. else if (m_List1.GetItemText(i, 5 + addpos) == "储值卡扣款")
  1430. otherpaytype2 += atof(m_List1.GetItemText(i, 1 + addpos));
  1431. else if (m_List1.GetItemText(i, 5 + addpos) == "积分兑换")
  1432. otherpaytype3 += atof(m_List1.GetItemText(i, 1 + addpos));
  1433. pos++;
  1434. }
  1435. Listarray.SetSize(pos, 1);
  1436. str = "总收入:";
  1437. GetDlgItemText(IDC_EDITmoney1, temp); str += temp;
  1438. str += " 营业收入:";
  1439. GetDlgItemText(IDC_EDITmoney5, temp); str += temp;
  1440. str += " 总支出:";
  1441. GetDlgItemText(IDC_EDITmoney2, temp); str += temp;
  1442. str += " 净收入:";
  1443. GetDlgItemText(IDC_EDITmoney3, temp); str += temp;
  1444. str += " 定单数:";
  1445. GetDlgItemText(IDC_EDITmoney4, temp); str += temp;
  1446. str += "***";
  1447. temp.Format("POS机刷卡:%d", (int)otherpaytype1);
  1448. str += temp;
  1449. temp.Format(" 储值卡扣款:%d", (int)otherpaytype2);
  1450. str += temp;
  1451. temp.Format(" 积分兑换:%d", (int)otherpaytype3);
  1452. str += temp;
  1453. CString ss;
  1454. GetDlgItemText(IDC_EDITmoney3, ss);
  1455. //temp.Format (" 现金:%d", (int) (atof(ss)-(otherpaytype1+otherpaytype2+otherpaytype3)) );
  1456. temp.Format(" 柜台现金:%d", (int)(atof(ss) - (otherpaytype1 + otherpaytype3)));
  1457. str += temp;
  1458. g_pMainWnd->PrintDailyForm(&Listarray, title, str);
  1459. }
  1460. void YearForm::TypeChange(CString str)
  1461. {
  1462. m_filter = str;
  1463. FillGrid();
  1464. PaymentMethodCount();
  1465. }
  1466. void YearForm::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
  1467. {
  1468. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  1469. *pResult = 0;
  1470. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  1471. {
  1472. *pResult = CDRF_NOTIFYITEMDRAW;
  1473. }
  1474. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  1475. {
  1476. if (m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8).Find("已审核") == -1)
  1477. pLVCD->clrText = RGB(220, 0, 0);
  1478. else
  1479. pLVCD->clrText = RGB(20, 133, 20);
  1480. if (pLVCD->nmcd.dwItemSpec % 2)
  1481. pLVCD->clrTextBk = g_gridcol1;
  1482. else
  1483. pLVCD->clrTextBk = g_gridcol2;
  1484. *pResult = CDRF_DODEFAULT;
  1485. }
  1486. }
  1487. void YearForm::OnBUTprint5()
  1488. {
  1489. CString str;
  1490. m_static1.GetWindowText(str);
  1491. ListToXLS(&m_List1, "c:\\" + str + ".xls", 1);
  1492. }
  1493. void YearForm::OnBUTprint4()
  1494. {
  1495. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  1496. {
  1497. SelExpendType dlg;
  1498. dlg.m_mode = 3;
  1499. if (dlg.DoModal() == IDOK)
  1500. {
  1501. m_jdd = dlg.m_sel;
  1502. FillGrid();
  1503. PaymentMethodCount();
  1504. }
  1505. }
  1506. }
  1507. void YearForm::OnRadio14()
  1508. {
  1509. UpdateData();
  1510. if (m_radio2 == 0)m_bForKF = 0;
  1511. else
  1512. {
  1513. m_bForKF = 1;
  1514. }
  1515. KindChange();
  1516. }
  1517. void YearForm::OnRadio15()
  1518. {
  1519. OnRadio14();
  1520. }
  1521. void YearForm::OnRadio16()
  1522. {
  1523. UpdateData();
  1524. KindChange();
  1525. }
  1526. void YearForm::KindChange2()
  1527. {
  1528. m_jdd = "";
  1529. CString str;
  1530. int pos = 0;
  1531. int dindanshu = 0;
  1532. float income = 0;
  1533. float income2 = 0;
  1534. float payout = 0;
  1535. int count = List2array.GetSize() + List3array.GetSize() + List11array.GetSize() + other2salearray.GetSize() + memberarray.GetSize();
  1536. m_List1array.RemoveAll();
  1537. m_List1array.SetSize(count);
  1538. int i = 0;
  1539. {
  1540. m_filter.Empty();
  1541. if (payoutdlg.GetSafeHwnd())payoutdlg.ShowWindow(SW_HIDE);
  1542. }
  1543. for (i = 0; i < memberarray.GetSize(); i++)
  1544. {
  1545. if (memberarray.ElementAt(i).ElementAt(6).IsEmpty())
  1546. memberarray.ElementAt(i).SetAt(6, "未审核");
  1547. memberarray.ElementAt(i).SetAt(0, memberarray.ElementAt(i).ElementAt(0) + ":4");
  1548. }
  1549. for (i = 0; i < List2array.GetSize(); i++)
  1550. {
  1551. if (List2array.ElementAt(i).ElementAt(10).IsEmpty())
  1552. List2array.ElementAt(i).SetAt(10, "未审核");
  1553. List2array.ElementAt(i).SetAt(0, List2array.ElementAt(i).ElementAt(0) + ":0");
  1554. }
  1555. for (i = 0; i < List3array.GetSize(); i++)
  1556. {
  1557. if (List3array.ElementAt(i).ElementAt(7).IsEmpty())
  1558. List3array.ElementAt(i).SetAt(7, "未审核");
  1559. List3array.ElementAt(i).SetAt(0, List3array.ElementAt(i).ElementAt(0) + ":1");
  1560. }
  1561. for (i = 0; i < List11array.GetSize(); i++)
  1562. {
  1563. if (List11array.ElementAt(i).ElementAt(11).IsEmpty())
  1564. List11array.ElementAt(i).SetAt(11, "未审核");
  1565. List11array.ElementAt(i).SetAt(10, List11array.ElementAt(i).ElementAt(10) + ":2");
  1566. }
  1567. for (i = 0; i < other2salearray.GetSize(); i++)
  1568. {
  1569. if (other2salearray.ElementAt(i).ElementAt(9).IsEmpty())
  1570. other2salearray.ElementAt(i).SetAt(9, "未审核");
  1571. other2salearray.ElementAt(i).SetAt(8, other2salearray.ElementAt(i).ElementAt(8) + ":3");
  1572. }
  1573. //if(m_radio1==2)//营业收入
  1574. {
  1575. for (i = 0; i < List11array.GetSize(); i++)
  1576. {
  1577. if (List11array.ElementAt(i).ElementAt(5) != "客服二销")continue;
  1578. str = List11array.ElementAt(i).ElementAt(0);
  1579. str += ";" + List11array.ElementAt(i).ElementAt(3);
  1580. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  1581. {
  1582. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  1583. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  1584. str += "," + List11array.ElementAt(i).ElementAt(2);
  1585. }
  1586. else
  1587. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  1588. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  1589. m_List1array.ElementAt(pos).Add(str);
  1590. str = List11array.ElementAt(i).ElementAt(4);
  1591. m_List1array.ElementAt(pos).Add(str);
  1592. income += atof(str);
  1593. income2 += atof(str);
  1594. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  1595. m_List1array.ElementAt(pos).Add("收入");
  1596. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  1597. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  1598. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  1599. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  1600. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  1601. pos++;
  1602. }
  1603. }
  1604. m_List1array.SetSize(pos);
  1605. str.Format("%0.2f", income);
  1606. ::ConvertToPrice(str);
  1607. SetDlgItemText(IDC_EDITmoney1, str);
  1608. str.Format("%0.2f", income);
  1609. ::ConvertToPrice(str);
  1610. SetDlgItemText(IDC_EDITmoney5, str);
  1611. str.Format("%0.2f", 0);
  1612. ::ConvertToPrice(str);
  1613. SetDlgItemText(IDC_EDITmoney2, str);
  1614. str.Format("%0.2f", income);
  1615. ::ConvertToPrice(str);
  1616. SetDlgItemText(IDC_EDITmoney3, str);
  1617. str.Format("%d", 0);
  1618. SetDlgItemText(IDC_EDITmoney4, str);
  1619. FillGrid();
  1620. PaymentMethodCount();
  1621. }
  1622. //支付方式计算
  1623. void YearForm::PaymentMethodCount()
  1624. {
  1625. int addpos = 1;
  1626. float otherpaytype[9] = {0};
  1627. float fIncome = 0; // 收入
  1628. float fExpenditure = 0; // 支出
  1629. CString strName = _T("");
  1630. for (int i = 0; i < m_List1.GetItemCount(); i++)
  1631. {
  1632. if (m_List1.GetItemText(i, 5 + addpos) == "现金")
  1633. {
  1634. switch (m_radio1)
  1635. {
  1636. case 0: // 全部
  1637. {
  1638. if(m_List1.GetItemText(i, 3 + addpos) == _T("收入"))
  1639. fIncome += atof(m_List1.GetItemText(i, 1 + addpos));
  1640. else
  1641. fExpenditure += atof(m_List1.GetItemText(i, 1 + addpos));
  1642. }
  1643. break;
  1644. case 3: // 支出
  1645. {
  1646. fExpenditure += atof(m_List1.GetItemText(i, 1 + addpos));
  1647. }
  1648. break;
  1649. default: // 只计算收入
  1650. {
  1651. fIncome += atof(m_List1.GetItemText(i, 1 + addpos));
  1652. }
  1653. break;
  1654. }
  1655. }
  1656. else if (m_List1.GetItemText(i, 5 + addpos) == "POS机刷卡")
  1657. otherpaytype[1] += atof(m_List1.GetItemText(i, 1 + addpos));
  1658. else if (m_List1.GetItemText(i, 5 + addpos) == "银行转账")
  1659. otherpaytype[2] += atof(m_List1.GetItemText(i, 1 + addpos));
  1660. else if (m_List1.GetItemText(i, 5 + addpos) == "储值卡扣款")
  1661. otherpaytype[3] += atof(m_List1.GetItemText(i, 1 + addpos));
  1662. else if (m_List1.GetItemText(i, 5 + addpos) == "积分兑换")
  1663. otherpaytype[4] += atof(m_List1.GetItemText(i, 1 + addpos));
  1664. else if (m_List1.GetItemText(i, 5 + addpos) == "代金券")
  1665. otherpaytype[5] += atof(m_List1.GetItemText(i, 1 + addpos));
  1666. else if (m_List1.GetItemText(i, 5 + addpos) == "支付宝")
  1667. otherpaytype[6] += atof(m_List1.GetItemText(i, 1 + addpos));
  1668. else if (m_List1.GetItemText(i, 5 + addpos) == "财付通")
  1669. otherpaytype[7] += atof(m_List1.GetItemText(i, 1 + addpos));
  1670. else if (m_List1.GetItemText(i, 5 + addpos) == "微信支付")
  1671. otherpaytype[8] += atof(m_List1.GetItemText(i, 1 + addpos));
  1672. }
  1673. // 计算现金
  1674. CString strNum = _T("");
  1675. CString strIncome = _T("");
  1676. CString strExpenditure = _T("");
  1677. switch (m_radio1)
  1678. {
  1679. case 0: // 全部
  1680. {
  1681. strIncome.Format(_T("%0.2f"), fIncome);
  1682. ::ConvertToPrice(strIncome);
  1683. strExpenditure.Format(_T("%0.2f"), fExpenditure);
  1684. ::ConvertToPrice(strExpenditure);
  1685. strName = _T("收入/支出现金:");
  1686. strNum.Format(_T("%s/%s"), strIncome, strExpenditure);
  1687. }
  1688. break;
  1689. case 3: // 支出
  1690. {
  1691. strExpenditure.Format(_T("%0.2f"), fExpenditure);
  1692. ::ConvertToPrice(strExpenditure);
  1693. strName = _T("支出现金:");
  1694. strNum = strExpenditure;
  1695. }
  1696. break;
  1697. default: // 只计算收入
  1698. {
  1699. strIncome.Format(_T("%0.2f"), fIncome);
  1700. ::ConvertToPrice(strIncome);
  1701. strName = _T("收入现金:");
  1702. strNum = strIncome;
  1703. }
  1704. break;
  1705. }
  1706. ((CStatic*)GetDlgItem(IDC_STATIC_YCash))->SetWindowText(strName);
  1707. SetDlgItemText(IDC_YCash_EDIT, strNum);
  1708. strNum.Format(_T("%0.2f"), otherpaytype[1]);
  1709. ::ConvertToPrice(strNum);
  1710. SetDlgItemText(IDC_YPOS_EDIT, strNum);
  1711. strNum.Format(_T("%0.2f"), otherpaytype[2]);
  1712. ::ConvertToPrice(strNum);
  1713. SetDlgItemText(IDC_YBANK_EDIT, strNum);
  1714. strNum.Format(_T("%0.2f"), otherpaytype[3]);
  1715. ::ConvertToPrice(strNum);
  1716. SetDlgItemText(IDC_YBANKCARD_EDIT, strNum);
  1717. strNum.Format(_T("%0.2f"), otherpaytype[4]);
  1718. ::ConvertToPrice(strNum);
  1719. SetDlgItemText(IDC_YIntegral_EDIT, strNum);
  1720. strNum.Format(_T("%0.2f"), otherpaytype[5]);
  1721. ::ConvertToPrice(strNum);
  1722. SetDlgItemText(IDC_YVouchers_EDIT, strNum);
  1723. strNum.Format(_T("%0.2f"), otherpaytype[6]);
  1724. ::ConvertToPrice(strNum);
  1725. SetDlgItemText(IDC_YAlipay_EDIT, strNum);
  1726. strNum.Format(_T("%0.2f"), otherpaytype[7]);
  1727. ::ConvertToPrice(strNum);
  1728. SetDlgItemText(IDC_YTenpay_EDIT, strNum);
  1729. strNum.Format(_T("%0.2f"), otherpaytype[8]);
  1730. ::ConvertToPrice(strNum);
  1731. SetDlgItemText(IDC_YWechatPayment_EDIT, strNum);
  1732. }