MonthForm.cpp 63 KB

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