YearForm.cpp 63 KB

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