YearForm.cpp 57 KB

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