YearForm.cpp 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916
  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. payoutdlg.m_mode = 2;
  404. }
  405. payoutdlg.ShowWindow(SW_SHOW);
  406. }
  407. else
  408. {
  409. m_filter.Empty();
  410. if (payoutdlg.GetSafeHwnd())payoutdlg.ShowWindow(SW_HIDE);
  411. }
  412. for (i = 0; i < memberarray.GetSize(); i++)
  413. {
  414. if (memberarray.ElementAt(i).ElementAt(6).IsEmpty())
  415. memberarray.ElementAt(i).SetAt(6, "未审核");
  416. memberarray.ElementAt(i).SetAt(0, memberarray.ElementAt(i).ElementAt(0) + ":4");
  417. }
  418. for (i = 0; i < List2array.GetSize(); i++)
  419. {
  420. if (List2array.ElementAt(i).ElementAt(10).IsEmpty())
  421. List2array.ElementAt(i).SetAt(10, "未审核");
  422. List2array.ElementAt(i).SetAt(0, List2array.ElementAt(i).ElementAt(0) + ":0");
  423. }
  424. for (i = 0; i < List3array.GetSize(); i++)
  425. {
  426. if (List3array.ElementAt(i).ElementAt(7).IsEmpty())
  427. List3array.ElementAt(i).SetAt(7, "未审核");
  428. List3array.ElementAt(i).SetAt(0, List3array.ElementAt(i).ElementAt(0) + ":1");
  429. }
  430. for (i = 0; i < List11array.GetSize(); i++)
  431. {
  432. if (List11array.ElementAt(i).ElementAt(11).IsEmpty())
  433. List11array.ElementAt(i).SetAt(11, "未审核");
  434. List11array.ElementAt(i).SetAt(10, List11array.ElementAt(i).ElementAt(10) + ":2");
  435. }
  436. for (i = 0; i < other2salearray.GetSize(); i++)
  437. {
  438. if (other2salearray.ElementAt(i).ElementAt(9).IsEmpty())
  439. other2salearray.ElementAt(i).SetAt(9, "未审核");
  440. other2salearray.ElementAt(i).SetAt(8, other2salearray.ElementAt(i).ElementAt(8) + ":3");
  441. }
  442. if (m_radio1 == 0)
  443. {
  444. for (i = 0; i < List11array.GetSize(); i++)
  445. {
  446. #ifdef DDF_VERSION
  447. if(List11array.ElementAt (i).ElementAt (5)=="客服二销")continue;
  448. #endif
  449. str = List11array.ElementAt(i).ElementAt(0);
  450. str += ";" + List11array.ElementAt(i).ElementAt(3);
  451. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  452. {
  453. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  454. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  455. str += "," + List11array.ElementAt(i).ElementAt(2);
  456. }
  457. else
  458. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  459. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  460. m_List1array.ElementAt(pos).Add(str);
  461. str = List11array.ElementAt(i).ElementAt(4);
  462. m_List1array.ElementAt(pos).Add(str);
  463. #if 0
  464. income+=atof(str);
  465. income2+=atof(str);
  466. #else
  467. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  468. {
  469. income += atof(str);
  470. }
  471. income2 += atof(str);
  472. #endif
  473. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  474. m_List1array.ElementAt(pos).Add("收入");
  475. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  476. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  477. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  478. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  479. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  480. if (List11array.ElementAt(i).ElementAt(5) == "预约收款")
  481. dindanshu++;
  482. pos++;
  483. }
  484. for (i = 0; i < List2array.GetSize(); i++)
  485. {
  486. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  487. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  488. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  489. str.Replace(";;;", ";"); str.Replace(";;", ";");
  490. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  491. m_List1array.ElementAt(pos).Add(str);
  492. str = List2array.ElementAt(i).ElementAt(2);
  493. m_List1array.ElementAt(pos).Add(str);
  494. #if 0
  495. income+=atof(str);
  496. #else
  497. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  498. {
  499. income += atof(str);
  500. }
  501. #endif
  502. if (List2array.ElementAt(i).ElementAt(8) != "")
  503. {
  504. income2 += atof(str);
  505. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  506. }
  507. else
  508. m_List1array.ElementAt(pos).Add("其它收入");
  509. m_List1array.ElementAt(pos).Add("收入");
  510. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  511. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  512. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  513. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  514. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(12));
  515. pos++;
  516. }
  517. for (i = 0; i < other2salearray.GetSize(); i++)
  518. {
  519. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  520. str.Replace(";;;", ";"); str.Replace(";;", ";");
  521. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  522. m_List1array.ElementAt(pos).Add(str);
  523. str = other2salearray.ElementAt(i).ElementAt(4);
  524. m_List1array.ElementAt(pos).Add(str);
  525. #if 0
  526. income+=atof(str);
  527. income2+=atof(str);
  528. #else
  529. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  530. {
  531. income += atof(str);
  532. }
  533. income2 += atof(str);
  534. #endif
  535. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  536. m_List1array.ElementAt(pos).Add("收入");
  537. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  538. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  539. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  540. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  541. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  542. pos++;
  543. }
  544. for (i = 0; i < List3array.GetSize(); i++)
  545. {
  546. if (List3array.ElementAt(i).ElementAt(6).GetLength()>120)
  547. List3array.ElementAt(i).SetAt(6, List3array.ElementAt(i).ElementAt(6).Left(120) + "..");
  548. str = List3array.ElementAt(i).ElementAt(1) + ";" + List3array.ElementAt(i).ElementAt(4) + ";" + List3array.ElementAt(i).ElementAt(6);
  549. str.Replace(";;;;", ";"); str.Replace(";;;", ";"); str.Replace(";;", ";");
  550. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(0));
  551. m_List1array.ElementAt(pos).Add(str);
  552. str = List3array.ElementAt(i).ElementAt(2);
  553. m_List1array.ElementAt(pos).Add(str);
  554. payout += atof(str);
  555. #if JEFF_TEST_ON
  556. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(1));
  557. #else
  558. m_List1array.ElementAt(pos).Add("固定费用");
  559. #endif
  560. m_List1array.ElementAt(pos).Add("支出");
  561. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(3) + " " + List3array.ElementAt(i).ElementAt(8));
  562. m_List1array.ElementAt(pos).Add("现金");
  563. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(5));
  564. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(7));
  565. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(12));
  566. pos++;
  567. }
  568. for (i = 0; i < memberarray.GetSize(); i++)
  569. {
  570. str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";客户:" + memberarray.ElementAt(i).ElementAt(2);
  571. str.Replace(";;;", ";"); str.Replace(";;", ";");
  572. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
  573. m_List1array.ElementAt(pos).Add(str);
  574. str = memberarray.ElementAt(i).ElementAt(3);
  575. m_List1array.ElementAt(pos).Add(str);
  576. income += atof(str);
  577. m_List1array.ElementAt(pos).Add("会员充值");
  578. m_List1array.ElementAt(pos).Add("收入");
  579. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));
  580. if (memberarray.ElementAt(i).ElementAt(7) == "")
  581. m_List1array.ElementAt(pos).Add("现金");
  582. else
  583. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));
  584. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
  585. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
  586. m_List1array.ElementAt(pos).Add(" ");
  587. pos++;
  588. }
  589. }
  590. else if (m_radio1 == 1)//收入
  591. {
  592. for (i = 0; i < List11array.GetSize(); i++)
  593. {
  594. #ifdef DDF_VERSION
  595. if(List11array.ElementAt (i).ElementAt (5)=="客服二销")continue;
  596. #endif
  597. str = List11array.ElementAt(i).ElementAt(0);
  598. str += ";" + List11array.ElementAt(i).ElementAt(3);
  599. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  600. {
  601. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  602. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  603. str += "," + List11array.ElementAt(i).ElementAt(2);
  604. }
  605. else
  606. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  607. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  608. m_List1array.ElementAt(pos).Add(str);
  609. str = List11array.ElementAt(i).ElementAt(4);
  610. m_List1array.ElementAt(pos).Add(str);
  611. #if 0
  612. income+=atof(str);
  613. income2+=atof(str);
  614. #else
  615. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  616. {
  617. income += atof(str);
  618. }
  619. income2 += atof(str);
  620. #endif
  621. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  622. m_List1array.ElementAt(pos).Add("收入");
  623. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  624. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  625. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  626. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  627. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  628. if (List11array.ElementAt(i).ElementAt(5) == "预约收款")
  629. dindanshu++;
  630. pos++;
  631. }
  632. for (i = 0; i < List2array.GetSize(); i++)
  633. {
  634. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  635. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  636. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  637. str.Replace(";;;", ";"); str.Replace(";;", ";");
  638. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  639. m_List1array.ElementAt(pos).Add(str);
  640. str = List2array.ElementAt(i).ElementAt(2);
  641. m_List1array.ElementAt(pos).Add(str);
  642. #if 0
  643. income+=atof(str);
  644. #else
  645. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  646. {
  647. income += atof(str);
  648. }
  649. #endif
  650. if (List2array.ElementAt(i).ElementAt(8) != "")
  651. {
  652. income2 += atof(str);
  653. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  654. }
  655. else
  656. m_List1array.ElementAt(pos).Add("其它收入");
  657. m_List1array.ElementAt(pos).Add("收入");
  658. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  659. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  660. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  661. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  662. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(12));
  663. pos++;
  664. }
  665. for (i = 0; i < other2salearray.GetSize(); i++)
  666. {
  667. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  668. str.Replace(";;;", ";"); str.Replace(";;", ";");
  669. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  670. m_List1array.ElementAt(pos).Add(str);
  671. str = other2salearray.ElementAt(i).ElementAt(4);
  672. m_List1array.ElementAt(pos).Add(str);
  673. #if 0
  674. income+=atof(str);
  675. income2+=atof(str);
  676. #else
  677. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  678. {
  679. income += atof(str);
  680. }
  681. income2 += atof(str);
  682. #endif
  683. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  684. m_List1array.ElementAt(pos).Add("收入");
  685. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  686. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  687. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  688. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  689. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  690. pos++;
  691. }
  692. for (i = 0; i < memberarray.GetSize(); i++)
  693. {
  694. str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";客户:" + memberarray.ElementAt(i).ElementAt(2);
  695. str.Replace(";;;", ";"); str.Replace(";;", ";");
  696. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
  697. m_List1array.ElementAt(pos).Add(str);
  698. str = memberarray.ElementAt(i).ElementAt(3);
  699. m_List1array.ElementAt(pos).Add(str);
  700. income += atof(str);
  701. m_List1array.ElementAt(pos).Add("会员充值");
  702. m_List1array.ElementAt(pos).Add("收入");
  703. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));
  704. if (memberarray.ElementAt(i).ElementAt(7) == "")
  705. m_List1array.ElementAt(pos).Add("现金");
  706. else
  707. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));
  708. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
  709. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
  710. m_List1array.ElementAt(pos).Add(" ");
  711. pos++;
  712. }
  713. }
  714. else if (m_radio1 == 2)//营业收入
  715. {
  716. for (i = 0; i < List11array.GetSize(); i++)
  717. {
  718. #ifdef DDF_VERSION
  719. if(List11array.ElementAt (i).ElementAt (5)=="客服二销")continue;
  720. #endif
  721. str = List11array.ElementAt(i).ElementAt(0);
  722. str += ";" + List11array.ElementAt(i).ElementAt(3);
  723. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  724. {
  725. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  726. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  727. str += "," + List11array.ElementAt(i).ElementAt(2);
  728. }
  729. else
  730. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  731. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  732. m_List1array.ElementAt(pos).Add(str);
  733. str = List11array.ElementAt(i).ElementAt(4);
  734. m_List1array.ElementAt(pos).Add(str);
  735. #if 0
  736. income+=atof(str);
  737. income2+=atof(str);
  738. #else
  739. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  740. {
  741. income += atof(str);
  742. }
  743. income2 += atof(str);
  744. #endif
  745. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  746. m_List1array.ElementAt(pos).Add("收入");
  747. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  748. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  749. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  750. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  751. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  752. if (List11array.ElementAt(i).ElementAt(5) == "预约收款")
  753. dindanshu++;
  754. pos++;
  755. }
  756. for (i = 0; i < List2array.GetSize(); i++)
  757. {
  758. if (List2array.ElementAt(i).ElementAt(8) != "")
  759. {
  760. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  761. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  762. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  763. str.Replace(";;;", ";"); str.Replace(";;", ";");
  764. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  765. m_List1array.ElementAt(pos).Add(str);
  766. str = List2array.ElementAt(i).ElementAt(2);
  767. m_List1array.ElementAt(pos).Add(str);
  768. #if 0
  769. income+=atof(str);
  770. income2+=atof(str);
  771. #else
  772. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  773. {
  774. income += atof(str);
  775. }
  776. income2 += atof(str);
  777. #endif
  778. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  779. m_List1array.ElementAt(pos).Add("收入");
  780. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  781. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  782. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  783. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  784. m_List1array.ElementAt(pos).Add(" ");
  785. pos++;
  786. }
  787. }
  788. for (i = 0; i < other2salearray.GetSize(); i++)
  789. {
  790. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  791. str.Replace(";;;", ";"); str.Replace(";;", ";");
  792. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  793. m_List1array.ElementAt(pos).Add(str);
  794. str = other2salearray.ElementAt(i).ElementAt(4);
  795. m_List1array.ElementAt(pos).Add(str);
  796. #if 0
  797. income+=atof(str);
  798. income2+=atof(str);
  799. #else
  800. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  801. {
  802. income += atof(str);
  803. }
  804. income2 += atof(str);
  805. #endif
  806. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  807. m_List1array.ElementAt(pos).Add("收入");
  808. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  809. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  810. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  811. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  812. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  813. pos++;
  814. }
  815. }
  816. else if (m_radio1 == 3)//支出
  817. {
  818. for (i = 0; i < List3array.GetSize(); i++)
  819. {
  820. if (List3array.ElementAt(i).ElementAt(6).GetLength()>120)
  821. List3array.ElementAt(i).SetAt(6, List3array.ElementAt(i).ElementAt(6).Left(120) + "..");
  822. str = List3array.ElementAt(i).ElementAt(1) + ";" + List3array.ElementAt(i).ElementAt(4) + ";" + List3array.ElementAt(i).ElementAt(6);
  823. str.Replace(";;;;", ";"); str.Replace(";;;", ";"); str.Replace(";;", ";");
  824. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(0));
  825. m_List1array.ElementAt(pos).Add(str);
  826. str = List3array.ElementAt(i).ElementAt(2);
  827. m_List1array.ElementAt(pos).Add(str);
  828. payout += atof(str);
  829. #if JEFF_TEST_ON
  830. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(1));
  831. #else
  832. m_List1array.ElementAt(pos).Add("固定费用");
  833. #endif
  834. m_List1array.ElementAt(pos).Add("支出");
  835. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(3) + " " + List3array.ElementAt(i).ElementAt(8));
  836. m_List1array.ElementAt(pos).Add("现金");
  837. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(5));
  838. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(7));
  839. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(12));
  840. pos++;
  841. }
  842. }
  843. else if (m_radio1 == 4)//定单
  844. {
  845. for (i = 0; i < List11array.GetSize(); i++)
  846. {
  847. if (List11array.ElementAt(i).ElementAt(5) != "预约收款")continue;
  848. dindanshu++;
  849. str = List11array.ElementAt(i).ElementAt(0);
  850. str += ";" + List11array.ElementAt(i).ElementAt(3);
  851. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  852. {
  853. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  854. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  855. str += "," + List11array.ElementAt(i).ElementAt(2);
  856. }
  857. else
  858. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  859. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  860. m_List1array.ElementAt(pos).Add(str);
  861. str = List11array.ElementAt(i).ElementAt(4);
  862. m_List1array.ElementAt(pos).Add(str);
  863. #if 0
  864. income+=atof(str);
  865. income2+=atof(str);
  866. #else
  867. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  868. {
  869. income += atof(str);
  870. }
  871. income2 += atof(str);
  872. #endif
  873. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  874. m_List1array.ElementAt(pos).Add("收入");
  875. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  876. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  877. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  878. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  879. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  880. pos++;
  881. }
  882. }
  883. else if (m_radio1 == 5)//补款
  884. {
  885. for (i = 0; i < List11array.GetSize(); i++)
  886. {
  887. if (List11array.ElementAt(i).ElementAt(5) != "预约补款")continue;
  888. str = List11array.ElementAt(i).ElementAt(0);
  889. str += ";" + List11array.ElementAt(i).ElementAt(3);
  890. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  891. {
  892. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  893. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  894. str += "," + List11array.ElementAt(i).ElementAt(2);
  895. }
  896. else
  897. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  898. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  899. m_List1array.ElementAt(pos).Add(str);
  900. str = List11array.ElementAt(i).ElementAt(4);
  901. m_List1array.ElementAt(pos).Add(str);
  902. #if 0
  903. income+=atof(str);
  904. income2+=atof(str);
  905. #else
  906. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  907. {
  908. income += atof(str);
  909. }
  910. income2 += atof(str);
  911. #endif
  912. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  913. m_List1array.ElementAt(pos).Add("收入");
  914. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  915. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  916. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  917. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  918. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  919. pos++;
  920. }
  921. }
  922. else if (m_radio1 == 6)//摄影二销
  923. {
  924. for (i = 0; i < List11array.GetSize(); i++)
  925. {
  926. if (List11array.ElementAt(i).ElementAt(5) != "摄影二销")continue;
  927. str = List11array.ElementAt(i).ElementAt(0);
  928. str += ";" + List11array.ElementAt(i).ElementAt(3);
  929. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  930. {
  931. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  932. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  933. str += "," + List11array.ElementAt(i).ElementAt(2);
  934. }
  935. else
  936. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  937. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  938. m_List1array.ElementAt(pos).Add(str);
  939. str = List11array.ElementAt(i).ElementAt(4);
  940. m_List1array.ElementAt(pos).Add(str);
  941. #if 0
  942. income+=atof(str);
  943. income2+=atof(str);
  944. #else
  945. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  946. {
  947. income += atof(str);
  948. }
  949. income2 += atof(str);
  950. #endif
  951. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  952. m_List1array.ElementAt(pos).Add("收入");
  953. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  954. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  955. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  956. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  957. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  958. pos++;
  959. }
  960. for (i = 0; i < List2array.GetSize(); i++)
  961. {
  962. if (List2array.ElementAt(i).ElementAt(8) == "摄影二销")
  963. {
  964. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  965. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  966. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  967. str.Replace(";;;", ";"); str.Replace(";;", ";");
  968. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  969. m_List1array.ElementAt(pos).Add(str);
  970. str = List2array.ElementAt(i).ElementAt(2);
  971. m_List1array.ElementAt(pos).Add(str);
  972. #if 0
  973. income+=atof(str);
  974. income2+=atof(str);
  975. #else
  976. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(8) != "代金券")
  977. {
  978. income += atof(str);
  979. }
  980. income2 += atof(str);
  981. #endif
  982. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  983. m_List1array.ElementAt(pos).Add("收入");
  984. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  985. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  986. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  987. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  988. m_List1array.ElementAt(pos).Add(" ");
  989. pos++;
  990. }
  991. }
  992. for (i = 0; i < other2salearray.GetSize(); i++)
  993. {
  994. if (other2salearray.ElementAt(i).ElementAt(3) == "摄影二销")
  995. {
  996. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  997. str.Replace(";;;", ";"); str.Replace(";;", ";");
  998. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  999. m_List1array.ElementAt(pos).Add(str);
  1000. str = other2salearray.ElementAt(i).ElementAt(4);
  1001. m_List1array.ElementAt(pos).Add(str);
  1002. #if 0
  1003. income+=atof(str);
  1004. income2+=atof(str);
  1005. #else
  1006. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  1007. {
  1008. income += atof(str);
  1009. }
  1010. income2 += atof(str);
  1011. #endif
  1012. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1013. m_List1array.ElementAt(pos).Add("收入");
  1014. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1015. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1016. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1017. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1018. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1019. pos++;
  1020. }
  1021. }
  1022. }
  1023. else if (m_radio1 == 7)//化妆二销
  1024. {
  1025. for (i = 0; i < List11array.GetSize(); i++)
  1026. {
  1027. #ifndef CHILD_VERSION
  1028. if (List11array.ElementAt(i).ElementAt(5) != "化妆二销")continue;
  1029. #else
  1030. if (List11array.ElementAt(i).ElementAt(5) != "引导二销")continue;//"引导二销"
  1031. #endif
  1032. str = List11array.ElementAt(i).ElementAt(0);
  1033. str += ";" + List11array.ElementAt(i).ElementAt(3);
  1034. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  1035. {
  1036. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  1037. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  1038. str += "," + List11array.ElementAt(i).ElementAt(2);
  1039. }
  1040. else
  1041. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  1042. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  1043. m_List1array.ElementAt(pos).Add(str);
  1044. str = List11array.ElementAt(i).ElementAt(4);
  1045. m_List1array.ElementAt(pos).Add(str);
  1046. #if 0
  1047. income+=atof(str);
  1048. income2+=atof(str);
  1049. #else
  1050. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  1051. {
  1052. income += atof(str);
  1053. }
  1054. income2 += atof(str);
  1055. #endif
  1056. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  1057. m_List1array.ElementAt(pos).Add("收入");
  1058. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  1059. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  1060. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  1061. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  1062. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  1063. pos++;
  1064. }
  1065. for (i = 0; i < List2array.GetSize(); i++)
  1066. {
  1067. #ifndef CHILD_VERSION
  1068. if (List2array.ElementAt(i).ElementAt(8) == "化妆二销")
  1069. #else
  1070. if (List2array.ElementAt(i).ElementAt(8) == "引导二销")//"引导二销"
  1071. #endif
  1072. {
  1073. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  1074. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  1075. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  1076. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1077. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  1078. m_List1array.ElementAt(pos).Add(str);
  1079. str = List2array.ElementAt(i).ElementAt(2);
  1080. m_List1array.ElementAt(pos).Add(str);
  1081. #if 0
  1082. income+=atof(str);
  1083. income2+=atof(str);
  1084. #else
  1085. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  1086. {
  1087. income += atof(str);
  1088. }
  1089. income2 += atof(str);
  1090. #endif
  1091. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  1092. m_List1array.ElementAt(pos).Add("收入");
  1093. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  1094. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  1095. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  1096. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  1097. m_List1array.ElementAt(pos).Add(" ");
  1098. pos++;
  1099. }
  1100. }
  1101. for (i = 0; i < other2salearray.GetSize(); i++)
  1102. {
  1103. #ifndef CHILD_VERSION
  1104. if (other2salearray.ElementAt(i).ElementAt(3) == "化妆二销")
  1105. #else
  1106. if (other2salearray.ElementAt(i).ElementAt(3) == "引导二销")//"引导二销"
  1107. #endif
  1108. {
  1109. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  1110. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1111. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  1112. m_List1array.ElementAt(pos).Add(str);
  1113. str = other2salearray.ElementAt(i).ElementAt(4);
  1114. m_List1array.ElementAt(pos).Add(str);
  1115. #if 0
  1116. income+=atof(str);
  1117. income2+=atof(str);
  1118. #else
  1119. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  1120. {
  1121. income += atof(str);
  1122. }
  1123. income2 += atof(str);
  1124. #endif
  1125. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1126. m_List1array.ElementAt(pos).Add("收入");
  1127. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1128. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1129. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1130. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1131. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1132. pos++;
  1133. }
  1134. }
  1135. }
  1136. else if (m_radio1 == 8)//套系升级二销
  1137. {
  1138. for (i = 0; i < memberarray.GetSize(); i++)
  1139. {
  1140. str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";客户:" + memberarray.ElementAt(i).ElementAt(2);
  1141. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1142. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
  1143. m_List1array.ElementAt(pos).Add(str);
  1144. str = memberarray.ElementAt(i).ElementAt(3);
  1145. m_List1array.ElementAt(pos).Add(str);
  1146. income += atof(str);
  1147. m_List1array.ElementAt(pos).Add("会员充值");
  1148. m_List1array.ElementAt(pos).Add("收入");
  1149. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));
  1150. if (memberarray.ElementAt(i).ElementAt(7) == "")
  1151. m_List1array.ElementAt(pos).Add("现金");
  1152. else
  1153. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));
  1154. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
  1155. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
  1156. m_List1array.ElementAt(pos).Add(" ");
  1157. pos++;
  1158. }
  1159. }
  1160. else if (m_radio1 == 9)//选片加挑
  1161. {
  1162. for (i = 0; i < List11array.GetSize(); i++)
  1163. {
  1164. if (List11array.ElementAt(i).ElementAt(5) != "选片二销")continue;
  1165. str = List11array.ElementAt(i).ElementAt(0);
  1166. str += ";" + List11array.ElementAt(i).ElementAt(3);
  1167. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  1168. {
  1169. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  1170. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  1171. str += "," + List11array.ElementAt(i).ElementAt(2);
  1172. }
  1173. else
  1174. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  1175. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  1176. m_List1array.ElementAt(pos).Add(str);
  1177. str = List11array.ElementAt(i).ElementAt(4);
  1178. m_List1array.ElementAt(pos).Add(str);
  1179. #if 0
  1180. income+=atof(str);
  1181. income2+=atof(str);
  1182. #else
  1183. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款" && List11array.ElementAt(i).ElementAt(8) != "代金券") // 储值卡扣款;
  1184. {
  1185. income += atof(str);
  1186. }
  1187. income2 += atof(str);
  1188. #endif
  1189. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  1190. m_List1array.ElementAt(pos).Add("收入");
  1191. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  1192. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  1193. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  1194. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  1195. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  1196. pos++;
  1197. }
  1198. for (i = 0; i < List2array.GetSize(); i++)
  1199. {
  1200. if (List2array.ElementAt(i).ElementAt(8) == "选片二销")
  1201. {
  1202. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  1203. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  1204. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  1205. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1206. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  1207. m_List1array.ElementAt(pos).Add(str);
  1208. str = List2array.ElementAt(i).ElementAt(2);
  1209. m_List1array.ElementAt(pos).Add(str);
  1210. #if 0
  1211. income+=atof(str);
  1212. income2+=atof(str);
  1213. #else
  1214. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  1215. {
  1216. income += atof(str);
  1217. }
  1218. income2 += atof(str);
  1219. #endif
  1220. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  1221. m_List1array.ElementAt(pos).Add("收入");
  1222. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  1223. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  1224. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  1225. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  1226. m_List1array.ElementAt(pos).Add(" ");
  1227. pos++;
  1228. }
  1229. }
  1230. for (i = 0; i < other2salearray.GetSize(); i++)
  1231. {
  1232. if (other2salearray.ElementAt(i).ElementAt(3) == "选片二销")
  1233. {
  1234. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  1235. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1236. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  1237. m_List1array.ElementAt(pos).Add(str);
  1238. str = other2salearray.ElementAt(i).ElementAt(4);
  1239. m_List1array.ElementAt(pos).Add(str);
  1240. #if 0
  1241. income+=atof(str);
  1242. income2+=atof(str);
  1243. #else
  1244. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  1245. {
  1246. income += atof(str);
  1247. }
  1248. income2 += atof(str);
  1249. #endif
  1250. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1251. m_List1array.ElementAt(pos).Add("收入");
  1252. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1253. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1254. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1255. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1256. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1257. pos++;
  1258. }
  1259. }
  1260. }
  1261. else if (m_radio1 == 10)//其它收入
  1262. {
  1263. for (i = 0; i < List2array.GetSize(); i++)
  1264. {
  1265. if (List2array.ElementAt(i).ElementAt(8) != "")continue;
  1266. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  1267. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  1268. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  1269. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1270. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  1271. m_List1array.ElementAt(pos).Add(str);
  1272. str = List2array.ElementAt(i).ElementAt(2);
  1273. m_List1array.ElementAt(pos).Add(str);
  1274. #if 0
  1275. income+=atof(str);
  1276. #else
  1277. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款" && List2array.ElementAt(i).ElementAt(9) != "代金券")
  1278. {
  1279. income += atof(str);
  1280. }
  1281. #endif
  1282. m_List1array.ElementAt(pos).Add("其它收入");
  1283. m_List1array.ElementAt(pos).Add("收入");
  1284. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  1285. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  1286. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  1287. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  1288. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(12));
  1289. pos++;
  1290. }
  1291. }
  1292. else if (m_radio1 == 11)//散客消费
  1293. {
  1294. for (i = 0; i < other2salearray.GetSize(); i++)
  1295. {
  1296. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  1297. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1298. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  1299. m_List1array.ElementAt(pos).Add(str);
  1300. str = other2salearray.ElementAt(i).ElementAt(4);
  1301. m_List1array.ElementAt(pos).Add(str);
  1302. #if 0
  1303. income+=atof(str);
  1304. income2+=atof(str);
  1305. #else
  1306. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款" && other2salearray.ElementAt(i).ElementAt(7) != "代金券")
  1307. {
  1308. income += atof(str);
  1309. }
  1310. income2 += atof(str);
  1311. #endif
  1312. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1313. m_List1array.ElementAt(pos).Add("收入");
  1314. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1315. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1316. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1317. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1318. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1319. pos++;
  1320. }
  1321. }
  1322. m_List1array.SetSize(pos);
  1323. str.Format("%0.2f", income);
  1324. ::ConvertToPrice(str);
  1325. SetDlgItemText(IDC_EDITmoney1, str);
  1326. str.Format("%0.2f", income2);
  1327. ::ConvertToPrice(str);
  1328. SetDlgItemText(IDC_EDITmoney5, str);
  1329. str.Format("%0.2f", payout);
  1330. ::ConvertToPrice(str);
  1331. SetDlgItemText(IDC_EDITmoney2, str);
  1332. str.Format("%0.2f", income - payout);
  1333. ::ConvertToPrice(str);
  1334. SetDlgItemText(IDC_EDITmoney3, str);
  1335. str.Format("%d", dindanshu);
  1336. SetDlgItemText(IDC_EDITmoney4, str);
  1337. FillGrid();
  1338. PaymentMethodCount();
  1339. }
  1340. void YearForm::OnRadio3()
  1341. {
  1342. UpdateData();
  1343. KindChange();
  1344. }
  1345. void YearForm::OnRadio4()
  1346. {
  1347. UpdateData();
  1348. KindChange();
  1349. }
  1350. void YearForm::OnRadio5()
  1351. {
  1352. UpdateData();
  1353. KindChange();
  1354. }
  1355. void YearForm::OnRadio6() // 支出;
  1356. {
  1357. UpdateData();
  1358. m_filter.Empty();
  1359. KindChange();
  1360. }
  1361. void YearForm::OnRadio7()
  1362. {
  1363. UpdateData();
  1364. KindChange();
  1365. }
  1366. void YearForm::OnRadio8()
  1367. {
  1368. UpdateData();
  1369. KindChange();
  1370. }
  1371. void YearForm::OnRadio9()
  1372. {
  1373. UpdateData();
  1374. KindChange();
  1375. }
  1376. void YearForm::OnRadio10()
  1377. {
  1378. UpdateData();
  1379. KindChange();
  1380. }
  1381. void YearForm::OnRadio11()
  1382. {
  1383. UpdateData();
  1384. KindChange();
  1385. }
  1386. void YearForm::OnRadio12()
  1387. {
  1388. UpdateData();
  1389. KindChange();
  1390. }
  1391. void YearForm::OnRadio13()
  1392. {
  1393. UpdateData();
  1394. KindChange();
  1395. }
  1396. void YearForm::OnBUTprint()
  1397. {
  1398. if (m_List1.GetItemCount() == 0)
  1399. {
  1400. AfxMessageBox("无内容!", MB_ICONINFORMATION);
  1401. return;
  1402. }
  1403. CArray<CStringArray, CStringArray>Listarray;
  1404. CString str, temp;
  1405. m_static1.GetWindowText(str);
  1406. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + str;
  1407. int count = m_List1.GetItemCount() / 45;
  1408. if (m_List1.GetItemCount() % 45)count++;
  1409. Listarray.SetSize(m_List1.GetItemCount() + count, 1);
  1410. int pos = 0;
  1411. float otherpaytype1 = 0;
  1412. float otherpaytype2 = 0;
  1413. float otherpaytype3 = 0;
  1414. int addpos = 1;
  1415. for (int i = 0; i < m_List1.GetItemCount(); i++)
  1416. {
  1417. if (i % 45 == 0)
  1418. {
  1419. Listarray.ElementAt(pos).Add("项目名称");
  1420. Listarray.ElementAt(pos).Add("金额");
  1421. Listarray.ElementAt(pos).Add("项目类别");
  1422. Listarray.ElementAt(pos).Add("收入/支出");
  1423. pos++;
  1424. }
  1425. for (int j = 0; j < 3; j++)
  1426. Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, j + addpos));
  1427. Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 3 + addpos) + "/" + m_List1.GetItemText(i, 5 + addpos));
  1428. if (m_List1.GetItemText(i, 5 + addpos) == "POS机刷卡")
  1429. otherpaytype1 += atof(m_List1.GetItemText(i, 1 + addpos));
  1430. else if (m_List1.GetItemText(i, 5 + addpos) == "储值卡扣款")
  1431. otherpaytype2 += atof(m_List1.GetItemText(i, 1 + addpos));
  1432. else if (m_List1.GetItemText(i, 5 + addpos) == "积分兑换")
  1433. otherpaytype3 += atof(m_List1.GetItemText(i, 1 + addpos));
  1434. pos++;
  1435. }
  1436. Listarray.SetSize(pos, 1);
  1437. str = "总收入:";
  1438. GetDlgItemText(IDC_EDITmoney1, temp); str += temp;
  1439. str += " 营业收入:";
  1440. GetDlgItemText(IDC_EDITmoney5, temp); str += temp;
  1441. str += " 总支出:";
  1442. GetDlgItemText(IDC_EDITmoney2, temp); str += temp;
  1443. str += " 净收入:";
  1444. GetDlgItemText(IDC_EDITmoney3, temp); str += temp;
  1445. str += " 定单数:";
  1446. GetDlgItemText(IDC_EDITmoney4, temp); str += temp;
  1447. str += "***";
  1448. temp.Format("POS机刷卡:%d", (int)otherpaytype1);
  1449. str += temp;
  1450. temp.Format(" 储值卡扣款:%d", (int)otherpaytype2);
  1451. str += temp;
  1452. temp.Format(" 积分兑换:%d", (int)otherpaytype3);
  1453. str += temp;
  1454. CString ss;
  1455. GetDlgItemText(IDC_EDITmoney3, ss);
  1456. //temp.Format (" 现金:%d", (int) (atof(ss)-(otherpaytype1+otherpaytype2+otherpaytype3)) );
  1457. temp.Format(" 柜台现金:%d", (int)(atof(ss) - (otherpaytype1 + otherpaytype3)));
  1458. str += temp;
  1459. g_pMainWnd->PrintDailyForm(&Listarray, title, str);
  1460. }
  1461. void YearForm::TypeChange(CString str)
  1462. {
  1463. m_filter = str;
  1464. FillGrid();
  1465. PaymentMethodCount();
  1466. }
  1467. void YearForm::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
  1468. {
  1469. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  1470. *pResult = 0;
  1471. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  1472. {
  1473. *pResult = CDRF_NOTIFYITEMDRAW;
  1474. }
  1475. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  1476. {
  1477. if (m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8).Find("已审核") == -1)
  1478. pLVCD->clrText = RGB(220, 0, 0);
  1479. else
  1480. pLVCD->clrText = RGB(20, 133, 20);
  1481. if (pLVCD->nmcd.dwItemSpec % 2)
  1482. pLVCD->clrTextBk = g_gridcol1;
  1483. else
  1484. pLVCD->clrTextBk = g_gridcol2;
  1485. *pResult = CDRF_DODEFAULT;
  1486. }
  1487. }
  1488. void YearForm::OnBUTprint5()
  1489. {
  1490. CString str;
  1491. m_static1.GetWindowText(str);
  1492. ListToXLS(&m_List1, "c:\\" + str + ".xls", 1);
  1493. }
  1494. void YearForm::OnBUTprint4()
  1495. {
  1496. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  1497. {
  1498. SelExpendType dlg;
  1499. dlg.m_mode = 3;
  1500. if (dlg.DoModal() == IDOK)
  1501. {
  1502. m_jdd = dlg.m_sel;
  1503. FillGrid();
  1504. PaymentMethodCount();
  1505. }
  1506. }
  1507. }
  1508. void YearForm::OnRadio14()
  1509. {
  1510. UpdateData();
  1511. if (m_radio2 == 0)m_bForKF = 0;
  1512. else
  1513. {
  1514. m_bForKF = 1;
  1515. }
  1516. KindChange();
  1517. }
  1518. void YearForm::OnRadio15()
  1519. {
  1520. OnRadio14();
  1521. }
  1522. void YearForm::OnRadio16()
  1523. {
  1524. UpdateData();
  1525. KindChange();
  1526. }
  1527. void YearForm::KindChange2()
  1528. {
  1529. m_jdd = "";
  1530. CString str;
  1531. int pos = 0;
  1532. int dindanshu = 0;
  1533. float income = 0;
  1534. float income2 = 0;
  1535. float payout = 0;
  1536. int count = List2array.GetSize() + List3array.GetSize() + List11array.GetSize() + other2salearray.GetSize() + memberarray.GetSize();
  1537. m_List1array.RemoveAll();
  1538. m_List1array.SetSize(count);
  1539. int i = 0;
  1540. {
  1541. m_filter.Empty();
  1542. if (payoutdlg.GetSafeHwnd())payoutdlg.ShowWindow(SW_HIDE);
  1543. }
  1544. for (i = 0; i < memberarray.GetSize(); i++)
  1545. {
  1546. if (memberarray.ElementAt(i).ElementAt(6).IsEmpty())
  1547. memberarray.ElementAt(i).SetAt(6, "未审核");
  1548. memberarray.ElementAt(i).SetAt(0, memberarray.ElementAt(i).ElementAt(0) + ":4");
  1549. }
  1550. for (i = 0; i < List2array.GetSize(); i++)
  1551. {
  1552. if (List2array.ElementAt(i).ElementAt(10).IsEmpty())
  1553. List2array.ElementAt(i).SetAt(10, "未审核");
  1554. List2array.ElementAt(i).SetAt(0, List2array.ElementAt(i).ElementAt(0) + ":0");
  1555. }
  1556. for (i = 0; i < List3array.GetSize(); i++)
  1557. {
  1558. if (List3array.ElementAt(i).ElementAt(7).IsEmpty())
  1559. List3array.ElementAt(i).SetAt(7, "未审核");
  1560. List3array.ElementAt(i).SetAt(0, List3array.ElementAt(i).ElementAt(0) + ":1");
  1561. }
  1562. for (i = 0; i < List11array.GetSize(); i++)
  1563. {
  1564. if (List11array.ElementAt(i).ElementAt(11).IsEmpty())
  1565. List11array.ElementAt(i).SetAt(11, "未审核");
  1566. List11array.ElementAt(i).SetAt(10, List11array.ElementAt(i).ElementAt(10) + ":2");
  1567. }
  1568. for (i = 0; i < other2salearray.GetSize(); i++)
  1569. {
  1570. if (other2salearray.ElementAt(i).ElementAt(9).IsEmpty())
  1571. other2salearray.ElementAt(i).SetAt(9, "未审核");
  1572. other2salearray.ElementAt(i).SetAt(8, other2salearray.ElementAt(i).ElementAt(8) + ":3");
  1573. }
  1574. //if(m_radio1==2)//营业收入
  1575. {
  1576. for (i = 0; i < List11array.GetSize(); i++)
  1577. {
  1578. if (List11array.ElementAt(i).ElementAt(5) != "客服二销")continue;
  1579. str = List11array.ElementAt(i).ElementAt(0);
  1580. str += ";" + List11array.ElementAt(i).ElementAt(3);
  1581. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  1582. {
  1583. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  1584. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  1585. str += "," + List11array.ElementAt(i).ElementAt(2);
  1586. }
  1587. else
  1588. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  1589. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  1590. m_List1array.ElementAt(pos).Add(str);
  1591. str = List11array.ElementAt(i).ElementAt(4);
  1592. m_List1array.ElementAt(pos).Add(str);
  1593. income += atof(str);
  1594. income2 += atof(str);
  1595. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  1596. m_List1array.ElementAt(pos).Add("收入");
  1597. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  1598. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  1599. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  1600. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  1601. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  1602. pos++;
  1603. }
  1604. }
  1605. m_List1array.SetSize(pos);
  1606. str.Format("%0.2f", income);
  1607. ::ConvertToPrice(str);
  1608. SetDlgItemText(IDC_EDITmoney1, str);
  1609. str.Format("%0.2f", income);
  1610. ::ConvertToPrice(str);
  1611. SetDlgItemText(IDC_EDITmoney5, str);
  1612. str.Format("%0.2f", 0);
  1613. ::ConvertToPrice(str);
  1614. SetDlgItemText(IDC_EDITmoney2, str);
  1615. str.Format("%0.2f", income);
  1616. ::ConvertToPrice(str);
  1617. SetDlgItemText(IDC_EDITmoney3, str);
  1618. str.Format("%d", 0);
  1619. SetDlgItemText(IDC_EDITmoney4, str);
  1620. FillGrid();
  1621. PaymentMethodCount();
  1622. }
  1623. //支付方式计算
  1624. void YearForm::PaymentMethodCount()
  1625. {
  1626. int addpos = 1;
  1627. float otherpaytype[9] = {0};
  1628. float fIncome = 0; // 收入
  1629. float fExpenditure = 0; // 支出
  1630. CString strName = _T("");
  1631. for (int i = 0; i < m_List1.GetItemCount(); i++)
  1632. {
  1633. if (m_List1.GetItemText(i, 5 + addpos) == "现金")
  1634. {
  1635. switch (m_radio1)
  1636. {
  1637. case 0: // 全部
  1638. {
  1639. if(m_List1.GetItemText(i, 3 + addpos) == _T("收入"))
  1640. fIncome += atof(m_List1.GetItemText(i, 1 + addpos));
  1641. else
  1642. fExpenditure += atof(m_List1.GetItemText(i, 1 + addpos));
  1643. }
  1644. break;
  1645. case 3: // 支出
  1646. {
  1647. fExpenditure += atof(m_List1.GetItemText(i, 1 + addpos));
  1648. }
  1649. break;
  1650. default: // 只计算收入
  1651. {
  1652. fIncome += atof(m_List1.GetItemText(i, 1 + addpos));
  1653. }
  1654. break;
  1655. }
  1656. }
  1657. else if (m_List1.GetItemText(i, 5 + addpos) == "POS机刷卡")
  1658. otherpaytype[1] += atof(m_List1.GetItemText(i, 1 + addpos));
  1659. else if (m_List1.GetItemText(i, 5 + addpos) == "银行转账")
  1660. otherpaytype[2] += atof(m_List1.GetItemText(i, 1 + addpos));
  1661. else if (m_List1.GetItemText(i, 5 + addpos) == "储值卡扣款")
  1662. otherpaytype[3] += atof(m_List1.GetItemText(i, 1 + addpos));
  1663. else if (m_List1.GetItemText(i, 5 + addpos) == "积分兑换")
  1664. otherpaytype[4] += atof(m_List1.GetItemText(i, 1 + addpos));
  1665. else if (m_List1.GetItemText(i, 5 + addpos) == "代金券")
  1666. otherpaytype[5] += atof(m_List1.GetItemText(i, 1 + addpos));
  1667. else if (m_List1.GetItemText(i, 5 + addpos) == "支付宝")
  1668. otherpaytype[6] += atof(m_List1.GetItemText(i, 1 + addpos));
  1669. else if (m_List1.GetItemText(i, 5 + addpos) == "财付通")
  1670. otherpaytype[7] += atof(m_List1.GetItemText(i, 1 + addpos));
  1671. else if (m_List1.GetItemText(i, 5 + addpos) == "微信支付")
  1672. otherpaytype[8] += atof(m_List1.GetItemText(i, 1 + addpos));
  1673. }
  1674. // 计算现金
  1675. CString strNum = _T("");
  1676. CString strIncome = _T("");
  1677. CString strExpenditure = _T("");
  1678. switch (m_radio1)
  1679. {
  1680. case 0: // 全部
  1681. {
  1682. strIncome.Format(_T("%0.2f"), fIncome);
  1683. ::ConvertToPrice(strIncome);
  1684. strExpenditure.Format(_T("%0.2f"), fExpenditure);
  1685. ::ConvertToPrice(strExpenditure);
  1686. strName = _T("收入/支出现金:");
  1687. strNum.Format(_T("%s/%s"), strIncome, strExpenditure);
  1688. }
  1689. break;
  1690. case 3: // 支出
  1691. {
  1692. strExpenditure.Format(_T("%0.2f"), fExpenditure);
  1693. ::ConvertToPrice(strExpenditure);
  1694. strName = _T("支出现金:");
  1695. strNum = strExpenditure;
  1696. }
  1697. break;
  1698. default: // 只计算收入
  1699. {
  1700. strIncome.Format(_T("%0.2f"), fIncome);
  1701. ::ConvertToPrice(strIncome);
  1702. strName = _T("收入现金:");
  1703. strNum = strIncome;
  1704. }
  1705. break;
  1706. }
  1707. ((CStatic*)GetDlgItem(IDC_STATIC_YCash))->SetWindowText(strName);
  1708. SetDlgItemText(IDC_YCash_EDIT, strNum);
  1709. strNum.Format(_T("%0.2f"), otherpaytype[1]);
  1710. ::ConvertToPrice(strNum);
  1711. SetDlgItemText(IDC_YPOS_EDIT, strNum);
  1712. strNum.Format(_T("%0.2f"), otherpaytype[2]);
  1713. ::ConvertToPrice(strNum);
  1714. SetDlgItemText(IDC_YBANK_EDIT, strNum);
  1715. strNum.Format(_T("%0.2f"), otherpaytype[3]);
  1716. ::ConvertToPrice(strNum);
  1717. SetDlgItemText(IDC_YBANKCARD_EDIT, strNum);
  1718. strNum.Format(_T("%0.2f"), otherpaytype[4]);
  1719. ::ConvertToPrice(strNum);
  1720. SetDlgItemText(IDC_YIntegral_EDIT, strNum);
  1721. strNum.Format(_T("%0.2f"), otherpaytype[5]);
  1722. ::ConvertToPrice(strNum);
  1723. SetDlgItemText(IDC_YVouchers_EDIT, strNum);
  1724. strNum.Format(_T("%0.2f"), otherpaytype[6]);
  1725. ::ConvertToPrice(strNum);
  1726. SetDlgItemText(IDC_YAlipay_EDIT, strNum);
  1727. strNum.Format(_T("%0.2f"), otherpaytype[7]);
  1728. ::ConvertToPrice(strNum);
  1729. SetDlgItemText(IDC_YTenpay_EDIT, strNum);
  1730. strNum.Format(_T("%0.2f"), otherpaytype[8]);
  1731. ::ConvertToPrice(strNum);
  1732. SetDlgItemText(IDC_YWechatPayment_EDIT, strNum);
  1733. }