w_subjectdef_edit.srw 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825
  1. $PBExportHeader$w_subjectdef_edit.srw
  2. forward
  3. global type w_subjectdef_edit from w_publ_base
  4. end type
  5. type tab_subject from tab within w_subjectdef_edit
  6. end type
  7. type tabpage_1 from userobject within tab_subject
  8. end type
  9. type tv_1 from treeview within tabpage_1
  10. end type
  11. type tabpage_1 from userobject within tab_subject
  12. tv_1 tv_1
  13. end type
  14. type tabpage_2 from userobject within tab_subject
  15. end type
  16. type tv_2 from treeview within tabpage_2
  17. end type
  18. type tabpage_2 from userobject within tab_subject
  19. tv_2 tv_2
  20. end type
  21. type tabpage_6 from userobject within tab_subject
  22. end type
  23. type tv_6 from treeview within tabpage_6
  24. end type
  25. type tabpage_6 from userobject within tab_subject
  26. tv_6 tv_6
  27. end type
  28. type tabpage_3 from userobject within tab_subject
  29. end type
  30. type tv_3 from treeview within tabpage_3
  31. end type
  32. type tabpage_3 from userobject within tab_subject
  33. tv_3 tv_3
  34. end type
  35. type tabpage_4 from userobject within tab_subject
  36. end type
  37. type tv_4 from treeview within tabpage_4
  38. end type
  39. type tabpage_4 from userobject within tab_subject
  40. tv_4 tv_4
  41. end type
  42. type tabpage_5 from userobject within tab_subject
  43. end type
  44. type tv_5 from treeview within tabpage_5
  45. end type
  46. type tabpage_5 from userobject within tab_subject
  47. tv_5 tv_5
  48. end type
  49. type tab_subject from tab within w_subjectdef_edit
  50. tabpage_1 tabpage_1
  51. tabpage_2 tabpage_2
  52. tabpage_6 tabpage_6
  53. tabpage_3 tabpage_3
  54. tabpage_4 tabpage_4
  55. tabpage_5 tabpage_5
  56. end type
  57. type cb_add from uo_imflatbutton within w_subjectdef_edit
  58. end type
  59. type cb_add_next from uo_imflatbutton within w_subjectdef_edit
  60. end type
  61. type cb_mod from uo_imflatbutton within w_subjectdef_edit
  62. end type
  63. type cb_del from uo_imflatbutton within w_subjectdef_edit
  64. end type
  65. type cb_print from uo_imflatbutton within w_subjectdef_edit
  66. end type
  67. type cb_refresh from uo_imflatbutton within w_subjectdef_edit
  68. end type
  69. type cb_ok from uo_imflatbutton within w_subjectdef_edit
  70. end type
  71. type cb_3 from uo_imflatbutton within w_subjectdef_edit
  72. end type
  73. type cb_6 from uo_imflatbutton within w_subjectdef_edit
  74. end type
  75. type cb_11 from uo_imflatbutton within w_subjectdef_edit
  76. end type
  77. type cb_tab from commandbutton within w_subjectdef_edit
  78. end type
  79. end forward
  80. global type w_subjectdef_edit from w_publ_base
  81. integer width = 2697
  82. integer height = 1964
  83. string title = "会计科目"
  84. boolean minbox = false
  85. windowtype windowtype = response!
  86. long backcolor = 81324524
  87. tab_subject tab_subject
  88. cb_add cb_add
  89. cb_add_next cb_add_next
  90. cb_mod cb_mod
  91. cb_del cb_del
  92. cb_print cb_print
  93. cb_refresh cb_refresh
  94. cb_ok cb_ok
  95. cb_3 cb_3
  96. cb_6 cb_6
  97. cb_11 cb_11
  98. cb_tab cb_tab
  99. end type
  100. global w_subjectdef_edit w_subjectdef_edit
  101. type variables
  102. Long il_hand
  103. treeviewitem itvi
  104. Long uo_deep
  105. Boolean ib_mod = FALSE
  106. treeview tv_1,tv_2,tv_3,tv_4,tv_5,tv_6
  107. String ins_subidstr,ins_subidname
  108. uo_subject uo_sub
  109. Int dw_editfocus = 0
  110. //1:新建下级,2:新建同级,3:修改
  111. s_subject s_rt_subject
  112. Int if_check_ifmx = 0 //0:检查是否明细科目
  113. s_subid_tree is_subtree_arr1[]
  114. s_subid_tree is_subtree_arr2[]
  115. s_subid_tree is_subtree_arr3[]
  116. s_subid_tree is_subtree_arr4[]
  117. s_subid_tree is_subtree_arr5[]
  118. s_subid_tree is_subtree_arr6[]
  119. Long il_p1,il_p2,il_p3,il_p4,il_p5,il_p6
  120. end variables
  121. forward prototypes
  122. public function integer wf_dssubtree_retrieve ()
  123. public function integer wf_maketree ()
  124. public function integer pf_treegrowth (long arg_handl, string arg_subid)
  125. public function integer wf_tree1 ()
  126. public function integer wf_tree2 ()
  127. public function integer wf_tree3 ()
  128. public function integer wf_tree4 ()
  129. public function integer wf_tree5 ()
  130. public function integer wf_tree6 ()
  131. end prototypes
  132. public function integer wf_dssubtree_retrieve ();DESTROY ds_subjecttree
  133. f_init_ds_subjecttree()
  134. RETURN 1
  135. end function
  136. public function integer wf_maketree ();il_p1 = 0
  137. il_p2 = 0
  138. il_p3 = 0
  139. il_p4 = 0
  140. il_p5 = 0
  141. il_p6 = 0
  142. CHOOSE CASE tab_subject.SelectedTab
  143. CASE 1
  144. wf_tree1()
  145. CASE 2
  146. wf_tree2()
  147. CASE 4
  148. wf_tree3()
  149. CASE 5
  150. wf_tree4()
  151. CASE 6
  152. wf_tree5()
  153. CASE 3
  154. wf_tree6()
  155. END CHOOSE
  156. RETURN 1
  157. end function
  158. public function integer pf_treegrowth (long arg_handl, string arg_subid);String ls_subid,ls_subid_arr[]
  159. String ls_name,ls_name_arr[]
  160. Long ll_count = 0,ll_i
  161. Int li_detailflag,li_detailflag_arr[]
  162. String ls_subid_name
  163. Long li_handl
  164. TreeViewItem l_tvi
  165. treeview lt_tv
  166. Int len_1,len_2,len_3,len_4,len_5,len_6
  167. Int arg_son_len,arg_parent_len
  168. len_1 = s_sys_accset.step1
  169. len_2 = s_sys_accset.step1+s_sys_accset.step2
  170. len_3 = s_sys_accset.step1+s_sys_accset.step2+s_sys_accset.step3
  171. len_4 = s_sys_accset.step1+s_sys_accset.step2+s_sys_accset.step3+s_sys_accset.step4
  172. len_5 = s_sys_accset.step1+s_sys_accset.step2+s_sys_accset.step3+s_sys_accset.step4+s_sys_accset.step5
  173. len_6 = s_sys_accset.step1+s_sys_accset.step2+s_sys_accset.step3+s_sys_accset.step4+s_sys_accset.step5+s_sys_accset.step6
  174. arg_parent_len = Len(Trim(arg_subid))
  175. CHOOSE CASE arg_parent_len
  176. CASE 1
  177. arg_son_len = len_1
  178. CASE len_1
  179. arg_son_len = len_2
  180. CASE len_2
  181. arg_son_len = len_3
  182. CASE len_3
  183. arg_son_len = len_4
  184. CASE len_4
  185. arg_son_len = len_5
  186. CASE len_5
  187. arg_son_len = len_6
  188. CASE len_5
  189. arg_son_len = len_6 + 1
  190. END CHOOSE
  191. uo_deep++
  192. IF uo_deep > 100000 THEN //防止死递归
  193. RETURN 0
  194. END IF
  195. //用ds取下级科目
  196. String ls_filter
  197. ls_filter = "subid like '" + arg_subid + "%'"
  198. ds_subjecttree.SetFilter(ls_filter)
  199. ds_subjecttree.Filter()
  200. Long RowCount,ll_k
  201. ds_subjecttree.AcceptText()
  202. RowCount = ds_subjecttree.RowCount()
  203. IF RowCount = 0 THEN RETURN 0
  204. FOR ll_k = 1 TO RowCount
  205. ls_subid = ds_subjecttree.Object.subid[ll_k]
  206. ls_name = ds_subjecttree.Object.Name[ll_k]
  207. li_detailflag = ds_subjecttree.Object.detailflag[ll_k]
  208. IF Len(Trim(ls_subid)) = arg_son_len AND Left(Trim(ls_subid),arg_parent_len ) = arg_subid THEN
  209. ll_count++
  210. ls_subid_arr[ll_count] = ls_subid
  211. ls_name_arr[ll_count] = ls_name
  212. li_detailflag_arr[ll_count] = li_detailflag
  213. END IF
  214. NEXT
  215. //
  216. //用游标取下级科目
  217. //DECLARE pf_cur CURSOR FOR
  218. // SELECT subid,
  219. // name,
  220. // detailflag
  221. // FROM cw_subject
  222. // WHERE ( accsetid = :sys_accsetid )
  223. // And ( Len(ltrim(rtrim(subid))) = :arg_son_len )
  224. // and ( left(ltrim(rtrim(subid)),:arg_parent_len ) = :arg_subid );
  225. //OPEN pf_cur;
  226. //
  227. //FETCH pf_cur INTO :ls_subid,:ls_name,:li_detailflag;
  228. //
  229. //DO WHILE sqlca.SQLCode = 0
  230. // ll_count++
  231. // ls_subid_arr[ll_count] = ls_subid
  232. // ls_name_arr[ll_count] = ls_name
  233. // li_detailflag_arr[ll_count] = li_detailflag
  234. // FETCH pf_cur INTO :ls_subid,:ls_name,:li_detailflag;
  235. //LOOP
  236. //
  237. //CLOSE pf_cur;
  238. //
  239. FOR ll_i = 1 TO ll_count
  240. ls_subid_name = ls_subid_arr[ll_i] + ' ' + ls_name_arr[ll_i]
  241. CHOOSE CASE Left(arg_subid,1)
  242. CASE '1'
  243. lt_tv = tv_1
  244. CASE '2'
  245. lt_tv = tv_2
  246. CASE '3'
  247. IF s_sys_accset.ifnewsubid = 0 THEN
  248. lt_tv = tv_3
  249. ELSE
  250. lt_tv = tv_6
  251. END IF
  252. CASE '4'
  253. IF s_sys_accset.ifnewsubid = 0 THEN
  254. lt_tv = tv_4
  255. ELSE
  256. lt_tv = tv_3
  257. END IF
  258. CASE '5'
  259. IF s_sys_accset.ifnewsubid = 0 THEN
  260. lt_tv = tv_5
  261. ELSE
  262. lt_tv = tv_4
  263. END IF
  264. CASE '6'
  265. IF s_sys_accset.ifnewsubid = 0 THEN
  266. lt_tv = tv_6
  267. ELSE
  268. lt_tv = tv_5
  269. END IF
  270. END CHOOSE
  271. li_handl = lt_tv.InsertItemSort(arg_handl,ls_subid_name,li_detailflag_arr[ll_i] + 1)
  272. CHOOSE CASE Left(arg_subid,1)
  273. CASE '1'
  274. il_p1++
  275. is_subtree_arr1[il_p1].subid = ls_subid_arr[ll_i]
  276. is_subtree_arr1[il_p1].Handle = li_handl
  277. CASE '2'
  278. il_p2++
  279. is_subtree_arr2[il_p2].subid = ls_subid_arr[ll_i]
  280. is_subtree_arr2[il_p2].Handle = li_handl
  281. CASE '3'
  282. il_p3++
  283. is_subtree_arr3[il_p3].subid = ls_subid_arr[ll_i]
  284. is_subtree_arr3[il_p3].Handle = li_handl
  285. CASE '4'
  286. il_p4++
  287. is_subtree_arr4[il_p4].subid = ls_subid_arr[ll_i]
  288. is_subtree_arr4[il_p4].Handle = li_handl
  289. CASE '5'
  290. il_p5++
  291. is_subtree_arr5[il_p5].subid = ls_subid_arr[ll_i]
  292. is_subtree_arr5[il_p5].Handle = li_handl
  293. CASE '6'
  294. il_p6++
  295. is_subtree_arr6[il_p6].subid = ls_subid_arr[ll_i]
  296. is_subtree_arr6[il_p6].Handle = li_handl
  297. END CHOOSE
  298. IF lt_tv.GetItem ( li_handl, l_tvi) = 1 THEN
  299. l_tvi.Label = ls_subid_name
  300. l_tvi.Data = ls_subid_arr[ll_i]
  301. lt_tv.SetItem( li_handl, l_tvi )
  302. END IF
  303. pf_treegrowth(li_handl,ls_subid_arr[ll_i])
  304. NEXT
  305. RETURN 1
  306. end function
  307. public function integer wf_tree1 ();Long ll_hand
  308. Long tvi_hdl = 0
  309. tv_1.SetRedraw(FALSE)
  310. DO UNTIL tv_1.FindItem(RootTreeItem!, 0) = -1
  311. tv_1.DeleteItem(tvi_hdl)
  312. LOOP
  313. ll_hand = tv_1.InsertItemLast(0,'资产类科目',0)
  314. pf_treegrowth(ll_hand,'1')
  315. tv_1.ExpandItem(ll_hand)
  316. tv_1.SetRedraw(TRUE)
  317. ds_subjecttree.SetFilter('')
  318. ds_subjecttree.Filter()
  319. RETURN 1
  320. end function
  321. public function integer wf_tree2 ();long ll_hand
  322. long tvi_hdl = 0
  323. tv_2.setredraw(false)
  324. DO UNTIL tv_2.FindItem(RootTreeItem!, 0) = -1
  325. tv_2.DeleteItem(tvi_hdl)
  326. LOOP
  327. ll_hand = tv_2.insertitemlast(0,'负债类科目',0)
  328. pf_treegrowth(ll_hand,'2')
  329. tv_2.expanditem(ll_hand)
  330. tv_2.setredraw(true)
  331. ds_subjecttree.setfilter('')
  332. ds_subjecttree.filter()
  333. return 1
  334. end function
  335. public function integer wf_tree3 ();Long ll_hand
  336. Long tvi_hdl = 0
  337. tv_3.SetRedraw(FALSE)
  338. DO UNTIL tv_3.FindItem(RootTreeItem!, 0) = -1
  339. tv_3.DeleteItem(tvi_hdl)
  340. LOOP
  341. ll_hand = tv_3.InsertItemLast(0,'权益类科目',0)
  342. IF s_sys_accset.ifnewsubid = 0 THEN
  343. pf_treegrowth(ll_hand,'3')
  344. ELSE
  345. pf_treegrowth(ll_hand,'4')
  346. END IF
  347. tv_3.ExpandItem(ll_hand)
  348. tv_3.SetRedraw(TRUE)
  349. ds_subjecttree.SetFilter('')
  350. ds_subjecttree.Filter()
  351. RETURN 1
  352. end function
  353. public function integer wf_tree4 ();long ll_hand
  354. long tvi_hdl = 0
  355. tv_4.setredraw(false)
  356. DO UNTIL tv_4.FindItem(RootTreeItem!, 0) = -1
  357. tv_4.DeleteItem(tvi_hdl)
  358. LOOP
  359. ll_hand = tv_4.insertitemlast(0,'成本类科目',0)
  360. IF s_sys_accset.ifnewsubid = 0 THEN
  361. pf_treegrowth(ll_hand,'4')
  362. ELSE
  363. pf_treegrowth(ll_hand,'5')
  364. END IF
  365. tv_4.expanditem(ll_hand)
  366. tv_4.setredraw(true)
  367. ds_subjecttree.setfilter('')
  368. ds_subjecttree.filter()
  369. return 1
  370. end function
  371. public function integer wf_tree5 ();long ll_hand
  372. long tvi_hdl = 0
  373. tv_5.setredraw(false)
  374. DO UNTIL tv_5.FindItem(RootTreeItem!, 0) = -1
  375. tv_5.DeleteItem(tvi_hdl)
  376. LOOP
  377. ll_hand = tv_5.insertitemlast(0,'损益类科目',0)
  378. IF s_sys_accset.ifnewsubid = 0 THEN
  379. pf_treegrowth(ll_hand,'5')
  380. ELSE
  381. pf_treegrowth(ll_hand,'6')
  382. END IF
  383. tv_5.expanditem(ll_hand)
  384. tv_5.setredraw(true)
  385. ds_subjecttree.setfilter('')
  386. ds_subjecttree.filter()
  387. return 1
  388. end function
  389. public function integer wf_tree6 ();long ll_hand
  390. long tvi_hdl = 0
  391. tv_6.setredraw(false)
  392. DO UNTIL tv_6.FindItem(RootTreeItem!, 0) = -1
  393. tv_6.DeleteItem(tvi_hdl)
  394. LOOP
  395. ll_hand = tv_6.insertitemlast(0,'共同类科目',0)
  396. pf_treegrowth(ll_hand,'3')
  397. tv_6.expanditem(ll_hand)
  398. tv_6.setredraw(true)
  399. ds_subjecttree.setfilter('')
  400. ds_subjecttree.filter()
  401. return 1
  402. end function
  403. on w_subjectdef_edit.create
  404. int iCurrent
  405. call super::create
  406. this.tab_subject=create tab_subject
  407. this.cb_add=create cb_add
  408. this.cb_add_next=create cb_add_next
  409. this.cb_mod=create cb_mod
  410. this.cb_del=create cb_del
  411. this.cb_print=create cb_print
  412. this.cb_refresh=create cb_refresh
  413. this.cb_ok=create cb_ok
  414. this.cb_3=create cb_3
  415. this.cb_6=create cb_6
  416. this.cb_11=create cb_11
  417. this.cb_tab=create cb_tab
  418. iCurrent=UpperBound(this.Control)
  419. this.Control[iCurrent+1]=this.tab_subject
  420. this.Control[iCurrent+2]=this.cb_add
  421. this.Control[iCurrent+3]=this.cb_add_next
  422. this.Control[iCurrent+4]=this.cb_mod
  423. this.Control[iCurrent+5]=this.cb_del
  424. this.Control[iCurrent+6]=this.cb_print
  425. this.Control[iCurrent+7]=this.cb_refresh
  426. this.Control[iCurrent+8]=this.cb_ok
  427. this.Control[iCurrent+9]=this.cb_3
  428. this.Control[iCurrent+10]=this.cb_6
  429. this.Control[iCurrent+11]=this.cb_11
  430. this.Control[iCurrent+12]=this.cb_tab
  431. end on
  432. on w_subjectdef_edit.destroy
  433. call super::destroy
  434. destroy(this.tab_subject)
  435. destroy(this.cb_add)
  436. destroy(this.cb_add_next)
  437. destroy(this.cb_mod)
  438. destroy(this.cb_del)
  439. destroy(this.cb_print)
  440. destroy(this.cb_refresh)
  441. destroy(this.cb_ok)
  442. destroy(this.cb_3)
  443. destroy(this.cb_6)
  444. destroy(this.cb_11)
  445. destroy(this.cb_tab)
  446. end on
  447. event open;call super::open;if_check_ifmx = Message.DoubleParm
  448. tv_1 = tab_subject.tabpage_1.tv_1
  449. tv_2 = tab_subject.tabpage_2.tv_2
  450. tv_3 = tab_subject.tabpage_3.tv_3
  451. tv_4 = tab_subject.tabpage_4.tv_4
  452. tv_5 = tab_subject.tabpage_5.tv_5
  453. tv_6 = tab_subject.tabpage_6.tv_6
  454. IF sys_last_selected_subid <> '' THEN cb_tab.PostEvent(Clicked!)
  455. wf_maketree()
  456. uo_sub = CREATE uo_subject
  457. end event
  458. event close;destroy uo_sub
  459. closewithreturn(this,s_rt_subject)
  460. end event
  461. type cb_func from w_publ_base`cb_func within w_subjectdef_edit
  462. end type
  463. type cb_exit from w_publ_base`cb_exit within w_subjectdef_edit
  464. integer x = 2254
  465. integer y = 204
  466. integer width = 384
  467. end type
  468. type tab_subject from tab within w_subjectdef_edit
  469. integer width = 2226
  470. integer height = 1864
  471. integer taborder = 20
  472. boolean bringtotop = true
  473. integer textsize = -9
  474. integer weight = 400
  475. fontcharset fontcharset = gb2312charset!
  476. fontpitch fontpitch = variable!
  477. string facename = "宋体"
  478. long backcolor = 80269524
  479. boolean raggedright = true
  480. integer selectedtab = 1
  481. tabpage_1 tabpage_1
  482. tabpage_2 tabpage_2
  483. tabpage_6 tabpage_6
  484. tabpage_3 tabpage_3
  485. tabpage_4 tabpage_4
  486. tabpage_5 tabpage_5
  487. end type
  488. on tab_subject.create
  489. this.tabpage_1=create tabpage_1
  490. this.tabpage_2=create tabpage_2
  491. this.tabpage_6=create tabpage_6
  492. this.tabpage_3=create tabpage_3
  493. this.tabpage_4=create tabpage_4
  494. this.tabpage_5=create tabpage_5
  495. this.Control[]={this.tabpage_1,&
  496. this.tabpage_2,&
  497. this.tabpage_6,&
  498. this.tabpage_3,&
  499. this.tabpage_4,&
  500. this.tabpage_5}
  501. end on
  502. on tab_subject.destroy
  503. destroy(this.tabpage_1)
  504. destroy(this.tabpage_2)
  505. destroy(this.tabpage_6)
  506. destroy(this.tabpage_3)
  507. destroy(this.tabpage_4)
  508. destroy(this.tabpage_5)
  509. end on
  510. event selectionchanged;wf_maketree()
  511. end event
  512. type tabpage_1 from userobject within tab_subject
  513. event create ( )
  514. event destroy ( )
  515. integer x = 18
  516. integer y = 96
  517. integer width = 2190
  518. integer height = 1752
  519. long backcolor = 80269524
  520. string text = "资产类"
  521. long tabtextcolor = 33554432
  522. long tabbackcolor = 80269524
  523. long picturemaskcolor = 553648127
  524. tv_1 tv_1
  525. end type
  526. on tabpage_1.create
  527. this.tv_1=create tv_1
  528. this.Control[]={this.tv_1}
  529. end on
  530. on tabpage_1.destroy
  531. destroy(this.tv_1)
  532. end on
  533. type tv_1 from treeview within tabpage_1
  534. integer width = 2185
  535. integer height = 1748
  536. integer taborder = 20
  537. boolean bringtotop = true
  538. integer textsize = -9
  539. integer weight = 400
  540. fontcharset fontcharset = gb2312charset!
  541. fontpitch fontpitch = variable!
  542. string facename = "宋体"
  543. long textcolor = 33554432
  544. borderstyle borderstyle = stylelowered!
  545. string picturename[] = {"RegistrationDir5!","NestedReport!","NestedReport!","NestedReport!"}
  546. long picturemaskcolor = 553648127
  547. long statepicturemaskcolor = 536870912
  548. end type
  549. event selectionchanged;long ll_hand
  550. treeviewitem tvi
  551. il_hand=this.finditem(CurrentTreeItem!,0)
  552. ll_hand=il_hand
  553. this.getitem(ll_hand,itvi)
  554. tvi=itvi
  555. ins_subidstr = left(tvi.label,pos(tvi.label,' ') -1 )
  556. ins_subidname = tvi.label
  557. tv_1.expanditem(ll_hand)
  558. end event
  559. event doubleclicked;cb_ok.triggerevent(clicked!)
  560. end event
  561. event clicked;this.triggerevent(selectionchanged!)
  562. end event
  563. type tabpage_2 from userobject within tab_subject
  564. event create ( )
  565. event destroy ( )
  566. integer x = 18
  567. integer y = 96
  568. integer width = 2190
  569. integer height = 1752
  570. long backcolor = 80269524
  571. string text = "负债类"
  572. long tabtextcolor = 33554432
  573. long tabbackcolor = 80269524
  574. long picturemaskcolor = 553648127
  575. tv_2 tv_2
  576. end type
  577. on tabpage_2.create
  578. this.tv_2=create tv_2
  579. this.Control[]={this.tv_2}
  580. end on
  581. on tabpage_2.destroy
  582. destroy(this.tv_2)
  583. end on
  584. type tv_2 from treeview within tabpage_2
  585. integer width = 2185
  586. integer height = 1748
  587. integer taborder = 50
  588. boolean bringtotop = true
  589. integer textsize = -9
  590. integer weight = 400
  591. fontcharset fontcharset = gb2312charset!
  592. fontpitch fontpitch = variable!
  593. string facename = "宋体"
  594. long textcolor = 33554432
  595. borderstyle borderstyle = stylelowered!
  596. string picturename[] = {"RegistrationDir5!","NestedReport!","NestedReport!"}
  597. long picturemaskcolor = 553648127
  598. long statepicturemaskcolor = 553648127
  599. end type
  600. event selectionchanged;long ll_hand
  601. treeviewitem tvi
  602. il_hand=this.finditem(CurrentTreeItem!,0)
  603. ll_hand=il_hand
  604. this.getitem(ll_hand,itvi)
  605. tvi=itvi
  606. ins_subidstr=left(tvi.label,pos(tvi.label,' ') -1 )
  607. ins_subidname = tvi.label
  608. tv_2.expanditem(ll_hand)
  609. end event
  610. event doubleclicked;cb_ok.triggerevent(clicked!)
  611. end event
  612. event clicked;this.triggerevent(selectionchanged!)
  613. end event
  614. type tabpage_6 from userobject within tab_subject
  615. integer x = 18
  616. integer y = 96
  617. integer width = 2190
  618. integer height = 1752
  619. long backcolor = 80269524
  620. string text = "共同类"
  621. long tabtextcolor = 33554432
  622. long tabbackcolor = 80269524
  623. long picturemaskcolor = 536870912
  624. tv_6 tv_6
  625. end type
  626. on tabpage_6.create
  627. this.tv_6=create tv_6
  628. this.Control[]={this.tv_6}
  629. end on
  630. on tabpage_6.destroy
  631. destroy(this.tv_6)
  632. end on
  633. type tv_6 from treeview within tabpage_6
  634. integer width = 2185
  635. integer height = 1748
  636. integer taborder = 10
  637. boolean bringtotop = true
  638. integer textsize = -9
  639. integer weight = 400
  640. fontcharset fontcharset = gb2312charset!
  641. fontpitch fontpitch = variable!
  642. string facename = "宋体"
  643. long textcolor = 33554432
  644. borderstyle borderstyle = stylelowered!
  645. string picturename[] = {"RegistrationDir5!","NestedReport!","NestedReport!"}
  646. long picturemaskcolor = 553648127
  647. long statepicturemaskcolor = 553648127
  648. end type
  649. event clicked;this.triggerevent(selectionchanged!)
  650. end event
  651. event doubleclicked;cb_ok.triggerevent(clicked!)
  652. end event
  653. event selectionchanged;Long ll_hand
  654. treeviewitem tvi
  655. il_hand = THIS.FindItem(CurrentTreeItem!,0)
  656. ll_hand = il_hand
  657. THIS.GetItem(ll_hand,itvi)
  658. tvi = itvi
  659. ins_subidstr = Left(tvi.Label,Pos(tvi.Label,' ') -1 )
  660. ins_subidname = tvi.Label
  661. tv_5.ExpandItem(ll_hand)
  662. end event
  663. type tabpage_3 from userobject within tab_subject
  664. event create ( )
  665. event destroy ( )
  666. integer x = 18
  667. integer y = 96
  668. integer width = 2190
  669. integer height = 1752
  670. long backcolor = 80269524
  671. string text = "权益类"
  672. long tabtextcolor = 33554432
  673. long tabbackcolor = 80269524
  674. long picturemaskcolor = 553648127
  675. tv_3 tv_3
  676. end type
  677. on tabpage_3.create
  678. this.tv_3=create tv_3
  679. this.Control[]={this.tv_3}
  680. end on
  681. on tabpage_3.destroy
  682. destroy(this.tv_3)
  683. end on
  684. type tv_3 from treeview within tabpage_3
  685. integer width = 2185
  686. integer height = 1748
  687. integer taborder = 50
  688. boolean bringtotop = true
  689. integer textsize = -9
  690. integer weight = 400
  691. fontcharset fontcharset = gb2312charset!
  692. fontpitch fontpitch = variable!
  693. string facename = "宋体"
  694. long textcolor = 33554432
  695. borderstyle borderstyle = stylelowered!
  696. string picturename[] = {"RegistrationDir5!","NestedReport!","NestedReport!"}
  697. long picturemaskcolor = 553648127
  698. long statepicturemaskcolor = 536870912
  699. end type
  700. event selectionchanged;long ll_hand
  701. treeviewitem tvi
  702. il_hand=this.finditem(CurrentTreeItem!,0)
  703. ll_hand=il_hand
  704. this.getitem(ll_hand,itvi)
  705. tvi=itvi
  706. ins_subidstr=left(tvi.label,pos(tvi.label,' ') -1 )
  707. ins_subidname = tvi.label
  708. tv_3.expanditem(ll_hand)
  709. end event
  710. event doubleclicked;cb_ok.triggerevent(clicked!)
  711. end event
  712. event clicked;this.triggerevent(selectionchanged!)
  713. end event
  714. type tabpage_4 from userobject within tab_subject
  715. event create ( )
  716. event destroy ( )
  717. integer x = 18
  718. integer y = 96
  719. integer width = 2190
  720. integer height = 1752
  721. long backcolor = 80269524
  722. string text = "成本类"
  723. long tabtextcolor = 33554432
  724. long tabbackcolor = 80269524
  725. long picturemaskcolor = 553648127
  726. tv_4 tv_4
  727. end type
  728. on tabpage_4.create
  729. this.tv_4=create tv_4
  730. this.Control[]={this.tv_4}
  731. end on
  732. on tabpage_4.destroy
  733. destroy(this.tv_4)
  734. end on
  735. type tv_4 from treeview within tabpage_4
  736. integer width = 2185
  737. integer height = 1748
  738. integer taborder = 20
  739. boolean bringtotop = true
  740. integer textsize = -9
  741. integer weight = 400
  742. fontcharset fontcharset = gb2312charset!
  743. fontpitch fontpitch = variable!
  744. string facename = "宋体"
  745. long textcolor = 33554432
  746. borderstyle borderstyle = stylelowered!
  747. string picturename[] = {"RegistrationDir5!","NestedReport!","NestedReport!"}
  748. long picturemaskcolor = 553648127
  749. long statepicturemaskcolor = 536870912
  750. end type
  751. event selectionchanged;long ll_hand
  752. treeviewitem tvi
  753. il_hand=this.finditem(CurrentTreeItem!,0)
  754. ll_hand=il_hand
  755. this.getitem(ll_hand,itvi)
  756. tvi=itvi
  757. ins_subidstr=left(tvi.label,pos(tvi.label,' ') -1 )
  758. ins_subidname = tvi.label
  759. tv_4.expanditem(ll_hand)
  760. end event
  761. event doubleclicked;cb_ok.triggerevent(clicked!)
  762. end event
  763. event clicked;this.triggerevent(selectionchanged!)
  764. end event
  765. type tabpage_5 from userobject within tab_subject
  766. event create ( )
  767. event destroy ( )
  768. integer x = 18
  769. integer y = 96
  770. integer width = 2190
  771. integer height = 1752
  772. long backcolor = 80269524
  773. string text = "损益类"
  774. long tabtextcolor = 33554432
  775. long tabbackcolor = 80269524
  776. long picturemaskcolor = 553648127
  777. tv_5 tv_5
  778. end type
  779. on tabpage_5.create
  780. this.tv_5=create tv_5
  781. this.Control[]={this.tv_5}
  782. end on
  783. on tabpage_5.destroy
  784. destroy(this.tv_5)
  785. end on
  786. type tv_5 from treeview within tabpage_5
  787. integer width = 2185
  788. integer height = 1748
  789. integer taborder = 50
  790. boolean bringtotop = true
  791. integer textsize = -9
  792. integer weight = 400
  793. fontcharset fontcharset = gb2312charset!
  794. fontpitch fontpitch = variable!
  795. string facename = "宋体"
  796. long textcolor = 33554432
  797. borderstyle borderstyle = stylelowered!
  798. string picturename[] = {"RegistrationDir5!","NestedReport!","NestedReport!"}
  799. long picturemaskcolor = 553648127
  800. long statepicturemaskcolor = 553648127
  801. end type
  802. event selectionchanged;Long ll_hand
  803. treeviewitem tvi
  804. il_hand = THIS.FindItem(CurrentTreeItem!,0)
  805. ll_hand = il_hand
  806. THIS.GetItem(ll_hand,itvi)
  807. tvi = itvi
  808. ins_subidstr = Left(tvi.Label,Pos(tvi.Label,' ') -1 )
  809. ins_subidname = tvi.Label
  810. tv_5.ExpandItem(ll_hand)
  811. end event
  812. event doubleclicked;cb_ok.triggerevent(clicked!)
  813. end event
  814. event clicked;this.triggerevent(selectionchanged!)
  815. end event
  816. type cb_add from uo_imflatbutton within w_subjectdef_edit
  817. integer x = 2254
  818. integer y = 380
  819. integer width = 384
  820. integer height = 96
  821. integer taborder = 50
  822. boolean bringtotop = true
  823. string text = "增加同级科目"
  824. end type
  825. event clicked;IF NOT (f_power_ind(1952,sys_msg_pow) OR f_power_ind(1966,sys_msg_pow)) THEN
  826. MessageBox(publ_operator,'你没有使用权限!')
  827. RETURN
  828. END IF
  829. String p_subid,c_subid
  830. String arg_msg
  831. Int ls_dcflag
  832. IF Len(ins_subidstr) = 0 THEN
  833. MessageBox(publ_operator,'请选择要增加同级科目的科目')
  834. RETURN
  835. END IF
  836. p_subid = ins_subidstr
  837. //***查询余额方向
  838. ls_dcflag = f_get_dcflag(p_subid,arg_msg)
  839. IF ls_dcflag = -1 THEN
  840. MessageBox(publ_operator,'增加同级科目失败,'+arg_msg)
  841. RETURN
  842. END IF
  843. IF uo_sub.new_begin(0,p_subid,arg_msg) = 0 THEN
  844. MessageBox(publ_operator,'增加同级科目失败,'+arg_msg)
  845. RETURN
  846. END IF
  847. c_subid = uo_sub.get_subid(0,p_subid,arg_msg)
  848. IF c_subid = 'err' THEN
  849. MessageBox(publ_operator,'增加同级科目失败,'+arg_msg)
  850. RETURN
  851. END IF
  852. s_sub_edit s_edit
  853. s_edit.openparm = 2
  854. s_edit.editflag = 1
  855. s_edit.subflag = 0
  856. s_edit.dcflag = ls_dcflag
  857. s_edit.subid = c_subid
  858. s_edit.subsubid = ''
  859. OpenWithParm(w_subjectdef_edit_input,s_edit)
  860. //****刷新树
  861. s_sub_edit s_rst_subid
  862. Long ll_hand,ll_handl
  863. s_rst_subid = Message.PowerObjectParm
  864. IF s_rst_subid.subid = '' THEN RETURN
  865. CHOOSE CASE tab_subject.SelectedTab
  866. CASE 1
  867. ll_hand = tv_1.FindItem(parenttreeitem!,il_hand)
  868. ll_handl = tv_1.InsertItemSort(ll_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  869. tv_1.SetFocus()
  870. tv_1.SelectItem ( ll_handl )
  871. CASE 2
  872. ll_hand = tv_2.FindItem(parenttreeitem!,il_hand)
  873. ll_handl = tv_2.InsertItemSort(ll_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  874. tv_2.SetFocus()
  875. tv_2.SelectItem ( ll_handl )
  876. CASE 3
  877. IF s_sys_accset.ifnewsubid = 0 THEN
  878. ll_hand = tv_3.FindItem(parenttreeitem!,il_hand)
  879. ll_handl = tv_3.InsertItemSort(ll_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  880. tv_3.SetFocus()
  881. tv_3.SelectItem ( ll_handl )
  882. ELSE
  883. ll_hand = tv_6.FindItem(parenttreeitem!,il_hand)
  884. ll_handl = tv_6.InsertItemSort(ll_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  885. tv_6.SetFocus()
  886. tv_6.SelectItem ( ll_handl )
  887. END IF
  888. CASE 4
  889. IF s_sys_accset.ifnewsubid = 0 THEN
  890. ll_hand = tv_4.FindItem(parenttreeitem!,il_hand)
  891. ll_handl = tv_4.InsertItemSort(ll_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  892. tv_4.SetFocus()
  893. tv_4.SelectItem ( ll_handl )
  894. ELSE
  895. ll_hand = tv_3.FindItem(parenttreeitem!,il_hand)
  896. ll_handl = tv_3.InsertItemSort(ll_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  897. tv_3.SetFocus()
  898. tv_3.SelectItem ( ll_handl )
  899. END IF
  900. CASE 5
  901. IF s_sys_accset.ifnewsubid = 0 THEN
  902. ll_hand = tv_5.FindItem(parenttreeitem!,il_hand)
  903. ll_handl = tv_5.InsertItemSort(ll_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  904. tv_5.SetFocus()
  905. tv_5.SelectItem ( ll_handl )
  906. ELSE
  907. ll_hand = tv_4.FindItem(parenttreeitem!,il_hand)
  908. ll_handl = tv_4.InsertItemSort(ll_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  909. tv_4.SetFocus()
  910. tv_4.SelectItem ( ll_handl )
  911. END IF
  912. CASE 6
  913. ll_hand = tv_5.FindItem(parenttreeitem!,il_hand)
  914. ll_handl = tv_5.InsertItemSort(ll_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  915. tv_5.SetFocus()
  916. tv_5.SelectItem ( ll_handl )
  917. END CHOOSE
  918. ins_subidstr = s_rst_subid.subid
  919. wf_dssubtree_retrieve()
  920. end event
  921. type cb_add_next from uo_imflatbutton within w_subjectdef_edit
  922. integer x = 2254
  923. integer y = 480
  924. integer width = 384
  925. integer height = 96
  926. integer taborder = 60
  927. boolean bringtotop = true
  928. string text = "增加下级科目"
  929. end type
  930. event clicked;IF NOT (f_power_ind(1952,sys_msg_pow) OR f_power_ind(1966,sys_msg_pow)) THEN
  931. MessageBox(publ_operator,'你没有使用权限!')
  932. RETURN
  933. END IF
  934. String p_subid,c_subid
  935. String arg_msg
  936. Int ls_dcflag
  937. IF Len(ins_subidstr) = 0 THEN
  938. MessageBox(publ_operator,'请选择要增加同级科目的科目')
  939. RETURN
  940. END IF
  941. p_subid = ins_subidstr
  942. //***查询余额方向
  943. ls_dcflag = f_get_dcflag(p_subid,arg_msg)
  944. IF ls_dcflag = -1 THEN
  945. MessageBox(publ_operator,'增加同级科目失败,'+arg_msg)
  946. RETURN
  947. END IF
  948. IF uo_sub.new_begin(1,p_subid,arg_msg) = 0 THEN
  949. MessageBox(publ_operator,'增加下级科目失败,'+arg_msg)
  950. RETURN
  951. END IF
  952. c_subid = uo_sub.get_subid(1,p_subid,arg_msg)
  953. IF c_subid = 'err' THEN
  954. MessageBox(publ_operator,'增加下级科目失败,'+arg_msg)
  955. RETURN
  956. END IF
  957. s_sub_edit s_edit
  958. s_edit.openparm = 1
  959. s_edit.editflag = 1
  960. s_edit.subflag = 1
  961. s_edit.dcflag = ls_dcflag
  962. s_edit.subid = p_subid
  963. s_edit.subsubid = Right(c_subid,Len(c_subid) - Len(p_subid))
  964. OpenWithParm(w_subjectdef_edit_input,s_edit)
  965. //****刷新树
  966. s_sub_edit s_rst_subid
  967. Long ll_handl
  968. s_rst_subid = Message.PowerObjectParm
  969. IF s_rst_subid.subid = '' THEN RETURN
  970. CHOOSE CASE tab_subject.SelectedTab
  971. CASE 1
  972. ll_handl = tv_1.InsertItemSort(il_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  973. tv_1.SetFocus()
  974. tv_1.SelectItem ( ll_handl )
  975. CASE 2
  976. ll_handl = tv_2.InsertItemSort(il_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  977. tv_2.SetFocus()
  978. tv_2.SelectItem ( ll_handl )
  979. CASE 3
  980. IF s_sys_accset.ifnewsubid = 0 THEN
  981. ll_handl = tv_3.InsertItemSort(il_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  982. tv_3.SetFocus()
  983. tv_3.SelectItem ( ll_handl )
  984. ELSE
  985. ll_handl = tv_6.InsertItemSort(il_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  986. tv_6.SetFocus()
  987. tv_6.SelectItem ( ll_handl )
  988. END IF
  989. CASE 4
  990. IF s_sys_accset.ifnewsubid = 0 THEN
  991. ll_handl = tv_4.InsertItemSort(il_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  992. tv_4.SetFocus()
  993. tv_4.SelectItem ( ll_handl )
  994. ELSE
  995. ll_handl = tv_3.InsertItemSort(il_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  996. tv_3.SetFocus()
  997. tv_3.SelectItem ( ll_handl )
  998. END IF
  999. CASE 5
  1000. IF s_sys_accset.ifnewsubid = 0 THEN
  1001. ll_handl = tv_5.InsertItemSort(il_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  1002. tv_5.SetFocus()
  1003. tv_5.SelectItem ( ll_handl )
  1004. ELSE
  1005. ll_handl = tv_4.InsertItemSort(il_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  1006. tv_4.SetFocus()
  1007. tv_4.SelectItem ( ll_handl )
  1008. END IF
  1009. CASE 6
  1010. ll_handl = tv_5.InsertItemSort(il_hand,s_rst_subid.subid+' '+s_rst_subid.subname,2)
  1011. tv_5.SetFocus()
  1012. tv_5.SelectItem ( ll_handl )
  1013. END CHOOSE
  1014. ins_subidstr = s_rst_subid.subid
  1015. wf_dssubtree_retrieve()
  1016. end event
  1017. type cb_mod from uo_imflatbutton within w_subjectdef_edit
  1018. integer x = 2254
  1019. integer y = 676
  1020. integer width = 384
  1021. integer height = 96
  1022. integer taborder = 80
  1023. boolean bringtotop = true
  1024. string text = "修改"
  1025. string normalpicname = "open.bmp"
  1026. end type
  1027. event clicked;IF NOT (f_power_ind(1952,sys_msg_pow) OR f_power_ind(1966,sys_msg_pow)) THEN
  1028. MessageBox(publ_operator,'你没有使用权限!')
  1029. RETURN
  1030. END IF
  1031. Long uc_row
  1032. String arg_msg
  1033. IF Len(ins_subidstr) = 0 THEN
  1034. MessageBox(publ_operator,'请选择要修改的科目')
  1035. RETURN
  1036. END IF
  1037. IF uo_sub.update_begin(ins_subidstr,arg_msg) = 0 THEN
  1038. MessageBox(publ_operator,arg_msg)
  1039. RETURN
  1040. END IF
  1041. s_sub_edit s_edit
  1042. s_edit.openparm = 3
  1043. s_edit.editflag = 1
  1044. s_edit.subflag = 0
  1045. s_edit.dcflag = 0
  1046. s_edit.subid = ins_subidstr
  1047. s_edit.subsubid = ''
  1048. OpenWithParm(w_subjectdef_edit_input,s_edit)
  1049. //****刷新树
  1050. s_sub_edit s_rst_subid
  1051. TreeViewItem l_tvi
  1052. s_rst_subid = Message.PowerObjectParm
  1053. IF s_rst_subid.subid = '' THEN RETURN
  1054. CHOOSE CASE tab_subject.SelectedTab
  1055. CASE 1
  1056. IF tv_1.GetItem(il_hand,l_tvi) > 0 THEN
  1057. l_tvi.Label = s_rst_subid.subid+' '+s_rst_subid.subname
  1058. tv_1.SetItem(il_hand, l_tvi)
  1059. END IF
  1060. tv_1.SetFocus()
  1061. tv_1.SelectItem ( il_hand )
  1062. CASE 2
  1063. IF tv_2.GetItem(il_hand,l_tvi) > 0 THEN
  1064. l_tvi.Label = s_rst_subid.subid+' '+s_rst_subid.subname
  1065. tv_2.SetItem(il_hand, l_tvi)
  1066. END IF
  1067. tv_1.SetFocus()
  1068. tv_2.SelectItem ( il_hand )
  1069. CASE 3
  1070. IF s_sys_accset.ifnewsubid = 0 THEN
  1071. IF tv_3.GetItem(il_hand,l_tvi) > 0 THEN
  1072. l_tvi.Label = s_rst_subid.subid+' '+s_rst_subid.subname
  1073. tv_3.SetItem(il_hand, l_tvi)
  1074. END IF
  1075. tv_3.SetFocus()
  1076. tv_3.SelectItem ( il_hand )
  1077. ELSE
  1078. IF tv_6.GetItem(il_hand,l_tvi) > 0 THEN
  1079. l_tvi.Label = s_rst_subid.subid+' '+s_rst_subid.subname
  1080. tv_6.SetItem(il_hand, l_tvi)
  1081. END IF
  1082. tv_6.SetFocus()
  1083. tv_6.SelectItem ( il_hand )
  1084. END IF
  1085. CASE 4
  1086. IF s_sys_accset.ifnewsubid = 0 THEN
  1087. IF tv_4.GetItem(il_hand,l_tvi) > 0 THEN
  1088. l_tvi.Label = s_rst_subid.subid+' '+s_rst_subid.subname
  1089. tv_4.SetItem(il_hand, l_tvi)
  1090. END IF
  1091. tv_4.SetFocus()
  1092. tv_4.SelectItem ( il_hand )
  1093. ELSE
  1094. IF tv_3.GetItem(il_hand,l_tvi) > 0 THEN
  1095. l_tvi.Label = s_rst_subid.subid+' '+s_rst_subid.subname
  1096. tv_3.SetItem(il_hand, l_tvi)
  1097. END IF
  1098. tv_3.SetFocus()
  1099. tv_3.SelectItem ( il_hand )
  1100. END IF
  1101. CASE 5
  1102. IF s_sys_accset.ifnewsubid = 0 THEN
  1103. IF tv_5.GetItem(il_hand,l_tvi) > 0 THEN
  1104. l_tvi.Label = s_rst_subid.subid+' '+s_rst_subid.subname
  1105. tv_5.SetItem(il_hand, l_tvi)
  1106. END IF
  1107. tv_5.SetFocus()
  1108. tv_5.SelectItem ( il_hand )
  1109. ELSE
  1110. IF tv_4.GetItem(il_hand,l_tvi) > 0 THEN
  1111. l_tvi.Label = s_rst_subid.subid+' '+s_rst_subid.subname
  1112. tv_4.SetItem(il_hand, l_tvi)
  1113. END IF
  1114. tv_4.SetFocus()
  1115. tv_4.SelectItem ( il_hand )
  1116. END IF
  1117. CASE 6
  1118. IF tv_5.GetItem(il_hand,l_tvi) > 0 THEN
  1119. l_tvi.Label = s_rst_subid.subid+' '+s_rst_subid.subname
  1120. tv_5.SetItem(il_hand, l_tvi)
  1121. END IF
  1122. tv_5.SetFocus()
  1123. tv_5.SelectItem ( il_hand )
  1124. END CHOOSE
  1125. ins_subidstr = s_rst_subid.subid
  1126. wf_dssubtree_retrieve()
  1127. end event
  1128. type cb_del from uo_imflatbutton within w_subjectdef_edit
  1129. integer x = 2254
  1130. integer y = 776
  1131. integer width = 384
  1132. integer height = 96
  1133. integer taborder = 100
  1134. boolean bringtotop = true
  1135. string text = "删除"
  1136. string normalpicname = "delete.bmp"
  1137. end type
  1138. event clicked;IF NOT (f_power_ind(1952,sys_msg_pow) OR f_power_ind(1966,sys_msg_pow)) THEN
  1139. MessageBox(publ_operator,'你没有使用权限!')
  1140. RETURN
  1141. END IF
  1142. String arg_msg = '',msg_str,ls_subid
  1143. Boolean if_only = FALSE
  1144. msg_str = '是否删除科目 '+ins_subidname
  1145. IF MessageBox(publ_operator,msg_str, Exclamation!, YesNo!, 2) = 2 THEN
  1146. RETURN
  1147. END IF
  1148. IF uo_sub.getinfo(Trim(ins_subidstr),arg_msg) = 0 THEN
  1149. MessageBox(publ_operator,arg_msg)
  1150. RETURN
  1151. END IF
  1152. IF uo_sub.check_ifmxsub(arg_msg) = 0 THEN
  1153. MessageBox(publ_operator,arg_msg+',不能删除')
  1154. RETURN
  1155. ELSE
  1156. IF uo_sub.check_suboperation(0,arg_msg) = 1 THEN
  1157. IF uo_sub.check_onlyonesub() = 0 THEN
  1158. MessageBox(publ_operator,arg_msg+',不能删除')
  1159. RETURN
  1160. ELSE
  1161. msg_str = ins_subidstr +' 科目已经有业务发生,但它是它的上级科目的唯一一个下级科目,如果将 ~n'
  1162. msg_str = msg_str+'该科目删除,则其上级科目将成为明细科目,但要将该科目所发生业务及币 ~n'
  1163. msg_str = msg_str+'种、核算内容等属性都将转移到其上级科目中去。~n~n'
  1164. msg_str = msg_str+'是否确认这种引起科目级别发生的修改? ~n'
  1165. IF MessageBox(publ_operator,msg_str, Exclamation!, YesNo!, 2) = 2 THEN
  1166. RETURN
  1167. ELSE
  1168. IF uo_sub.update_add_del(0,uo_sub.subid,arg_msg,FALSE) = 0 THEN
  1169. MessageBox(publ_operator,arg_msg)
  1170. RETURN
  1171. END IF
  1172. END IF
  1173. END IF
  1174. ELSEIF uo_sub.check_suboperation(0,arg_msg) = 0 THEN
  1175. MessageBox(publ_operator,arg_msg+',不能删除')
  1176. RETURN
  1177. END IF
  1178. END IF
  1179. IF uo_sub.del_sub(arg_msg,TRUE) = 0 THEN
  1180. MessageBox(publ_operator,arg_msg)
  1181. RETURN
  1182. ELSE
  1183. MessageBox(publ_operator,'删除科目成功')
  1184. CHOOSE CASE tab_subject.SelectedTab
  1185. CASE 1
  1186. tv_1.DeleteItem(il_hand)
  1187. CASE 2
  1188. tv_2.DeleteItem(il_hand)
  1189. CASE 3
  1190. IF s_sys_accset.ifnewsubid = 0 THEN
  1191. tv_3.DeleteItem(il_hand)
  1192. ELSE
  1193. tv_6.DeleteItem(il_hand)
  1194. END IF
  1195. CASE 4
  1196. IF s_sys_accset.ifnewsubid = 0 THEN
  1197. tv_4.DeleteItem(il_hand)
  1198. ELSE
  1199. tv_3.DeleteItem(il_hand)
  1200. END IF
  1201. CASE 5
  1202. IF s_sys_accset.ifnewsubid = 0 THEN
  1203. tv_5.DeleteItem(il_hand)
  1204. ELSE
  1205. tv_4.DeleteItem(il_hand)
  1206. END IF
  1207. CASE 6
  1208. tv_5.DeleteItem(il_hand)
  1209. END CHOOSE
  1210. wf_dssubtree_retrieve()
  1211. END IF
  1212. end event
  1213. type cb_print from uo_imflatbutton within w_subjectdef_edit
  1214. integer x = 2254
  1215. integer y = 1184
  1216. integer width = 384
  1217. integer height = 96
  1218. integer taborder = 70
  1219. boolean bringtotop = true
  1220. string text = "打印"
  1221. string normalpicname = "print.bmp"
  1222. end type
  1223. event clicked;IF NOT (f_power_ind(1953,sys_msg_pow) OR f_power_ind(1967,sys_msg_pow)) THEN
  1224. MessageBox(publ_operator,'你没有使用权限!')
  1225. RETURN
  1226. END IF
  1227. OPEN(w_rp_subject)
  1228. end event
  1229. type cb_refresh from uo_imflatbutton within w_subjectdef_edit
  1230. integer x = 2254
  1231. integer y = 1080
  1232. integer width = 384
  1233. integer height = 96
  1234. integer taborder = 30
  1235. boolean bringtotop = true
  1236. string text = "刷新"
  1237. string normalpicname = "refresh.bmp"
  1238. end type
  1239. event clicked;wf_dssubtree_retrieve()
  1240. wf_maketree()
  1241. end event
  1242. type cb_ok from uo_imflatbutton within w_subjectdef_edit
  1243. integer x = 2254
  1244. integer y = 104
  1245. integer width = 384
  1246. integer height = 96
  1247. integer taborder = 40
  1248. string normalpicname = "ok.bmp"
  1249. end type
  1250. event clicked;String arg_msg
  1251. IF Len(ins_subidstr) = 0 THEN
  1252. MessageBox('系统提示','请先选择目标会计科目!',StopSign!)
  1253. RETURN
  1254. END IF
  1255. s_rt_subject.subid = ins_subidstr
  1256. IF uo_sub.getinfo(Trim(ins_subidstr),arg_msg) = 0 THEN
  1257. MessageBox(publ_operator,arg_msg)
  1258. RETURN
  1259. END IF
  1260. IF if_check_ifmx = 0 THEN
  1261. IF uo_sub.check_ifmxsub(arg_msg) = 0 THEN
  1262. MessageBox(publ_operator,arg_msg+',不能选择')
  1263. RETURN
  1264. END IF
  1265. ELSEIF if_check_ifmx = 1 THEN
  1266. IF uo_sub.check_ifmxsub(arg_msg) = 1 THEN
  1267. MessageBox(publ_operator,'明细科目,不能选择')
  1268. RETURN
  1269. END IF
  1270. END IF
  1271. String ls_name,ls_unit
  1272. Int ls_dcflag,ls_detailflag,ls_hswb,ls_hsqty,ls_hsdept,ls_hsemp,ls_hsitem,ls_hscust,ls_hsspt
  1273. int ls_hstrader
  1274. Long ls_moneyid
  1275. SELECT name,dcflag,detailflag,hswb,moneyid,hsqty,unit,hsdept,hsemp,hsitem,hscust,hsspt,hstrader
  1276. INTO :ls_name,:ls_dcflag,:ls_detailflag,:ls_hswb,:ls_moneyid,:ls_hsqty,:ls_unit,:ls_hsdept,:ls_hsemp,:ls_hsitem,
  1277. :ls_hscust,:ls_hsspt,:ls_hstrader
  1278. FROM cw_subject
  1279. WHERE accsetid = :sys_accsetid
  1280. AND subid = :ins_subidstr;
  1281. IF sqlca.SQLCode <> 0 THEN
  1282. MessageBox(publ_operator,'查询会计科目:'+ins_subidstr+'资料失败,不能选择')
  1283. RETURN
  1284. END IF
  1285. s_rt_subject.Name = ls_name
  1286. s_rt_subject.dcflag = ls_dcflag
  1287. s_rt_subject.detailflag = ls_detailflag
  1288. s_rt_subject.hswb = ls_hswb
  1289. s_rt_subject.moneyid = ls_moneyid
  1290. s_rt_subject.hsqty = ls_hsqty
  1291. s_rt_subject.unit = ls_unit
  1292. s_rt_subject.hsdept = ls_hsdept
  1293. s_rt_subject.hsemp = ls_hsemp
  1294. s_rt_subject.hsitem = ls_hsitem
  1295. s_rt_subject.hscust = ls_hscust
  1296. s_rt_subject.hsspt = ls_hsspt
  1297. s_rt_subject.hstrader = ls_hstrader
  1298. sys_last_selected_subid = ins_subidstr
  1299. Close(PARENT)
  1300. //subid
  1301. //name
  1302. //dcflag
  1303. //detailflag
  1304. //hswb
  1305. //moneyid
  1306. //hsqty
  1307. //unit
  1308. //hsdept
  1309. //hsemp
  1310. //hsitem
  1311. //specialcode
  1312. end event
  1313. type cb_3 from uo_imflatbutton within w_subjectdef_edit
  1314. integer x = 2254
  1315. integer y = 1668
  1316. integer width = 384
  1317. integer height = 96
  1318. integer taborder = 110
  1319. boolean bringtotop = true
  1320. string text = "调整科目标记"
  1321. end type
  1322. event clicked;String subid[],Name[],ls_subid,ls_name,ls_displaycode
  1323. Long accsetid[],mxt,ls_accsetid,i,cnt
  1324. Int len_subid
  1325. DECLARE sub_cur CURSOR FOR
  1326. SELECT cw_subject.accsetid,
  1327. cw_subject.subid,
  1328. cw_subject.name
  1329. FROM cw_subject
  1330. Where accsetid = :sys_accsetid;
  1331. OPEN sub_cur;
  1332. FETCH sub_cur INTO :ls_accsetid,:ls_subid,:ls_name;
  1333. DO WHILE sqlca.SQLCode = 0
  1334. mxt++
  1335. accsetid[mxt] = ls_accsetid
  1336. subid[mxt] = ls_subid
  1337. Name[mxt] = ls_name
  1338. FETCH sub_cur INTO :ls_accsetid,:ls_subid,:ls_name;
  1339. LOOP
  1340. CLOSE sub_cur;
  1341. FOR i = 1 TO mxt
  1342. len_subid = Len(subid[i])
  1343. cnt = 0
  1344. SELECT count(*) INTO :cnt
  1345. FROM cw_subject
  1346. WHERE accsetid = :accsetid[i]
  1347. AND len(subid) > :len_subid
  1348. AND Left(subid,:len_subid) = :subid[i];
  1349. IF sqlca.SQLCode <> 0 THEN
  1350. ROLLBACK;
  1351. MessageBox("","select error!")
  1352. RETURN
  1353. END IF
  1354. Int li_detailflag
  1355. IF cnt = 0 THEN
  1356. li_detailflag = 1
  1357. ELSE
  1358. li_detailflag = 0
  1359. END IF
  1360. UPDATE cw_subject SET detailflag = :li_detailflag
  1361. WHERE accsetid = :accsetid[i]
  1362. AND subid = :subid[i];
  1363. IF sqlca.SQLCode <> 0 THEN
  1364. String ls_err
  1365. ls_err = sqlca.SQLErrText
  1366. ROLLBACK;
  1367. MessageBox("提示","更新失败,"+ls_err)
  1368. RETURN
  1369. END IF
  1370. NEXT
  1371. COMMIT;
  1372. MessageBox("提示",'修改成功')
  1373. wf_dssubtree_retrieve()
  1374. wf_maketree()
  1375. end event
  1376. type cb_6 from uo_imflatbutton within w_subjectdef_edit
  1377. integer x = 2254
  1378. integer y = 1768
  1379. integer width = 384
  1380. integer height = 88
  1381. integer taborder = 120
  1382. boolean bringtotop = true
  1383. string text = "更新科目名称"
  1384. end type
  1385. event clicked;String subid[],Name[],ls_subid,ls_name,ls_displaycode
  1386. Long accsetid[],mxt,ls_accsetid,i
  1387. DECLARE sub_cur CURSOR FOR
  1388. SELECT cw_subject.accsetid,
  1389. cw_subject.subid,
  1390. cw_subject.name
  1391. FROM cw_subject
  1392. Where accsetid = :sys_accsetid;
  1393. OPEN sub_cur;
  1394. FETCH sub_cur INTO :ls_accsetid,:ls_subid,:ls_name;
  1395. DO WHILE sqlca.SQLCode = 0
  1396. mxt++
  1397. accsetid[mxt] = ls_accsetid
  1398. subid[mxt] = ls_subid
  1399. Name[mxt] = ls_name
  1400. FETCH sub_cur INTO :ls_accsetid,:ls_subid,:ls_name;
  1401. LOOP
  1402. CLOSE sub_cur;
  1403. FOR i = 1 TO mxt
  1404. ls_displaycode = f_rst_subdisplay(subid[i],Name[i])
  1405. UPDATE cw_subject SET displaycode = :ls_displaycode
  1406. WHERE accsetid = :accsetid[i]
  1407. AND subid = :subid[i];
  1408. IF sqlca.SQLCode <> 0 THEN
  1409. String ls_err
  1410. ls_err = sqlca.SQLErrText
  1411. ROLLBACK;
  1412. MessageBox("提示","更新失败,"+ls_err)
  1413. RETURN
  1414. END IF
  1415. NEXT
  1416. COMMIT;
  1417. MessageBox("提示",'修改成功')
  1418. wf_dssubtree_retrieve()
  1419. wf_maketree()
  1420. end event
  1421. type cb_11 from uo_imflatbutton within w_subjectdef_edit
  1422. integer x = 2254
  1423. integer y = 1492
  1424. integer width = 384
  1425. integer height = 96
  1426. integer taborder = 100
  1427. boolean bringtotop = true
  1428. string text = "导出帐套科目"
  1429. end type
  1430. event clicked;IF NOT sys_power_issuper THEN
  1431. MessageBox('系统提示','不是帐套管理员,不能导出')
  1432. RETURN
  1433. END IF
  1434. string msg
  1435. msg = '是否确定要导出帐套科目?'
  1436. IF MessageBox ("IF",msg,Question!,YesNo! ) = 2 THEN RETURN
  1437. Open(w_subject_export)
  1438. end event
  1439. type cb_tab from commandbutton within w_subjectdef_edit
  1440. boolean visible = false
  1441. integer x = 2277
  1442. integer width = 219
  1443. integer height = 84
  1444. integer taborder = 30
  1445. boolean bringtotop = true
  1446. integer textsize = -9
  1447. integer weight = 400
  1448. fontcharset fontcharset = gb2312charset!
  1449. fontpitch fontpitch = variable!
  1450. string facename = "宋体"
  1451. string text = "none"
  1452. end type
  1453. event clicked;Long i
  1454. IF sys_last_selected_subid <> '' THEN
  1455. CHOOSE CASE Left(sys_last_selected_subid,1)
  1456. CASE '1'
  1457. tab_subject.SelectedTab = 1
  1458. FOR i = 1 TO il_p1
  1459. IF is_subtree_arr1[i].subid = sys_last_selected_subid THEN
  1460. tv_1.SetFocus()
  1461. tv_1.SelectItem(is_subtree_arr1[i].Handle)
  1462. il_hand = is_subtree_arr1[i].Handle
  1463. END IF
  1464. NEXT
  1465. CASE '2'
  1466. tab_subject.SelectedTab = 2
  1467. FOR i = 1 TO il_p2
  1468. IF is_subtree_arr2[i].subid = sys_last_selected_subid THEN
  1469. tv_2.SetFocus()
  1470. tv_2.SelectItem(is_subtree_arr2[i].Handle)
  1471. il_hand = is_subtree_arr2[i].Handle
  1472. END IF
  1473. NEXT
  1474. CASE '3'
  1475. tab_subject.SelectedTab = 3
  1476. FOR i = 1 TO il_p3
  1477. IF is_subtree_arr3[i].subid = sys_last_selected_subid THEN
  1478. tv_3.SetFocus()
  1479. tv_3.SelectItem(is_subtree_arr3[i].Handle)
  1480. il_hand = is_subtree_arr3[i].Handle
  1481. END IF
  1482. NEXT
  1483. CASE '4'
  1484. tab_subject.SelectedTab = 4
  1485. FOR i = 1 TO il_p4
  1486. IF is_subtree_arr4[i].subid = sys_last_selected_subid THEN
  1487. tv_4.SetFocus()
  1488. tv_4.SelectItem(is_subtree_arr4[i].Handle)
  1489. il_hand = is_subtree_arr4[i].Handle
  1490. END IF
  1491. NEXT
  1492. CASE '5'
  1493. tab_subject.SelectedTab = 5
  1494. FOR i = 1 TO il_p5
  1495. IF is_subtree_arr5[i].subid = sys_last_selected_subid THEN
  1496. tv_5.SetFocus()
  1497. tv_5.SelectItem(is_subtree_arr5[i].Handle)
  1498. il_hand = is_subtree_arr5[i].Handle
  1499. END IF
  1500. NEXT
  1501. END CHOOSE
  1502. END IF
  1503. end event