MonthForm.cpp 62 KB

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