YearForm.cpp 56 KB

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