MonthForm.cpp 69 KB

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