DailyForm.cpp 73 KB

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