w_credence_bala.srw 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. $PBExportHeader$w_credence_bala.srw
  2. $PBExportComments$期末结帐
  3. forward
  4. global type w_credence_bala from w_publ_base
  5. end type
  6. type dw_1 from datawindow within w_credence_bala
  7. end type
  8. type cb_1 from uo_imflatbutton within w_credence_bala
  9. end type
  10. type mle_1 from multilineedit within w_credence_bala
  11. end type
  12. type p_1 from picture within w_credence_bala
  13. end type
  14. type mle_2 from multilineedit within w_credence_bala
  15. end type
  16. type gb_2 from groupbox within w_credence_bala
  17. end type
  18. type gb_1 from groupbox within w_credence_bala
  19. end type
  20. type mle_3 from multilineedit within w_credence_bala
  21. end type
  22. type cbx_check_p from checkbox within w_credence_bala
  23. end type
  24. type cb_check_p from uo_imflatbutton within w_credence_bala
  25. end type
  26. end forward
  27. global type w_credence_bala from w_publ_base
  28. integer width = 2117
  29. integer height = 1688
  30. string title = "期末结帐"
  31. boolean minbox = false
  32. long backcolor = 80269524
  33. dw_1 dw_1
  34. cb_1 cb_1
  35. mle_1 mle_1
  36. p_1 p_1
  37. mle_2 mle_2
  38. gb_2 gb_2
  39. gb_1 gb_1
  40. mle_3 mle_3
  41. cbx_check_p cbx_check_p
  42. cb_check_p cb_check_p
  43. end type
  44. global w_credence_bala w_credence_bala
  45. type variables
  46. uo_credence uo_credpost
  47. end variables
  48. on w_credence_bala.create
  49. int iCurrent
  50. call super::create
  51. this.dw_1=create dw_1
  52. this.cb_1=create cb_1
  53. this.mle_1=create mle_1
  54. this.p_1=create p_1
  55. this.mle_2=create mle_2
  56. this.gb_2=create gb_2
  57. this.gb_1=create gb_1
  58. this.mle_3=create mle_3
  59. this.cbx_check_p=create cbx_check_p
  60. this.cb_check_p=create cb_check_p
  61. iCurrent=UpperBound(this.Control)
  62. this.Control[iCurrent+1]=this.dw_1
  63. this.Control[iCurrent+2]=this.cb_1
  64. this.Control[iCurrent+3]=this.mle_1
  65. this.Control[iCurrent+4]=this.p_1
  66. this.Control[iCurrent+5]=this.mle_2
  67. this.Control[iCurrent+6]=this.gb_2
  68. this.Control[iCurrent+7]=this.gb_1
  69. this.Control[iCurrent+8]=this.mle_3
  70. this.Control[iCurrent+9]=this.cbx_check_p
  71. this.Control[iCurrent+10]=this.cb_check_p
  72. end on
  73. on w_credence_bala.destroy
  74. call super::destroy
  75. destroy(this.dw_1)
  76. destroy(this.cb_1)
  77. destroy(this.mle_1)
  78. destroy(this.p_1)
  79. destroy(this.mle_2)
  80. destroy(this.gb_2)
  81. destroy(this.gb_1)
  82. destroy(this.mle_3)
  83. destroy(this.cbx_check_p)
  84. destroy(this.cb_check_p)
  85. end on
  86. event open;call super::open;dw_1.settransobject(sqlca)
  87. dw_1.retrieve(sys_accsetid)
  88. uo_credpost = create uo_credence
  89. end event
  90. event close;destroy uo_credpost
  91. end event
  92. type cb_func from w_publ_base`cb_func within w_credence_bala
  93. boolean visible = false
  94. integer x = 283
  95. integer y = 328
  96. boolean enabled = false
  97. end type
  98. type cb_exit from w_publ_base`cb_exit within w_credence_bala
  99. integer x = 1696
  100. integer y = 1404
  101. string text = "取消"
  102. end type
  103. type dw_1 from datawindow within w_credence_bala
  104. integer x = 631
  105. integer y = 52
  106. integer width = 1413
  107. integer height = 152
  108. integer taborder = 30
  109. boolean bringtotop = true
  110. string dataobject = "dw_accset_curyearmon"
  111. boolean border = false
  112. boolean livescroll = true
  113. end type
  114. type cb_1 from uo_imflatbutton within w_credence_bala
  115. integer x = 1275
  116. integer y = 1404
  117. integer width = 311
  118. integer height = 96
  119. integer taborder = 80
  120. boolean bringtotop = true
  121. boolean default = true
  122. string normalpicname = "ok.bmp"
  123. end type
  124. event clicked;String arg_msg
  125. Long cnt
  126. datetime ldt_startdate
  127. ldt_startdate = f_rst_mon_1st(1,sys_curyearmon)
  128. cnt = 0
  129. SELECT count(*) INTO :cnt FROM cw_credence
  130. WHERE accsetid = :sys_accsetid
  131. AND relevantbillid = :sys_curyearmon
  132. And Readtype = 201;
  133. IF sqlca.SQLCode <> 0 THEN
  134. MessageBox(publ_operator,'查询本月固定资产是否已计提折旧失败,'+sqlca.SQLErrText)
  135. RETURN
  136. END IF
  137. IF cnt = 0 THEN
  138. cnt = 0
  139. SELECT count(*) INTO :cnt
  140. FROM cw_assetcard,cw_astbalance
  141. WHERE ( cw_assetcard.accsetid = cw_astbalance.accsetid) AND
  142. ( cw_assetcard.assetcardid = cw_astbalance.assetcardid) AND
  143. ( cw_astbalance.yearmon = :sys_curyearmon ) AND
  144. ( cw_astbalance.accsetid = :sys_accsetid ) AND
  145. ( cw_assetcard.clearflag = 0 ) AND
  146. ( cw_assetcard.deprediateid > 0 ) AND
  147. ( cw_assetcard.startdate < :ldt_startdate ) and
  148. ( cw_astbalance.totalwl <= cw_assetcard.workload + cw_assetcard.usedall );
  149. IF sqlca.SQLCode <> 0 THEN
  150. MessageBox(publ_operator,'查询本月固定资产是否未计提折旧失败,'+sqlca.SQLErrText)
  151. RETURN
  152. END IF
  153. IF cnt > 0 THEN
  154. MessageBox(publ_operator,'本期固定资产未计提折旧,不能结帐,如需要结帐,请先计提固定资产折旧')
  155. RETURN
  156. END IF
  157. END IF
  158. IF cbx_check_p.Checked THEN
  159. cb_check_p.TriggerEvent(Clicked!)
  160. END IF
  161. IF uo_credpost.balance(False,arg_msg,True) = 0 THEN
  162. MessageBox(publ_operator,arg_msg)
  163. RETURN
  164. END IF
  165. f_setsysoplog('结帐','结帐,用户:'+publ_operator+',帐套:'+s_sys_accset.accsetname,arg_msg,True)
  166. arg_msg = '会计期间:'+String(sys_curyearmon)+'期末结帐成功'
  167. MessageBox(publ_operator,arg_msg)
  168. f_set_accsetmessage()
  169. Close(Parent)
  170. end event
  171. type mle_1 from multilineedit within w_credence_bala
  172. integer x = 617
  173. integer y = 620
  174. integer width = 1417
  175. integer height = 172
  176. integer taborder = 20
  177. integer textsize = -9
  178. integer weight = 400
  179. fontcharset fontcharset = gb2312charset!
  180. fontpitch fontpitch = variable!
  181. string facename = "宋体"
  182. long textcolor = 255
  183. long backcolor = 80269524
  184. string text = " 在结帐之前,应先检查本期发生的各种经济业务是否都已经编制记帐凭证并登记入帐。对各种成本费用类帐户,也应当在结帐之前对余额进行结转,并登记入帐。"
  185. boolean border = false
  186. boolean displayonly = true
  187. end type
  188. type p_1 from picture within w_credence_bala
  189. integer x = 37
  190. integer y = 40
  191. integer width = 549
  192. integer height = 836
  193. boolean bringtotop = true
  194. boolean originalsize = true
  195. string picturename = "graphics\balance.bmp"
  196. boolean border = true
  197. borderstyle borderstyle = stylelowered!
  198. boolean focusrectangle = false
  199. end type
  200. type mle_2 from multilineedit within w_credence_bala
  201. integer x = 617
  202. integer y = 264
  203. integer width = 1417
  204. integer height = 272
  205. integer taborder = 50
  206. integer textsize = -9
  207. integer weight = 400
  208. fontcharset fontcharset = gb2312charset!
  209. fontpitch fontpitch = variable!
  210. string facename = "宋体"
  211. long textcolor = 16711680
  212. long backcolor = 16777215
  213. string text = " 为了总结某一会计期间(年度或月度)的经营活动情况,必须定期进行结帐,结帐就是把一定时期内发生的经济业务在全部登记入帐的基础上,将各种帐簿记录结出~"本期发生额~"和~"期末余额~",从而根据帐簿记录编制会计报表。"
  214. boolean displayonly = true
  215. borderstyle borderstyle = stylelowered!
  216. end type
  217. type gb_2 from groupbox within w_credence_bala
  218. integer x = 37
  219. integer y = 1332
  220. integer width = 2043
  221. integer height = 36
  222. integer taborder = 40
  223. integer textsize = -9
  224. integer weight = 400
  225. fontcharset fontcharset = gb2312charset!
  226. fontpitch fontpitch = variable!
  227. string facename = "宋体"
  228. long textcolor = 33554432
  229. long backcolor = 67108864
  230. end type
  231. type gb_1 from groupbox within w_credence_bala
  232. integer x = 594
  233. integer y = 16
  234. integer width = 1486
  235. integer height = 1160
  236. integer taborder = 70
  237. integer textsize = -9
  238. integer weight = 400
  239. fontcharset fontcharset = gb2312charset!
  240. fontpitch fontpitch = variable!
  241. string facename = "宋体"
  242. long textcolor = 33554432
  243. long backcolor = 67108864
  244. borderstyle borderstyle = styleraised!
  245. end type
  246. type mle_3 from multilineedit within w_credence_bala
  247. integer x = 617
  248. integer y = 880
  249. integer width = 1417
  250. integer height = 288
  251. integer taborder = 60
  252. boolean bringtotop = true
  253. integer textsize = -14
  254. integer weight = 700
  255. fontcharset fontcharset = gb2312charset!
  256. fontpitch fontpitch = fixed!
  257. fontfamily fontfamily = modern!
  258. string facename = "楷体_GB2312"
  259. boolean underline = true
  260. long textcolor = 255
  261. long backcolor = 83488739
  262. string text = " 注意:如果当前期间为~"反结帐~"期间,请先~"反计提~"固定资产累计折旧,重新登帐前再重新计提折旧!"
  263. boolean border = false
  264. end type
  265. type cbx_check_p from checkbox within w_credence_bala
  266. integer x = 663
  267. integer y = 1216
  268. integer width = 576
  269. integer height = 80
  270. boolean bringtotop = true
  271. integer textsize = -9
  272. integer weight = 400
  273. fontcharset fontcharset = gb2312charset!
  274. fontpitch fontpitch = variable!
  275. string facename = "宋体"
  276. long textcolor = 33554432
  277. long backcolor = 67108864
  278. string text = "结帐前检查试算平衡"
  279. boolean checked = true
  280. end type
  281. type cb_check_p from uo_imflatbutton within w_credence_bala
  282. integer x = 782
  283. integer y = 1404
  284. integer width = 384
  285. integer height = 96
  286. integer taborder = 20
  287. boolean bringtotop = true
  288. string text = "检查试算平衡"
  289. end type
  290. event clicked;datastore ds_check_p
  291. Long ll_grade_len
  292. ll_grade_len = f_rst_grade_len(1)
  293. ds_check_p = CREATE datastore
  294. ds_check_p.DataObject = 'dw_rp_balance'
  295. ds_check_p.SetTransObject(sqlca)
  296. datawindowchild childdw_subid
  297. ds_check_p.GetChild("subid",childdw_subid)
  298. childdw_subid.SetTransObject (sqlca)
  299. ddd_subid_display.ShareData(childdw_subid)
  300. IF ds_check_p.Retrieve(sys_accsetid,0,sys_curyearmon,ll_grade_len,1) > 0 THEN
  301. IF String(ds_check_p.Object.debit_sum[1],'#####,###.00') <> String(ds_check_p.Object.credit_sum[1],'#####,###.00') THEN
  302. MessageBox('提示','试算不平衡')
  303. RETURN
  304. END IF
  305. END IF
  306. end event