YearForm.cpp 56 KB

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