w_rp_combine.srw 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. $PBExportHeader$w_rp_combine.srw
  2. forward
  3. global type w_rp_combine from w_publ_easyq
  4. end type
  5. type cb_3 from uo_imflatbutton within w_rp_combine
  6. end type
  7. type st_1 from statictext within w_rp_combine
  8. end type
  9. type ddlb_1 from dropdownlistbox within w_rp_combine
  10. end type
  11. end forward
  12. global type w_rp_combine from w_publ_easyq
  13. string title = "资产负债表|损益表"
  14. cb_3 cb_3
  15. st_1 st_1
  16. ddlb_1 ddlb_1
  17. end type
  18. global w_rp_combine w_rp_combine
  19. type variables
  20. Long cur_rpid
  21. Int cur_rptype
  22. end variables
  23. forward prototypes
  24. public subroutine wf_ddlb ()
  25. public subroutine wf_face ()
  26. end prototypes
  27. public subroutine wf_ddlb ();Long ls_rpid
  28. String ls_rpname
  29. Long ll_i
  30. String ls_space
  31. Int li_spacenum
  32. ddlb_1.reset()
  33. DECLARE cur_rp CURSOR FOR
  34. SELECT cw_rp.rpid,
  35. cw_rp.rpname
  36. from cw_rp
  37. Order By cw_rp.rpcode;
  38. OPEN cur_rp;
  39. FETCH cur_rp Into :ls_rpid,:ls_rpname ;
  40. DO WHILE sqlca.SQLCode = 0
  41. li_spacenum = 50 - Len(Trim(ls_rpname)) - 2 - Len(String(ls_rpid))
  42. ls_space = Fill(' ',li_spacenum)
  43. ddlb_1.AddItem (ls_rpname+ls_space+'['+String(ls_rpid)+']')
  44. ll_i++
  45. IF ll_i = 1 THEN
  46. cur_rpid = ls_rpid
  47. ddlb_1.Text = ls_rpname+ls_space+'['+String(ls_rpid)+']'
  48. END IF
  49. FETCH cur_rp Into :ls_rpid,:ls_rpname ;
  50. LOOP
  51. CLOSE cur_rp;
  52. end subroutine
  53. public subroutine wf_face ();Long ll_row,i,j
  54. Long ll_mth
  55. Long ll_rpid
  56. Int li_rptype
  57. String ls_col1name,ls_col2name,ls_col1name_addname,ls_col2name_addname,ls_rpname
  58. IF cur_rpid <= 0 THEN
  59. dw_1.Reset()
  60. RETURN
  61. END IF
  62. ll_rpid = cur_rpid
  63. SELECT rptype,
  64. rpname,
  65. col1name,
  66. col2name,
  67. col1name_addname,
  68. col2name_addname
  69. INTO :li_rptype,
  70. :ls_rpname,
  71. :ls_col1name,
  72. :ls_col2name,
  73. :ls_col1name_addname,
  74. :ls_col2name_addname
  75. From u_rp Where rpid = :ll_rpid;
  76. IF sqlca.SQLCode <> 0 THEN
  77. dw_1.Reset()
  78. RETURN
  79. END IF
  80. cur_rptype = li_rptype
  81. dw_1.Retrieve(cur_rpid)
  82. dw_1.Object.rpname.Text = ls_rpname
  83. //改标题及列宽
  84. Long ls_dwidth,ls_dwidth2
  85. IF li_rptype = 0 THEN
  86. ls_dwidth = 600
  87. ls_dwidth2 = 1800
  88. ELSE
  89. ls_dwidth = 430
  90. ls_dwidth2 = 800
  91. END IF
  92. //1
  93. j = 1
  94. dw_1.Modify("col1_amt"+String(j,'00')+"_t.width='"+String(ls_dwidth)+"'")
  95. dw_1.Modify("col1_amt"+String(j,'00')+".width='"+String(ls_dwidth)+"'")
  96. dw_1.Modify("col1_amt"+String(j,'00')+"_t.text='" + ls_col1name_addname+"'")
  97. //2
  98. dw_1.Modify("col1_amt"+String(j,'00')+"_2_t.width='"+String(ls_dwidth)+"'")
  99. dw_1.Modify("col1_amt"+String(j,'00')+"_2.width='"+String(ls_dwidth)+"'")
  100. dw_1.Modify("col1_amt"+String(j,'00')+"_2_t.text='" + ls_col2name_addname+"'")
  101. dw_1.Object.col1_name_t.Text = ls_col1name
  102. dw_1.Modify("col1_name_t.width='"+String(ls_dwidth2)+"'")
  103. dw_1.Modify("col1_name.width='"+String(ls_dwidth2)+"'")
  104. IF li_rptype = 0 THEN
  105. //项目
  106. dw_1.Modify("col2_name_t.visible=false")
  107. dw_1.Modify("col2_name.visible=false")
  108. //1
  109. dw_1.Modify("col2_amt"+String(j,'00')+"_t.visible=false")
  110. dw_1.Modify("col2_amt"+String(j,'00')+".visible=false")
  111. //2
  112. dw_1.Modify("col2_amt"+String(j,'00')+"_2_t.visible=false")
  113. dw_1.Modify("col2_amt"+String(j,'00')+"_2.visible=false")
  114. ELSE
  115. dw_1.Object.col2_name_t.Text = ls_col2name
  116. dw_1.Modify("col2_name_t.width='"+String(ls_dwidth2)+"'")
  117. dw_1.Modify("col2_name.width='"+String(ls_dwidth2)+"'")
  118. dw_1.Modify("col2_amt"+String(j,'00')+"_t.width='"+String(ls_dwidth)+"'")
  119. dw_1.Modify("col2_amt"+String(j,'00')+".width='"+String(ls_dwidth)+"'")
  120. dw_1.Modify("col2_amt"+String(j,'00')+"_t.text='" + ls_col1name_addname+"'")
  121. //2
  122. dw_1.Modify("col2_amt"+String(j,'00')+"_2_t.width='"+String(ls_dwidth)+"'")
  123. dw_1.Modify("col2_amt"+String(j,'00')+"_2.width='"+String(ls_dwidth)+"'")
  124. dw_1.Modify("col2_amt"+String(j,'00')+"_2_t.text='" + ls_col2name_addname+"'")
  125. END IF
  126. //
  127. end subroutine
  128. on w_rp_combine.create
  129. int iCurrent
  130. call super::create
  131. this.cb_3=create cb_3
  132. this.st_1=create st_1
  133. this.ddlb_1=create ddlb_1
  134. iCurrent=UpperBound(this.Control)
  135. this.Control[iCurrent+1]=this.cb_3
  136. this.Control[iCurrent+2]=this.st_1
  137. this.Control[iCurrent+3]=this.ddlb_1
  138. end on
  139. on w_rp_combine.destroy
  140. call super::destroy
  141. destroy(this.cb_3)
  142. destroy(this.st_1)
  143. destroy(this.ddlb_1)
  144. end on
  145. event resize;call super::resize;
  146. //dw_3.Height = dw_2.Y - dw_3.Y - 5
  147. end event
  148. event open;THIS.TriggerEvent('ue_before_open')
  149. wf_movetocenter()
  150. dw_1.SetTransObject (sqlca)
  151. dw_1.RBUTTON_FILTER_USE = TRUE //右键查询功能开关
  152. IF Trim(dw_1.DataObject) <> '' THEN
  153. dw_1.Object.DataWindow.Print.MARGIN.Top = Integer(ProfileString(sys_inifilename,dw_1.DataObject, "MARGIN_TOP", "110"))
  154. dw_1.Object.DataWindow.Print.MARGIN.Left = Integer(ProfileString(sys_inifilename,dw_1.DataObject, "MARGIN_LEFT", "96" ))
  155. dw_1.Object.DataWindow.Print.MARGIN.bottom = Integer(ProfileString(sys_inifilename,dw_1.DataObject, "MARGIN_BOTTOM", "110"))
  156. dw_1.Object.DataWindow.Print.MARGIN.Right = Integer(ProfileString(sys_inifilename,dw_1.DataObject, "MARGIN_RIGHT", "96" ))
  157. END IF
  158. wf_ddlb()
  159. wf_face()
  160. end event
  161. type cb_func from w_publ_easyq`cb_func within w_rp_combine
  162. integer x = 549
  163. integer width = 165
  164. string text = "功能"
  165. end type
  166. type cb_exit from w_publ_easyq`cb_exit within w_rp_combine
  167. integer x = 1376
  168. end type
  169. type cb_2 from w_publ_easyq`cb_2 within w_rp_combine
  170. integer x = 969
  171. end type
  172. event cb_2::clicked;call super::clicked;IF NOT (f_power_ind(1999,sys_msg_pow)) THEN
  173. MessageBox(publ_operator,'你没有使用权限!')
  174. RETURN
  175. END IF
  176. end event
  177. type cb_psetup from w_publ_easyq`cb_psetup within w_rp_combine
  178. integer x = 1120
  179. end type
  180. type cb_1 from w_publ_easyq`cb_1 within w_rp_combine
  181. integer width = 274
  182. string text = "统计"
  183. end type
  184. event cb_1::clicked;call super::clicked;//统计
  185. Long ll_rpid,j
  186. Int li_rptype
  187. Long ll_col,ll_col1,ll_col2
  188. Long ll_insert,ll_mth
  189. Decimal ld_amt,ld_amt2
  190. String ls_formula,ls_var,ls_var2
  191. Long l,m
  192. Long ll_array
  193. String ls_subid_array[],ls_subid
  194. Long ll_rowid_array[]
  195. String ls_code_array[],ls_code
  196. Int li_rowcmpltype
  197. Long ll_pos_dot1,ll_pos_dot2
  198. datastore ds_col1,ds_col2,ds_col_cmpl
  199. s_edit_index_tran s_rst
  200. Open(w_rp_zcfzb_create)
  201. s_rst = Message.PowerObjectParm
  202. ll_mth = s_rst.b_long
  203. ll_rpid = cur_rpid
  204. li_rptype = cur_rptype
  205. //1栏
  206. ds_col1 = Create datastore
  207. ds_col1.DataObject = 'ds_rp_combine_row'
  208. ds_col1.SetTransObject(sqlca)
  209. ll_col1 = ds_col1.Retrieve(ll_rpid,0)
  210. //2栏
  211. IF li_rptype = 1 THEN
  212. ds_col2 = Create datastore
  213. ds_col2.DataObject = 'ds_rp_combine_row'
  214. ds_col2.SetTransObject(sqlca)
  215. ll_col2 = ds_col2.Retrieve(ll_rpid,1)
  216. END IF
  217. ds_col_cmpl = Create datastore
  218. ds_col_cmpl.DataObject = 'ds_rp_combine_row_cmpl'
  219. ds_col_cmpl.SetTransObject(sqlca)
  220. ll_col = Max(ll_col1,ll_col2)
  221. dw_1.reset()
  222. Open(w_sys_wait_jdt) //初始化进度条
  223. w_sys_wait_jdt.Show()
  224. w_sys_wait_jdt.wf_accepttol(ll_col) //初始化进度条1
  225. FOR j = 1 To ll_col
  226. w_sys_wait_jdt.wf_inc(j) //进度
  227. ll_insert = dw_1.InsertRow(0)
  228. IF j <= ll_col1 THEN
  229. dw_1.Object.col1_name[ll_insert] = ds_col1.Object.rowname[j]
  230. dw_1.Object.col1_rowid01[ll_insert] = ds_col1.Object.rowid[j]
  231. w_sys_wait_jdt.st_msg.Text = "正在读取数据:"+ds_col1.Object.rowname[j]+'...' //进度信息
  232. ld_amt = 0
  233. ld_amt2 = 0
  234. ds_col_cmpl.Retrieve(ds_col1.Object.rowid[j],sys_accsetid)
  235. IF ds_col_cmpl.RowCount() = 0 THEN
  236. ld_amt = 0
  237. ld_amt2 = 0
  238. ELSE
  239. ls_var = ds_col_cmpl.Object.formulavar[1]
  240. ls_var2 = ds_col_cmpl.Object.cw_rp_row_formula_formulavar2[1]
  241. ls_formula = ds_col_cmpl.Object.rowformula[1]
  242. li_rowcmpltype = ds_col_cmpl.Object.cw_rp_rowdef_rowcmpltype[1]
  243. CHOOSE CASE li_rowcmpltype
  244. CASE 0
  245. ld_amt = 0
  246. ld_amt2 = 0
  247. CASE 1
  248. ll_array = 0
  249. ll_pos_dot1 = 0
  250. ll_pos_dot2 = 0
  251. ls_code = '+'
  252. IF ls_formula = '' Or ls_var = '' THEN
  253. ld_amt = 0
  254. ld_amt2 = 0
  255. ELSE
  256. DO WHILE ls_formula <> ''
  257. ll_pos_dot1 = Pos(ls_formula,'+')
  258. ll_pos_dot2 = Pos(ls_formula,'-')
  259. IF ll_pos_dot1 = 0 And ll_pos_dot2 = 0 THEN
  260. ll_array++
  261. ls_subid_array[ll_array] = ls_formula
  262. ls_code_array[ll_array] = ls_code
  263. ls_formula = ''
  264. ELSEIF ll_pos_dot1 > 0 And ll_pos_dot2 = 0 Or ll_pos_dot1 = 0 And ll_pos_dot2 > 0 THEN
  265. ll_array++
  266. ls_subid_array[ll_array] = Left(ls_formula,Max(ll_pos_dot1,ll_pos_dot2) - 1)
  267. ls_formula = Mid(ls_formula,Max(ll_pos_dot1,ll_pos_dot2) + 1)
  268. ls_code_array[ll_array] = ls_code
  269. IF ll_pos_dot1 > 0 And ll_pos_dot2 = 0 THEN
  270. ls_code = '+'
  271. ELSEIF ll_pos_dot1 = 0 And ll_pos_dot2 > 0 THEN
  272. ls_code = '-'
  273. END IF
  274. ELSEIF Pos(ls_formula,'+') > 0 And Pos(ls_formula,'-') > 0 THEN
  275. ll_array++
  276. ls_subid_array[ll_array] = Left(ls_formula,Min(ll_pos_dot1,ll_pos_dot2) - 1)
  277. ls_formula = Mid(ls_formula,Min(ll_pos_dot1,ll_pos_dot2) + 1)
  278. ls_code_array[ll_array] = ls_code
  279. IF ll_pos_dot1 < ll_pos_dot2 THEN
  280. ls_code = '+'
  281. ELSE
  282. ls_code = '-'
  283. END IF
  284. END IF
  285. LOOP
  286. FOR l = 1 To ll_array
  287. IF ls_code_array[l] = '+' THEN
  288. ld_amt += f_amt(sys_accsetid,ls_subid_array[l],ls_var,ll_mth,sqlca)
  289. ld_amt2 += f_amt(sys_accsetid,ls_subid_array[l],ls_var2,ll_mth,sqlca)
  290. ELSE
  291. ld_amt -= f_amt(sys_accsetid,ls_subid_array[l],ls_var,ll_mth,sqlca)
  292. ld_amt2 -= f_amt(sys_accsetid,ls_subid_array[l],ls_var2,ll_mth,sqlca)
  293. END IF
  294. NEXT
  295. END IF
  296. CASE 2
  297. ll_array = 0
  298. ll_pos_dot1 = 0
  299. ll_pos_dot2 = 0
  300. ls_code = '+'
  301. IF ls_formula = '' THEN
  302. ld_amt = 0
  303. ld_amt2 = 0
  304. ELSE
  305. DO WHILE ls_formula <> ''
  306. ll_pos_dot1 = Pos(ls_formula,'+')
  307. ll_pos_dot2 = Pos(ls_formula,'-')
  308. IF ll_pos_dot1 = 0 And ll_pos_dot2 = 0 THEN
  309. ll_array++
  310. ll_rowid_array[ll_array] = Long(ls_formula)
  311. ls_code_array[ll_array] = ls_code
  312. ls_formula = ''
  313. ELSEIF ll_pos_dot1 > 0 And ll_pos_dot2 = 0 Or ll_pos_dot1 = 0 And ll_pos_dot2 > 0 THEN
  314. ll_array++
  315. ll_rowid_array[ll_array] = Long(Left(ls_formula,Max(ll_pos_dot1,ll_pos_dot2) - 1))
  316. ls_formula = Mid(ls_formula,Max(ll_pos_dot1,ll_pos_dot2) + 1)
  317. ls_code_array[ll_array] = ls_code
  318. IF ll_pos_dot1 > 0 And ll_pos_dot2 = 0 THEN
  319. ls_code = '+'
  320. ELSEIF ll_pos_dot1 = 0 And ll_pos_dot2 > 0 THEN
  321. ls_code = '-'
  322. END IF
  323. ELSEIF Pos(ls_formula,'+') > 0 And Pos(ls_formula,'-') > 0 THEN
  324. ll_array++
  325. ll_rowid_array[ll_array] = Long(Left(ls_formula,Min(ll_pos_dot1,ll_pos_dot2) - 1))
  326. ls_formula = Mid(ls_formula,Min(ll_pos_dot1,ll_pos_dot2) + 1)
  327. ls_code_array[ll_array] = ls_code
  328. IF ll_pos_dot1 < ll_pos_dot2 THEN
  329. ls_code = '+'
  330. ELSE
  331. ls_code = '-'
  332. END IF
  333. END IF
  334. LOOP
  335. dw_1.AcceptText()
  336. FOR m = 1 To dw_1.RowCount()
  337. FOR l = 1 To ll_array
  338. IF dw_1.Object.col1_rowid01[m] = ll_rowid_array[l] THEN
  339. IF ls_code_array[l] = '+' THEN
  340. ld_amt += dw_1.GetItemDecimal(m,"col1_amt01")
  341. ld_amt2 += dw_1.GetItemDecimal(m,"col1_amt01_2")
  342. ELSE
  343. ld_amt -= dw_1.GetItemDecimal(m,"col1_amt01")
  344. ld_amt2 -= dw_1.GetItemDecimal(m,"col1_amt01_2")
  345. END IF
  346. END IF
  347. NEXT
  348. NEXT
  349. END IF
  350. END CHOOSE
  351. END IF
  352. dw_1.SetItem(ll_insert,"col1_amt01",ld_amt)
  353. dw_1.SetItem(ll_insert,"col1_amt01_2",ld_amt2)
  354. END IF
  355. IF li_rptype = 1 THEN
  356. IF j <= ll_col2 THEN
  357. dw_1.Object.col2_name[ll_insert] = ds_col2.Object.rowname[j]
  358. dw_1.Object.col2_rowid01[ll_insert] = ds_col2.Object.rowid[j]
  359. ld_amt = 0
  360. ld_amt2 = 0
  361. ll_array = 0
  362. ds_col_cmpl.Retrieve(ds_col2.Object.rowid[j],sys_accsetid)
  363. IF ds_col_cmpl.RowCount() = 0 THEN
  364. ld_amt = 0
  365. ld_amt2 = 0
  366. ELSE
  367. ls_var = ds_col_cmpl.Object.formulavar[1]
  368. ls_var2 = ds_col_cmpl.Object.cw_rp_row_formula_formulavar2[1]
  369. ls_formula = ds_col_cmpl.Object.rowformula[1]
  370. li_rowcmpltype = ds_col_cmpl.Object.cw_rp_rowdef_rowcmpltype[1]
  371. CHOOSE CASE li_rowcmpltype
  372. CASE 0
  373. ld_amt = 0
  374. ld_amt2 = 0
  375. CASE 1
  376. ll_array = 0
  377. ll_pos_dot1 = 0
  378. ll_pos_dot2 = 0
  379. ls_code = '+'
  380. IF ls_formula = '' Or ls_var = '' THEN
  381. ld_amt = 0
  382. ld_amt2 = 0
  383. ELSE
  384. DO WHILE ls_formula <> ''
  385. ll_pos_dot1 = Pos(ls_formula,'+')
  386. ll_pos_dot2 = Pos(ls_formula,'-')
  387. IF ll_pos_dot1 = 0 And ll_pos_dot2 = 0 THEN
  388. ll_array++
  389. ls_subid_array[ll_array] = ls_formula
  390. ls_code_array[ll_array] = ls_code
  391. ls_formula = ''
  392. ELSEIF ll_pos_dot1 > 0 And ll_pos_dot2 = 0 Or ll_pos_dot1 = 0 And ll_pos_dot2 > 0 THEN
  393. ll_array++
  394. ls_subid_array[ll_array] = Left(ls_formula,Max(ll_pos_dot1,ll_pos_dot2) - 1)
  395. ls_formula = Mid(ls_formula,Max(ll_pos_dot1,ll_pos_dot2) + 1)
  396. ls_code_array[ll_array] = ls_code
  397. IF ll_pos_dot1 > 0 And ll_pos_dot2 = 0 THEN
  398. ls_code = '+'
  399. ELSEIF ll_pos_dot1 = 0 And ll_pos_dot2 > 0 THEN
  400. ls_code = '-'
  401. END IF
  402. ELSEIF Pos(ls_formula,'+') > 0 And Pos(ls_formula,'-') > 0 THEN
  403. ll_array++
  404. ls_subid_array[ll_array] = Left(ls_formula,Min(ll_pos_dot1,ll_pos_dot2) - 1)
  405. ls_formula = Mid(ls_formula,Min(ll_pos_dot1,ll_pos_dot2) + 1)
  406. ls_code_array[ll_array] = ls_code
  407. IF ll_pos_dot1 < ll_pos_dot2 THEN
  408. ls_code = '+'
  409. ELSE
  410. ls_code = '-'
  411. END IF
  412. END IF
  413. LOOP
  414. FOR l = 1 To ll_array
  415. IF ls_code_array[l] = '+' THEN
  416. ld_amt += f_amt(sys_accsetid,ls_subid_array[l],ls_var,ll_mth,sqlca)
  417. ld_amt2 += f_amt(sys_accsetid,ls_subid_array[l],ls_var2,ll_mth,sqlca)
  418. ELSE
  419. ld_amt -= f_amt(sys_accsetid,ls_subid_array[l],ls_var,ll_mth,sqlca)
  420. ld_amt2 -= f_amt(sys_accsetid,ls_subid_array[l],ls_var2,ll_mth,sqlca)
  421. END IF
  422. NEXT
  423. END IF
  424. CASE 2
  425. ll_array = 0
  426. ll_pos_dot1 = 0
  427. ll_pos_dot2 = 0
  428. ls_code = '+'
  429. IF ls_formula = '' THEN
  430. ld_amt = 0
  431. ld_amt2 = 0
  432. ELSE
  433. DO WHILE ls_formula <> ''
  434. ll_pos_dot1 = Pos(ls_formula,'+')
  435. ll_pos_dot2 = Pos(ls_formula,'-')
  436. IF ll_pos_dot1 = 0 And ll_pos_dot2 = 0 THEN
  437. ll_array++
  438. ll_rowid_array[ll_array] = Long(ls_formula)
  439. ls_code_array[ll_array] = ls_code
  440. ls_formula = ''
  441. ELSEIF ll_pos_dot1 > 0 And ll_pos_dot2 = 0 Or ll_pos_dot1 = 0 And ll_pos_dot2 > 0 THEN
  442. ll_array++
  443. ll_rowid_array[ll_array] = Long(Left(ls_formula,Max(ll_pos_dot1,ll_pos_dot2) - 1))
  444. ls_formula = Mid(ls_formula,Max(ll_pos_dot1,ll_pos_dot2) + 1)
  445. ls_code_array[ll_array] = ls_code
  446. IF ll_pos_dot1 > 0 And ll_pos_dot2 = 0 THEN
  447. ls_code = '+'
  448. ELSEIF ll_pos_dot1 = 0 And ll_pos_dot2 > 0 THEN
  449. ls_code = '-'
  450. END IF
  451. ELSEIF Pos(ls_formula,'+') > 0 And Pos(ls_formula,'-') > 0 THEN
  452. ll_array++
  453. ll_rowid_array[ll_array] = Long(Left(ls_formula,Min(ll_pos_dot1,ll_pos_dot2) - 1))
  454. ls_formula = Mid(ls_formula,Min(ll_pos_dot1,ll_pos_dot2) + 1)
  455. ls_code_array[ll_array] = ls_code
  456. IF ll_pos_dot1 < ll_pos_dot2 THEN
  457. ls_code = '+'
  458. ELSE
  459. ls_code = '-'
  460. END IF
  461. END IF
  462. LOOP
  463. dw_1.AcceptText()
  464. FOR m = 1 To dw_1.RowCount()
  465. FOR l = 1 To ll_array
  466. IF dw_1.Object.col2_rowid01[m] = ll_rowid_array[l] THEN
  467. IF ls_code_array[l] = '+' THEN
  468. ld_amt += dw_1.GetItemDecimal(m,"col2_amt01")
  469. ld_amt2 += dw_1.GetItemDecimal(m,"col2_amt01_2")
  470. ELSE
  471. ld_amt -= dw_1.GetItemDecimal(m,"col2_amt01")
  472. ld_amt2 -= dw_1.GetItemDecimal(m,"col2_amt01_2")
  473. END IF
  474. END IF
  475. NEXT
  476. NEXT
  477. END IF
  478. END CHOOSE
  479. END IF
  480. dw_1.SetItem(ll_insert,"col2_amt01",ld_amt)
  481. dw_1.SetItem(ll_insert,"col2_amt01_2",ld_amt2)
  482. END IF
  483. END IF
  484. NEXT
  485. dw_1.Object.rpmonth.Text = '单位名称:'+trim(s_sys_accset.cropname)+' 月份:'+string(ll_mth)
  486. Close(w_sys_wait_jdt)
  487. end event
  488. type st_3 from w_publ_easyq`st_3 within w_rp_combine
  489. boolean visible = false
  490. integer x = 1874
  491. integer y = 400
  492. integer width = 261
  493. string text = "统计期间:"
  494. end type
  495. type st_4 from w_publ_easyq`st_4 within w_rp_combine
  496. boolean visible = false
  497. integer x = 1463
  498. integer y = 480
  499. end type
  500. type em_1 from w_publ_easyq`em_1 within w_rp_combine
  501. boolean visible = false
  502. integer x = 2149
  503. integer y = 384
  504. integer width = 306
  505. alignment alignment = center!
  506. string mask = "yyyymm"
  507. end type
  508. type em_2 from w_publ_easyq`em_2 within w_rp_combine
  509. boolean visible = false
  510. integer x = 1568
  511. integer y = 460
  512. integer width = 306
  513. alignment alignment = center!
  514. string mask = "yyyy-mm"
  515. end type
  516. type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_combine
  517. integer x = 1733
  518. integer y = 36
  519. end type
  520. type cbx_yl from w_publ_easyq`cbx_yl within w_rp_combine
  521. integer x = 1527
  522. integer y = 40
  523. end type
  524. type dw_1 from w_publ_easyq`dw_1 within w_rp_combine
  525. integer y = 304
  526. integer width = 2752
  527. string dataobject = "dw_rp_combine_3"
  528. boolean setcolumn_visible_use = false
  529. boolean autosave_filter_use = false
  530. boolean autosave_sort_use = false
  531. boolean autosave_setlayout_use = false
  532. boolean autosave_columnvisible_use = false
  533. end type
  534. type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_combine
  535. integer x = 1979
  536. integer y = 1216
  537. end type
  538. type sle_cust from w_publ_easyq`sle_cust within w_rp_combine
  539. integer x = 1710
  540. integer y = 1404
  541. end type
  542. type st_mtrl from w_publ_easyq`st_mtrl within w_rp_combine
  543. integer x = 1522
  544. integer y = 1232
  545. end type
  546. type st_cust from w_publ_easyq`st_cust within w_rp_combine
  547. integer x = 1243
  548. integer y = 1416
  549. end type
  550. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_combine
  551. integer x = 2533
  552. integer y = 60
  553. end type
  554. type pb_em1 from w_publ_easyq`pb_em1 within w_rp_combine
  555. boolean visible = false
  556. integer x = 1755
  557. integer y = 1004
  558. end type
  559. type pb_em2 from w_publ_easyq`pb_em2 within w_rp_combine
  560. boolean visible = false
  561. integer x = 2368
  562. integer y = 1004
  563. end type
  564. type pb_2 from w_publ_easyq`pb_2 within w_rp_combine
  565. boolean visible = false
  566. integer x = 2478
  567. integer y = 1004
  568. end type
  569. type cb_help from w_publ_easyq`cb_help within w_rp_combine
  570. boolean visible = false
  571. integer x = 2327
  572. end type
  573. type cb_copyself from w_publ_easyq`cb_copyself within w_rp_combine
  574. integer x = 713
  575. end type
  576. type gb_1 from w_publ_easyq`gb_1 within w_rp_combine
  577. end type
  578. type ln_bar from w_publ_easyq`ln_bar within w_rp_combine
  579. end type
  580. type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_combine
  581. end type
  582. type r_bar from w_publ_easyq`r_bar within w_rp_combine
  583. end type
  584. type ln_1 from w_publ_easyq`ln_1 within w_rp_combine
  585. end type
  586. type ln_2 from w_publ_easyq`ln_2 within w_rp_combine
  587. end type
  588. type ln_3 from w_publ_easyq`ln_3 within w_rp_combine
  589. end type
  590. type ln_4 from w_publ_easyq`ln_4 within w_rp_combine
  591. end type
  592. type cb_3 from uo_imflatbutton within w_rp_combine
  593. integer x = 274
  594. integer width = 274
  595. integer height = 164
  596. integer taborder = 30
  597. boolean bringtotop = true
  598. string text = "报表设置"
  599. string normalpicname = "update.bmp"
  600. integer picsize = 16
  601. toolbaralignment pic_align = alignattop!
  602. boolean border = false
  603. end type
  604. event clicked;call super::clicked;open(w_rp_combine_setting)
  605. end event
  606. type st_1 from statictext within w_rp_combine
  607. integer x = 32
  608. integer y = 204
  609. integer width = 146
  610. integer height = 48
  611. boolean bringtotop = true
  612. integer textsize = -9
  613. integer weight = 400
  614. fontcharset fontcharset = gb2312charset!
  615. fontpitch fontpitch = variable!
  616. string facename = "宋体"
  617. long textcolor = 33554432
  618. long backcolor = 134217739
  619. string text = "报表"
  620. alignment alignment = right!
  621. boolean focusrectangle = false
  622. end type
  623. type ddlb_1 from dropdownlistbox within w_rp_combine
  624. integer x = 197
  625. integer y = 188
  626. integer width = 690
  627. integer height = 680
  628. integer taborder = 50
  629. boolean bringtotop = true
  630. integer textsize = -9
  631. integer weight = 400
  632. fontcharset fontcharset = gb2312charset!
  633. fontpitch fontpitch = variable!
  634. string facename = "宋体"
  635. long textcolor = 33554432
  636. boolean vscrollbar = true
  637. borderstyle borderstyle = stylelowered!
  638. end type
  639. event selectionchanged;cur_rpid = Long(Mid ( THIS.Text,Pos(THIS.Text,'[') + 1,Len(THIS.Text) - Pos(THIS.Text,'[') - 1 ))
  640. wf_face()
  641. end event