MonthForm.cpp 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847
  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. #if JEFF_TEST_ON
  579. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(1));
  580. #else
  581. m_List1array.ElementAt(pos).Add("固定费用");
  582. #endif
  583. m_List1array.ElementAt(pos).Add("支出");
  584. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(3) + " " + List3array.ElementAt(i).ElementAt(8));
  585. m_List1array.ElementAt(pos).Add("现金");
  586. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(5));
  587. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(7));
  588. m_List1array.ElementAt(pos).Add(" ");
  589. pos++;
  590. }
  591. for (i = 0; i < memberarray.GetSize(); i++)
  592. {
  593. str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";客户:" + memberarray.ElementAt(i).ElementAt(2);
  594. str.Replace(";;;", ";"); str.Replace(";;", ";");
  595. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
  596. m_List1array.ElementAt(pos).Add(str);
  597. str = memberarray.ElementAt(i).ElementAt(3);
  598. m_List1array.ElementAt(pos).Add(str);
  599. income += atof(str);
  600. m_List1array.ElementAt(pos).Add("会员充值");
  601. m_List1array.ElementAt(pos).Add("收入");
  602. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));
  603. if (memberarray.ElementAt(i).ElementAt(7) == "")
  604. m_List1array.ElementAt(pos).Add("现金");
  605. else
  606. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));
  607. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
  608. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
  609. m_List1array.ElementAt(pos).Add(" ");
  610. pos++;
  611. }
  612. }
  613. else if (m_radio1 == 1)//收入
  614. {
  615. for( i=0; i<List11array.GetSize (); i++)
  616. {
  617. #ifdef DDF_VERSION
  618. if (List11array.ElementAt(i).ElementAt(5) == "客服二销")continue;
  619. #endif
  620. str = List11array.ElementAt(i).ElementAt(0);
  621. str += ";" + List11array.ElementAt(i).ElementAt(3);
  622. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  623. {
  624. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  625. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  626. str += "," + List11array.ElementAt(i).ElementAt(2);
  627. }
  628. else
  629. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  630. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  631. m_List1array.ElementAt (pos).Add(str);
  632. str=List11array.ElementAt (i).ElementAt (4);
  633. m_List1array.ElementAt (pos).Add(str);
  634. #if 0
  635. income += atof(str);
  636. income2 += atof(str);
  637. #else
  638. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款") // 储值卡扣款;
  639. {
  640. income += atof(str);
  641. }
  642. income2 += atof(str);
  643. #endif
  644. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  645. m_List1array.ElementAt(pos).Add("收入");
  646. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  647. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  648. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  649. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  650. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  651. if (List11array.ElementAt(i).ElementAt(5) == "预约收款")
  652. dindanshu++;
  653. pos++;
  654. }
  655. for (i = 0; i < List2array.GetSize(); i++)
  656. {
  657. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  658. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  659. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  660. str.Replace(";;;", ";"); str.Replace(";;", ";");
  661. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  662. m_List1array.ElementAt (pos).Add(str);
  663. str=List2array.ElementAt (i).ElementAt (2);
  664. m_List1array.ElementAt(pos).Add(str);
  665. #if 0
  666. income += atof(str);
  667. #else
  668. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款")
  669. {
  670. income += atof(str);
  671. }
  672. #endif
  673. if (List2array.ElementAt(i).ElementAt(8) != "")
  674. {
  675. income2 += atof(str);
  676. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  677. }
  678. else
  679. m_List1array.ElementAt(pos).Add("其它收入");
  680. m_List1array.ElementAt(pos).Add("收入");
  681. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  682. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  683. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  684. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  685. m_List1array.ElementAt(pos).Add(" ");
  686. pos++;
  687. }
  688. for (i = 0; i < other2salearray.GetSize(); i++)
  689. {
  690. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  691. str.Replace(";;;", ";"); str.Replace(";;", ";");
  692. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  693. m_List1array.ElementAt (pos).Add(str);
  694. str=other2salearray.ElementAt (i).ElementAt (4);
  695. m_List1array.ElementAt (pos).Add(str);
  696. #if 0
  697. income += atof(str);
  698. income2 += atof(str);
  699. #else
  700. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款")
  701. {
  702. income += atof(str);
  703. }
  704. income2 += atof(str);
  705. #endif
  706. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  707. m_List1array.ElementAt(pos).Add("收入");
  708. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  709. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  710. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  711. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  712. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  713. pos++;
  714. }
  715. for (i = 0; i < memberarray.GetSize(); i++)
  716. {
  717. str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";客户:" + memberarray.ElementAt(i).ElementAt(2);
  718. str.Replace(";;;", ";"); str.Replace(";;", ";");
  719. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
  720. m_List1array.ElementAt(pos).Add(str);
  721. str = memberarray.ElementAt(i).ElementAt(3);
  722. m_List1array.ElementAt(pos).Add(str);
  723. income += atof(str);
  724. m_List1array.ElementAt(pos).Add("会员充值");
  725. m_List1array.ElementAt(pos).Add("收入");
  726. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));
  727. if (memberarray.ElementAt(i).ElementAt(7) == "")
  728. m_List1array.ElementAt(pos).Add("现金");
  729. else
  730. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));
  731. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
  732. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
  733. m_List1array.ElementAt(pos).Add(" ");
  734. pos++;
  735. }
  736. }
  737. else if (m_radio1 == 2)//营业收入
  738. {
  739. for( i=0; i<List11array.GetSize (); i++)
  740. {
  741. #ifdef DDF_VERSION
  742. if (List11array.ElementAt(i).ElementAt(5) == "客服二销")continue;
  743. #endif
  744. str = List11array.ElementAt(i).ElementAt(0);
  745. str += ";" + List11array.ElementAt(i).ElementAt(3);
  746. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  747. {
  748. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  749. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  750. str += "," + List11array.ElementAt(i).ElementAt(2);
  751. }
  752. else
  753. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  754. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  755. m_List1array.ElementAt (pos).Add(str);
  756. str=List11array.ElementAt (i).ElementAt (4);
  757. m_List1array.ElementAt (pos).Add(str);
  758. #if 0
  759. income += atof(str);
  760. income2 += atof(str);
  761. #else
  762. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款") // 储值卡扣款;
  763. {
  764. income += atof(str);
  765. }
  766. income2 += atof(str);
  767. #endif
  768. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  769. m_List1array.ElementAt(pos).Add("收入");
  770. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  771. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  772. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  773. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  774. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  775. if (List11array.ElementAt(i).ElementAt(5) == "预约收款")
  776. dindanshu++;
  777. pos++;
  778. }
  779. for (i = 0; i < List2array.GetSize(); i++)
  780. {
  781. if (List2array.ElementAt(i).ElementAt(8) != "")
  782. {
  783. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  784. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  785. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  786. str.Replace(";;;", ";"); str.Replace(";;", ";");
  787. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  788. m_List1array.ElementAt (pos).Add(str);
  789. str=List2array.ElementAt (i).ElementAt (2);
  790. m_List1array.ElementAt (pos).Add(str);
  791. #if 0
  792. income += atof(str);
  793. income2 += atof(str);
  794. #else
  795. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款")
  796. {
  797. income += atof(str);
  798. }
  799. income2 += atof(str);
  800. #endif
  801. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  802. m_List1array.ElementAt(pos).Add("收入");
  803. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  804. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  805. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  806. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  807. m_List1array.ElementAt(pos).Add(" ");
  808. pos++;
  809. }
  810. }
  811. for (i = 0; i < other2salearray.GetSize(); i++)
  812. {
  813. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  814. str.Replace(";;;", ";"); str.Replace(";;", ";");
  815. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  816. m_List1array.ElementAt (pos).Add(str);
  817. str=other2salearray.ElementAt (i).ElementAt (4);
  818. m_List1array.ElementAt (pos).Add(str);
  819. #if 0
  820. income += atof(str);
  821. income2 += atof(str);
  822. #else
  823. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款")
  824. {
  825. income += atof(str);
  826. }
  827. income2 += atof(str);
  828. #endif
  829. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  830. m_List1array.ElementAt(pos).Add("收入");
  831. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  832. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  833. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  834. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  835. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  836. pos++;
  837. }
  838. }
  839. else if (m_radio1 == 3)//支出
  840. {
  841. for (i = 0; i < List3array.GetSize(); i++)
  842. {
  843. if (List3array.ElementAt(i).ElementAt(6).GetLength()>120)
  844. List3array.ElementAt(i).SetAt(6, List3array.ElementAt(i).ElementAt(6).Left(120) + "..");
  845. str = List3array.ElementAt(i).ElementAt(1) + ";" + List3array.ElementAt(i).ElementAt(4) + ";" + List3array.ElementAt(i).ElementAt(6);
  846. str.Replace(";;;;", ";"); str.Replace(";;;", ";"); str.Replace(";;", ";");
  847. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(0));
  848. m_List1array.ElementAt(pos).Add(str);
  849. str = List3array.ElementAt(i).ElementAt(2);
  850. m_List1array.ElementAt(pos).Add(str);
  851. payout += atof(str);
  852. #if JEFF_TEST_ON
  853. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(1));
  854. #else
  855. m_List1array.ElementAt(pos).Add("固定费用");
  856. #endif
  857. m_List1array.ElementAt(pos).Add("支出");
  858. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(3) + " " + List3array.ElementAt(i).ElementAt(8));
  859. m_List1array.ElementAt(pos).Add("现金");
  860. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(5));
  861. m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(7));
  862. m_List1array.ElementAt(pos).Add(" ");
  863. pos++;
  864. }
  865. }
  866. else if (m_radio1 == 4)//定单
  867. {
  868. for (i = 0; i < List11array.GetSize(); i++)
  869. {
  870. if (List11array.ElementAt(i).ElementAt(5) != "预约收款")continue;
  871. dindanshu++;
  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 == 5)//补款
  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. }
  945. else if (m_radio1 == 6)//摄影二销
  946. {
  947. for (i = 0; i < List11array.GetSize(); i++)
  948. {
  949. if (List11array.ElementAt(i).ElementAt(5) != "摄影二销")continue;
  950. str = List11array.ElementAt(i).ElementAt(0);
  951. str += ";" + List11array.ElementAt(i).ElementAt(3);
  952. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  953. {
  954. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  955. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  956. str += "," + List11array.ElementAt(i).ElementAt(2);
  957. }
  958. else
  959. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  960. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  961. m_List1array.ElementAt (pos).Add(str);
  962. str=List11array.ElementAt (i).ElementAt (4);
  963. m_List1array.ElementAt (pos).Add(str);
  964. #if 0
  965. income += atof(str);
  966. income2 += atof(str);
  967. #else
  968. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款") // 储值卡扣款;
  969. {
  970. income += atof(str);
  971. }
  972. income2 += atof(str);
  973. #endif
  974. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  975. m_List1array.ElementAt(pos).Add("收入");
  976. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  977. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  978. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  979. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  980. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  981. pos++;
  982. }
  983. for (i = 0; i < List2array.GetSize(); i++)
  984. {
  985. if (List2array.ElementAt(i).ElementAt(8) == "摄影二销")
  986. {
  987. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  988. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  989. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  990. str.Replace(";;;", ";"); str.Replace(";;", ";");
  991. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  992. m_List1array.ElementAt (pos).Add(str);
  993. str=List2array.ElementAt (i).ElementAt (2);
  994. m_List1array.ElementAt (pos).Add(str);
  995. #if 0
  996. income += atof(str);
  997. income2 += atof(str);
  998. #else
  999. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款")
  1000. {
  1001. income += atof(str);
  1002. }
  1003. income2 += atof(str);
  1004. #endif
  1005. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  1006. m_List1array.ElementAt(pos).Add("收入");
  1007. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  1008. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  1009. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  1010. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  1011. m_List1array.ElementAt(pos).Add(" ");
  1012. pos++;
  1013. }
  1014. }
  1015. for (i = 0; i < other2salearray.GetSize(); i++)
  1016. {
  1017. if (other2salearray.ElementAt(i).ElementAt(3) == "摄影二销")
  1018. {
  1019. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  1020. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1021. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  1022. m_List1array.ElementAt (pos).Add(str);
  1023. str=other2salearray.ElementAt (i).ElementAt (4);
  1024. m_List1array.ElementAt (pos).Add(str);
  1025. #if 0
  1026. income += atof(str);
  1027. income2 += atof(str);
  1028. #else
  1029. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款")
  1030. {
  1031. income += atof(str);
  1032. }
  1033. income2 += atof(str);
  1034. #endif
  1035. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1036. m_List1array.ElementAt(pos).Add("收入");
  1037. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1038. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1039. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1040. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1041. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1042. pos++;
  1043. }
  1044. }
  1045. }
  1046. else if (m_radio1 == 7)//化妆二销
  1047. {
  1048. for (i = 0; i < List11array.GetSize(); i++)
  1049. {
  1050. if (List11array.ElementAt(i).ElementAt(5) != "化妆二销")continue;
  1051. str = List11array.ElementAt(i).ElementAt(0);
  1052. str += ";" + List11array.ElementAt(i).ElementAt(3);
  1053. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  1054. {
  1055. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  1056. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  1057. str += "," + List11array.ElementAt(i).ElementAt(2);
  1058. }
  1059. else
  1060. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  1061. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  1062. m_List1array.ElementAt (pos).Add(str);
  1063. str=List11array.ElementAt (i).ElementAt (4);
  1064. m_List1array.ElementAt (pos).Add(str);
  1065. #if 0
  1066. income += atof(str);
  1067. income2 += atof(str);
  1068. #else
  1069. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款") // 储值卡扣款;
  1070. {
  1071. income += atof(str);
  1072. }
  1073. income2 += atof(str);
  1074. #endif
  1075. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  1076. m_List1array.ElementAt(pos).Add("收入");
  1077. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  1078. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  1079. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  1080. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  1081. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  1082. pos++;
  1083. }
  1084. for (i = 0; i < List2array.GetSize(); i++)
  1085. {
  1086. if (List2array.ElementAt(i).ElementAt(8) == "化妆二销")
  1087. {
  1088. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  1089. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  1090. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  1091. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1092. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  1093. m_List1array.ElementAt (pos).Add(str);
  1094. str=List2array.ElementAt (i).ElementAt (2);
  1095. m_List1array.ElementAt (pos).Add(str);
  1096. #if 0
  1097. income += atof(str);
  1098. income2 += atof(str);
  1099. #else
  1100. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款")
  1101. {
  1102. income += atof(str);
  1103. }
  1104. income2 += atof(str);
  1105. #endif
  1106. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  1107. m_List1array.ElementAt(pos).Add("收入");
  1108. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  1109. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  1110. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  1111. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  1112. m_List1array.ElementAt(pos).Add(" ");
  1113. pos++;
  1114. }
  1115. }
  1116. for (i = 0; i < other2salearray.GetSize(); i++)
  1117. {
  1118. if (other2salearray.ElementAt(i).ElementAt(3) == "化妆二销")
  1119. {
  1120. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  1121. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1122. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  1123. m_List1array.ElementAt (pos).Add(str);
  1124. str=other2salearray.ElementAt (i).ElementAt (4);
  1125. m_List1array.ElementAt (pos).Add(str);
  1126. #if 0
  1127. income += atof(str);
  1128. income2 += atof(str);
  1129. #else
  1130. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款")
  1131. {
  1132. income += atof(str);
  1133. }
  1134. income2 += atof(str);
  1135. #endif
  1136. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1137. m_List1array.ElementAt(pos).Add("收入");
  1138. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1139. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1140. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1141. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1142. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1143. pos++;
  1144. }
  1145. }
  1146. }
  1147. else if (m_radio1 == 8)//套系升级二销
  1148. {
  1149. /* for( i=0; i<List11array.GetSize (); i++)
  1150. {
  1151. if(List11array.ElementAt (i).ElementAt (5)!="套系升级二销")continue;
  1152. str=List11array.ElementAt (i).ElementAt (0);
  1153. str+=";"+List11array.ElementAt (i).ElementAt (3);
  1154. if(!List11array.ElementAt (i).ElementAt (1).IsEmpty ())
  1155. {
  1156. str+=";客户:"+List11array.ElementAt (i).ElementAt (1);
  1157. if(!List11array.ElementAt (i).ElementAt (2).IsEmpty ())
  1158. str+=","+List11array.ElementAt (i).ElementAt (2);
  1159. }
  1160. else
  1161. str+=";客户:"+List11array.ElementAt (i).ElementAt (2);
  1162. m_List1array.ElementAt (pos).Add(List11array.ElementAt (i).ElementAt (10));
  1163. m_List1array.ElementAt (pos).Add(str);
  1164. str=List11array.ElementAt (i).ElementAt (4);
  1165. m_List1array.ElementAt (pos).Add(str);
  1166. income+=atof(str);
  1167. income2+=atof(str);
  1168. m_List1array.ElementAt (pos).Add(List11array.ElementAt (i).ElementAt (5));
  1169. m_List1array.ElementAt (pos).Add("收入");
  1170. m_List1array.ElementAt (pos).Add(List11array.ElementAt (i).ElementAt (7)+" "+List11array.ElementAt (i).ElementAt (13));
  1171. m_List1array.ElementAt (pos).Add(List11array.ElementAt (i).ElementAt (8));
  1172. m_List1array.ElementAt (pos).Add(List11array.ElementAt (i).ElementAt (9));
  1173. m_List1array.ElementAt (pos).Add(List11array.ElementAt (i).ElementAt (11));
  1174. m_List1array.ElementAt (pos).Add(List11array.ElementAt (i).ElementAt (12));
  1175. pos++;
  1176. }
  1177. for( i=0; i<List2array.GetSize (); i++)
  1178. {
  1179. if(List2array.ElementAt (i).ElementAt (8)=="套系升级二销")
  1180. {
  1181. if(List2array.ElementAt (i).ElementAt (7).GetLength ()>120)
  1182. List2array.ElementAt (i).SetAt (7, List2array.ElementAt (i).ElementAt (7).Left (120)+"..");
  1183. str=List2array.ElementAt (i).ElementAt (1)+";"+List2array.ElementAt (i).ElementAt (4)+";"+List2array.ElementAt (i).ElementAt (6)+";"+List2array.ElementAt (i).ElementAt (7);
  1184. str.Replace (";;;", ";");str.Replace (";;", ";");
  1185. m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (0));
  1186. m_List1array.ElementAt (pos).Add(str);
  1187. str=List2array.ElementAt (i).ElementAt (2);
  1188. m_List1array.ElementAt (pos).Add(str);
  1189. income+=atof(str);
  1190. income2+=atof(str);
  1191. m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (8));
  1192. m_List1array.ElementAt (pos).Add("收入");
  1193. m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (3)+" "+List2array.ElementAt (i).ElementAt (11));
  1194. m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (9));
  1195. m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (5));
  1196. m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (10));
  1197. m_List1array.ElementAt (pos).Add(" ");
  1198. pos++;
  1199. }
  1200. }
  1201. for( i=0; i<other2salearray.GetSize (); i++)
  1202. {
  1203. if(other2salearray.ElementAt (i).ElementAt (3)=="套系升级二销")
  1204. {
  1205. str=other2salearray.ElementAt (i).ElementAt (0)+";"+other2salearray.ElementAt (i).ElementAt (1)+";"+other2salearray.ElementAt (i).ElementAt (2);
  1206. str.Replace (";;;", ";");str.Replace (";;", ";");
  1207. m_List1array.ElementAt (pos).Add(other2salearray.ElementAt (i).ElementAt (8));
  1208. m_List1array.ElementAt (pos).Add(str);
  1209. str=other2salearray.ElementAt (i).ElementAt (4);
  1210. m_List1array.ElementAt (pos).Add(str);
  1211. income+=atof(str);
  1212. income2+=atof(str);
  1213. m_List1array.ElementAt (pos).Add(other2salearray.ElementAt (i).ElementAt (3));
  1214. m_List1array.ElementAt (pos).Add("收入");
  1215. m_List1array.ElementAt (pos).Add(other2salearray.ElementAt (i).ElementAt (5)+" "+other2salearray.ElementAt (i).ElementAt (10));
  1216. m_List1array.ElementAt (pos).Add(other2salearray.ElementAt (i).ElementAt (7));
  1217. m_List1array.ElementAt (pos).Add(other2salearray.ElementAt (i).ElementAt (6));
  1218. m_List1array.ElementAt (pos).Add(other2salearray.ElementAt (i).ElementAt (9));
  1219. m_List1array.ElementAt (pos).Add(" ");
  1220. pos++;
  1221. }
  1222. }*/
  1223. for (i = 0; i < memberarray.GetSize(); i++)
  1224. {
  1225. str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";客户:" + memberarray.ElementAt(i).ElementAt(2);
  1226. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1227. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
  1228. m_List1array.ElementAt(pos).Add(str);
  1229. str = memberarray.ElementAt(i).ElementAt(3);
  1230. m_List1array.ElementAt(pos).Add(str);
  1231. income += atof(str);
  1232. m_List1array.ElementAt(pos).Add("会员充值");
  1233. m_List1array.ElementAt(pos).Add("收入");
  1234. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));
  1235. if (memberarray.ElementAt(i).ElementAt(7) == "")
  1236. m_List1array.ElementAt(pos).Add("现金");
  1237. else
  1238. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));
  1239. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
  1240. m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
  1241. m_List1array.ElementAt(pos).Add(" ");
  1242. pos++;
  1243. }
  1244. }
  1245. else if (m_radio1 == 9)//选片加挑
  1246. {
  1247. for (i = 0; i < List11array.GetSize(); i++)
  1248. {
  1249. if (List11array.ElementAt(i).ElementAt(5) != "选片二销")continue;
  1250. str = List11array.ElementAt(i).ElementAt(0);
  1251. str += ";" + List11array.ElementAt(i).ElementAt(3);
  1252. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  1253. {
  1254. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  1255. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  1256. str += "," + List11array.ElementAt(i).ElementAt(2);
  1257. }
  1258. else
  1259. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  1260. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  1261. m_List1array.ElementAt (pos).Add(str);
  1262. str=List11array.ElementAt (i).ElementAt (4);
  1263. m_List1array.ElementAt (pos).Add(str);
  1264. #if 0
  1265. income += atof(str);
  1266. income2 += atof(str);
  1267. #else
  1268. if (List11array.ElementAt(i).ElementAt(8) != "储值卡扣款") // 储值卡扣款;
  1269. {
  1270. income += atof(str);
  1271. }
  1272. income2 += atof(str);
  1273. #endif
  1274. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  1275. m_List1array.ElementAt(pos).Add("收入");
  1276. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  1277. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  1278. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  1279. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  1280. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  1281. pos++;
  1282. }
  1283. for (i = 0; i < List2array.GetSize(); i++)
  1284. {
  1285. if (List2array.ElementAt(i).ElementAt(8) == "选片二销")
  1286. {
  1287. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  1288. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  1289. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  1290. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1291. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  1292. m_List1array.ElementAt (pos).Add(str);
  1293. str=List2array.ElementAt (i).ElementAt (2);
  1294. m_List1array.ElementAt (pos).Add(str);
  1295. #if 0
  1296. income += atof(str);
  1297. income2 += atof(str);
  1298. #else
  1299. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款")
  1300. {
  1301. income += atof(str);
  1302. }
  1303. income2 += atof(str);
  1304. #endif
  1305. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
  1306. m_List1array.ElementAt(pos).Add("收入");
  1307. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  1308. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  1309. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  1310. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  1311. m_List1array.ElementAt(pos).Add(" ");
  1312. pos++;
  1313. }
  1314. }
  1315. for (i = 0; i < other2salearray.GetSize(); i++)
  1316. {
  1317. if (other2salearray.ElementAt(i).ElementAt(3) == "选片二销")
  1318. {
  1319. str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
  1320. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1321. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
  1322. m_List1array.ElementAt (pos).Add(str);
  1323. str=other2salearray.ElementAt (i).ElementAt (4);
  1324. m_List1array.ElementAt (pos).Add(str);
  1325. #if 0
  1326. income += atof(str);
  1327. income2 += atof(str);
  1328. #else
  1329. if (other2salearray.ElementAt(i).ElementAt(7) != "储值卡扣款")
  1330. {
  1331. income += atof(str);
  1332. }
  1333. income2 += atof(str);
  1334. #endif
  1335. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));
  1336. m_List1array.ElementAt(pos).Add("收入");
  1337. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
  1338. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
  1339. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
  1340. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
  1341. m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
  1342. pos++;
  1343. }
  1344. }
  1345. }
  1346. else if (m_radio1 == 10)//其它收入
  1347. {
  1348. for (i = 0; i < List2array.GetSize(); i++)
  1349. {
  1350. if (List2array.ElementAt(i).ElementAt(8) != "")continue;
  1351. if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
  1352. List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
  1353. str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
  1354. str.Replace(";;;", ";"); str.Replace(";;", ";");
  1355. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
  1356. m_List1array.ElementAt (pos).Add(str);
  1357. str=List2array.ElementAt (i).ElementAt (2);
  1358. m_List1array.ElementAt(pos).Add(str);
  1359. #if 0
  1360. income += atof(str);
  1361. #else
  1362. if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款")
  1363. {
  1364. income += atof(str);
  1365. }
  1366. #endif
  1367. m_List1array.ElementAt(pos).Add("其它收入");
  1368. m_List1array.ElementAt(pos).Add("收入");
  1369. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
  1370. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
  1371. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
  1372. m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
  1373. m_List1array.ElementAt(pos).Add(" ");
  1374. pos++;
  1375. }
  1376. }
  1377. m_List1array.SetSize(pos);
  1378. str.Format("%0.2f", income);
  1379. ::ConvertToPrice(str);
  1380. SetDlgItemText(IDC_EDITmoney1, str);
  1381. str.Format("%0.2f", income2);
  1382. ::ConvertToPrice(str);
  1383. SetDlgItemText(IDC_EDITmoney5, str);
  1384. str.Format("%0.2f", payout);
  1385. ::ConvertToPrice(str);
  1386. SetDlgItemText(IDC_EDITmoney2, str);
  1387. str.Format("%0.2f", income - payout);
  1388. ::ConvertToPrice(str);
  1389. SetDlgItemText(IDC_EDITmoney3, str);
  1390. str.Format("%d", dindanshu);
  1391. SetDlgItemText(IDC_EDITmoney4, str);
  1392. FillGrid();
  1393. }
  1394. void MonthForm::OnRadio3()
  1395. {
  1396. UpdateData();
  1397. KindChange();
  1398. }
  1399. void MonthForm::OnRadio4()
  1400. {
  1401. UpdateData();
  1402. KindChange();
  1403. }
  1404. void MonthForm::OnRadio5()
  1405. {
  1406. UpdateData();
  1407. KindChange();
  1408. }
  1409. void MonthForm::OnRadio6()
  1410. {
  1411. UpdateData();
  1412. m_filter.Empty();
  1413. KindChange();
  1414. }
  1415. void MonthForm::OnRadio7()
  1416. {
  1417. UpdateData();
  1418. KindChange();
  1419. }
  1420. void MonthForm::OnRadio8()
  1421. {
  1422. UpdateData();
  1423. KindChange();
  1424. }
  1425. void MonthForm::OnRadio9()
  1426. {
  1427. UpdateData();
  1428. KindChange();
  1429. }
  1430. void MonthForm::OnRadio10()
  1431. {
  1432. UpdateData();
  1433. KindChange();
  1434. }
  1435. void MonthForm::OnRadio11()
  1436. {
  1437. UpdateData();
  1438. KindChange();
  1439. }
  1440. void MonthForm::OnRadio12()
  1441. {
  1442. UpdateData();
  1443. KindChange();
  1444. }
  1445. void MonthForm::OnRadio13()
  1446. {
  1447. UpdateData();
  1448. KindChange();
  1449. }
  1450. void MonthForm::OnBUTprint()
  1451. {
  1452. if (m_List1.GetItemCount() == 0)
  1453. {
  1454. AfxMessageBox("无内容!", MB_ICONINFORMATION);
  1455. return;
  1456. }
  1457. CArray<CStringArray, CStringArray>Listarray;
  1458. CString str, temp;
  1459. m_static1.GetWindowText(str);
  1460. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + str;
  1461. int count = m_List1.GetItemCount() / 45;
  1462. if (m_List1.GetItemCount() % 45)count++;
  1463. Listarray.SetSize(m_List1.GetItemCount() + count, 1);
  1464. int pos = 0;
  1465. float otherpaytype1 = 0;
  1466. float otherpaytype2 = 0;
  1467. float otherpaytype3 = 0;
  1468. int addpos = 1;
  1469. for (int i = 0; i < m_List1.GetItemCount(); i++)
  1470. {
  1471. if (i % 45 == 0)
  1472. {
  1473. Listarray.ElementAt(pos).Add("项目名称");
  1474. Listarray.ElementAt(pos).Add("金额");
  1475. Listarray.ElementAt(pos).Add("项目类别");
  1476. Listarray.ElementAt(pos).Add("收入/支出");
  1477. pos++;
  1478. }
  1479. for (int j = 0; j < 3; j++)
  1480. Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, j + addpos));
  1481. Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 3 + addpos) + "/" + m_List1.GetItemText(i, 5 + addpos));
  1482. if (m_List1.GetItemText(i, 5 + addpos) == "POS机刷卡")
  1483. otherpaytype1 += atof(m_List1.GetItemText(i, 1 + addpos));
  1484. else if (m_List1.GetItemText(i, 5 + addpos) == "储值卡扣款")
  1485. otherpaytype2 += atof(m_List1.GetItemText(i, 1 + addpos));
  1486. else if (m_List1.GetItemText(i, 5 + addpos) == "积分兑换")
  1487. otherpaytype3 += atof(m_List1.GetItemText(i, 1 + addpos));
  1488. pos++;
  1489. }
  1490. Listarray.SetSize(pos, 1);
  1491. str = "总收入:";
  1492. GetDlgItemText(IDC_EDITmoney1, temp); str += temp;
  1493. str += " 营业收入:";
  1494. GetDlgItemText(IDC_EDITmoney5, temp); str += temp;
  1495. str += " 总支出:";
  1496. GetDlgItemText(IDC_EDITmoney2, temp); str += temp;
  1497. str += " 净收入:";
  1498. GetDlgItemText(IDC_EDITmoney3, temp); str += temp;
  1499. str += " 定单数:";
  1500. GetDlgItemText(IDC_EDITmoney4, temp); str += temp;
  1501. str += "***";
  1502. temp.Format("POS机刷卡:%d", (int)otherpaytype1);
  1503. str += temp;
  1504. temp.Format(" 储值卡扣款:%d", (int)otherpaytype2);
  1505. str += temp;
  1506. temp.Format(" 积分兑换:%d", (int)otherpaytype3);
  1507. str += temp;
  1508. CString ss;
  1509. GetDlgItemText(IDC_EDITmoney3, ss);
  1510. //temp.Format (" 现金:%d", (int) (atof(ss)-(otherpaytype1+otherpaytype2+otherpaytype3)) );
  1511. temp.Format(" 柜台现金:%d", (int)(atof(ss) - (otherpaytype1 + otherpaytype3)));
  1512. str += temp;
  1513. g_pMainWnd->PrintDailyForm(&Listarray, title, str);
  1514. }
  1515. void MonthForm::TypeChange(CString str)
  1516. {
  1517. m_filter = str;
  1518. FillGrid();
  1519. }
  1520. void MonthForm::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
  1521. {
  1522. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
  1523. // Take the default processing unless we set this to something else below.
  1524. *pResult = 0;
  1525. // First thing - check the draw stage. If it's the control's prepaint
  1526. // stage, then tell Windows we want messages for every item.
  1527. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
  1528. {
  1529. *pResult = CDRF_NOTIFYITEMDRAW;
  1530. }
  1531. else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
  1532. {
  1533. // This is the prepaint stage for an item. Here's where we set the
  1534. // item's text color. Our return value will tell Windows to draw the
  1535. // item itself, but it will use the new color we set here.
  1536. // We'll cycle the colors through red, green, and light blue.
  1537. if (m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8).Find("已审核") == -1)
  1538. pLVCD->clrText = RGB(220, 0, 0);
  1539. else
  1540. pLVCD->clrText = RGB(20, 133, 20);
  1541. if (pLVCD->nmcd.dwItemSpec % 2)
  1542. pLVCD->clrTextBk = g_gridcol1;
  1543. else
  1544. pLVCD->clrTextBk = g_gridcol2;
  1545. // Store the color back in the NMLVCUSTOMDRAW struct.
  1546. // Tell Windows to paint the control itself.
  1547. *pResult = CDRF_DODEFAULT;
  1548. }
  1549. }
  1550. void MonthForm::OnBUTprint5()
  1551. {
  1552. CString str;
  1553. m_static1.GetWindowText(str);
  1554. ListToXLS(&m_List1, "c:\\" + str + ".xls", 1);
  1555. }
  1556. void MonthForm::OnBUTprint4()
  1557. {
  1558. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  1559. {
  1560. SelExpendType dlg;
  1561. dlg.m_mode = 3;
  1562. if (dlg.DoModal() == IDOK)
  1563. {
  1564. m_jdd = dlg.m_sel;
  1565. FillGrid();
  1566. }
  1567. }
  1568. }
  1569. void MonthForm::OnRadio14()
  1570. {
  1571. UpdateData();
  1572. if (m_radio2 == 0)m_bForKF = 0;
  1573. else
  1574. {
  1575. m_bForKF = 1;
  1576. }
  1577. KindChange();
  1578. }
  1579. void MonthForm::OnRadio15()
  1580. {
  1581. OnRadio14();
  1582. }
  1583. void MonthForm::KindChange2()
  1584. {
  1585. m_jdd = "";
  1586. CString str;
  1587. int pos = 0;
  1588. int dindanshu = 0;
  1589. float income = 0;
  1590. float income2 = 0;
  1591. float payout = 0;
  1592. int count = List2array.GetSize() + List3array.GetSize() + List11array.GetSize() + other2salearray.GetSize() + memberarray.GetSize();
  1593. m_List1array.RemoveAll();
  1594. m_List1array.SetSize(count);
  1595. int i = 0;
  1596. {
  1597. m_filter.Empty();
  1598. if (payoutdlg.GetSafeHwnd())payoutdlg.ShowWindow(SW_HIDE);
  1599. }
  1600. for (i = 0; i < memberarray.GetSize(); i++)
  1601. {
  1602. if (memberarray.ElementAt(i).ElementAt(6).IsEmpty())
  1603. memberarray.ElementAt(i).SetAt(6, "未审核");
  1604. memberarray.ElementAt(i).SetAt(0, memberarray.ElementAt(i).ElementAt(0) + ":4");
  1605. }
  1606. for (i = 0; i < List2array.GetSize(); i++)
  1607. {
  1608. if (List2array.ElementAt(i).ElementAt(10).IsEmpty())
  1609. List2array.ElementAt(i).SetAt(10, "未审核");
  1610. List2array.ElementAt(i).SetAt(0, List2array.ElementAt(i).ElementAt(0) + ":0");
  1611. }
  1612. for (i = 0; i < List3array.GetSize(); i++)
  1613. {
  1614. if (List3array.ElementAt(i).ElementAt(7).IsEmpty())
  1615. List3array.ElementAt(i).SetAt(7, "未审核");
  1616. List3array.ElementAt(i).SetAt(0, List3array.ElementAt(i).ElementAt(0) + ":1");
  1617. }
  1618. for (i = 0; i < List11array.GetSize(); i++)
  1619. {
  1620. if (List11array.ElementAt(i).ElementAt(11).IsEmpty())
  1621. List11array.ElementAt(i).SetAt(11, "未审核");
  1622. List11array.ElementAt(i).SetAt(10, List11array.ElementAt(i).ElementAt(10) + ":2");
  1623. }
  1624. for (i = 0; i < other2salearray.GetSize(); i++)
  1625. {
  1626. if (other2salearray.ElementAt(i).ElementAt(9).IsEmpty())
  1627. other2salearray.ElementAt(i).SetAt(9, "未审核");
  1628. other2salearray.ElementAt(i).SetAt(8, other2salearray.ElementAt(i).ElementAt(8) + ":3");
  1629. }
  1630. //if(m_radio1==2)//营业收入
  1631. {
  1632. for (i = 0; i < List11array.GetSize(); i++)
  1633. {
  1634. if (List11array.ElementAt(i).ElementAt(5) != "客服二销")continue;
  1635. str = List11array.ElementAt(i).ElementAt(0);
  1636. str += ";" + List11array.ElementAt(i).ElementAt(3);
  1637. if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
  1638. {
  1639. str += ";客户:" + List11array.ElementAt(i).ElementAt(1);
  1640. if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
  1641. str += "," + List11array.ElementAt(i).ElementAt(2);
  1642. }
  1643. else
  1644. str += ";客户:" + List11array.ElementAt(i).ElementAt(2);
  1645. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
  1646. m_List1array.ElementAt(pos).Add(str);
  1647. str = List11array.ElementAt(i).ElementAt(4);
  1648. m_List1array.ElementAt(pos).Add(str);
  1649. income += atof(str);
  1650. income2 += atof(str);
  1651. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
  1652. m_List1array.ElementAt(pos).Add("收入");
  1653. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
  1654. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
  1655. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
  1656. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
  1657. m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
  1658. pos++;
  1659. }
  1660. }
  1661. m_List1array.SetSize(pos);
  1662. str.Format("%0.2f", income);
  1663. ::ConvertToPrice(str);
  1664. SetDlgItemText(IDC_EDITmoney1, str);
  1665. str.Format("%0.2f", income);
  1666. ::ConvertToPrice(str);
  1667. SetDlgItemText(IDC_EDITmoney5, str);
  1668. str.Format("%0.2f", 0);
  1669. ::ConvertToPrice(str);
  1670. SetDlgItemText(IDC_EDITmoney2, str);
  1671. str.Format("%0.2f", income);
  1672. ::ConvertToPrice(str);
  1673. SetDlgItemText(IDC_EDITmoney3, str);
  1674. str.Format("%d", 0);
  1675. SetDlgItemText(IDC_EDITmoney4, str);
  1676. FillGrid();
  1677. }