w_rapmoney_mod.srw 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. $PBExportHeader$w_rapmoney_mod.srw
  2. forward
  3. global type w_rapmoney_mod from w_publ_base
  4. end type
  5. type dw_1 from datawindow within w_rapmoney_mod
  6. end type
  7. type cb_2 from uo_imflatbutton within w_rapmoney_mod
  8. end type
  9. type cb_1 from uo_imflatbutton within w_rapmoney_mod
  10. end type
  11. type gb_1 from groupbox within w_rapmoney_mod
  12. end type
  13. end forward
  14. global type w_rapmoney_mod from w_publ_base
  15. integer width = 1879
  16. integer height = 1172
  17. string title = "出纳帐录入"
  18. boolean minbox = false
  19. windowtype windowtype = response!
  20. long backcolor = 80269524
  21. dw_1 dw_1
  22. cb_2 cb_2
  23. cb_1 cb_1
  24. gb_1 gb_1
  25. end type
  26. global w_rapmoney_mod w_rapmoney_mod
  27. type variables
  28. s_edit_index_tran s_tran
  29. uo_rapmoney uo_rap
  30. end variables
  31. forward prototypes
  32. public function integer wf_save ()
  33. end prototypes
  34. public function integer wf_save ();int rslt = 1
  35. long li_row
  36. dw_1.accepttext()
  37. li_row = dw_1.getrow()
  38. if li_row <= 0 then
  39. messagebox('提示','记录错误',information!,ok!)
  40. rslt = 0
  41. goto ext
  42. end if
  43. long arg_accountid
  44. long arg_rapid
  45. datetime arg_takedate
  46. string arg_billcode
  47. string arg_dscrp
  48. decimal arg_msttakeamt
  49. decimal arg_takeamt
  50. string arg_msg
  51. long arg_banktypeid
  52. string arg_takeemp
  53. long arg_scid
  54. string arg_relcode
  55. arg_accountid = dw_1.object.accountid[li_row]
  56. arg_rapid = dw_1.object.rapmoneyid[li_row]
  57. arg_takedate = dw_1.object.takedate[li_row]
  58. arg_billcode = dw_1.object.billcode[li_row]
  59. arg_dscrp = dw_1.object.dscrp[li_row]
  60. arg_msttakeamt = dw_1.object.msttakeamt[li_row]
  61. arg_takeamt = dw_1.object.takeamt[li_row]
  62. arg_takeemp = dw_1.object.takeemp[li_row]
  63. arg_banktypeid = dw_1.object.banktypeid[li_row]
  64. arg_scid = dw_1.object.scid[li_row]
  65. arg_relcode = dw_1.object.relcode[li_row]
  66. uo_rap.commit_transaction = sqlca
  67. if arg_rapid = 0 then
  68. if uo_rap.add_raprec(arg_scid,arg_accountid,arg_takedate,arg_takeemp,arg_dscrp,arg_msttakeamt,arg_takeamt,arg_billcode,0,0,0,publ_operator,arg_msg,true,arg_banktypeid,arg_relcode) = 0 then
  69. messagebox('错误',arg_msg,stopsign!,ok!)
  70. rslt = 0
  71. goto ext
  72. end if
  73. else
  74. if uo_rap.mod_raprec(arg_scid,arg_accountid,arg_rapid,arg_takedate,arg_takeemp,arg_msttakeamt,arg_takeamt,arg_dscrp,arg_billcode,0,publ_operator,arg_msg,true,0,arg_banktypeid,arg_relcode) = 0 then
  75. messagebox('错误',arg_msg,stopsign!,ok!)
  76. rslt = 0
  77. goto ext
  78. end if
  79. end if
  80. ext:
  81. return rslt
  82. end function
  83. on w_rapmoney_mod.create
  84. int iCurrent
  85. call super::create
  86. this.dw_1=create dw_1
  87. this.cb_2=create cb_2
  88. this.cb_1=create cb_1
  89. this.gb_1=create gb_1
  90. iCurrent=UpperBound(this.Control)
  91. this.Control[iCurrent+1]=this.dw_1
  92. this.Control[iCurrent+2]=this.cb_2
  93. this.Control[iCurrent+3]=this.cb_1
  94. this.Control[iCurrent+4]=this.gb_1
  95. end on
  96. on w_rapmoney_mod.destroy
  97. call super::destroy
  98. destroy(this.dw_1)
  99. destroy(this.cb_2)
  100. destroy(this.cb_1)
  101. destroy(this.gb_1)
  102. end on
  103. event open;call super::open;dw_1.SetTransObject(sqlca)
  104. s_tran = Message.PowerObjectParm
  105. uo_rap = Create uo_rapmoney
  106. Int li_opentype
  107. Long li_rapid,li_accountsid
  108. Long li_row
  109. li_opentype = s_tran.b_long
  110. li_accountsid = s_tran.c_long
  111. li_rapid = s_tran.d_long
  112. IF li_opentype = 1 THEN
  113. dw_1.SetRedraw(False)
  114. li_row = dw_1.InsertRow(0)
  115. dw_1.Object.accountid[li_row] = li_accountsid
  116. dw_1.SetRedraw(True)
  117. ELSE
  118. dw_1.Retrieve(li_rapid,li_accountsid)
  119. END IF
  120. datawindowchild childdw
  121. dw_1.SetTransObject (sqlca)
  122. dw_1.GetChild("scid",childdw)
  123. childdw.SetTransObject (sqlca)
  124. IF childdw.Retrieve(sys_user_scid) = 0 THEN
  125. childdw.InsertRow(0)
  126. END IF
  127. end event
  128. event close;call super::close;destroy uo_rap
  129. end event
  130. type cb_func from w_publ_base`cb_func within w_rapmoney_mod
  131. boolean visible = false
  132. integer x = 325
  133. integer y = 836
  134. end type
  135. type cb_exit from w_publ_base`cb_exit within w_rapmoney_mod
  136. integer x = 1477
  137. integer y = 956
  138. integer taborder = 30
  139. string text = "取消"
  140. end type
  141. type dw_1 from datawindow within w_rapmoney_mod
  142. event key pbm_dwnkey
  143. event dwnkey pbm_dwnkey
  144. integer x = 18
  145. integer y = 56
  146. integer width = 1774
  147. integer height = 880
  148. integer taborder = 10
  149. boolean bringtotop = true
  150. string dataobject = "dw_rapmoney_mod"
  151. boolean livescroll = true
  152. borderstyle borderstyle = stylelowered!
  153. end type
  154. event dwnkey;if key = KeyDownArrow! then return 1
  155. string ls_itemcode
  156. string ls_itemname
  157. string ls_itemtype
  158. int li_itemflag
  159. long ll_itemid,li_row
  160. dw_1.accepttext()
  161. li_row=dw_1.getrow()
  162. if dw_1.getcolumnname ( )='u_itemdef_itemcode' and key = keyenter! then
  163. // ls_itemcode=trim(dw_1.object.u_itemdef_itemcode[li_row])
  164. // select itemid,itemname,itemflag,itemtype into :ll_itemid,:ls_itemname,:li_itemflag,:ls_itemtype from u_itemdef where itemcode=:ls_itemcode;
  165. // dw_1.setredraw(false)
  166. // if sqlca.sqlcode<>0 then
  167. // dw_1.triggerevent(doubleclicked!)
  168. // return 0
  169. // else
  170. // dw_1.object.u_iteminput_itemid[li_row]=ll_itemid
  171. // dw_1.object.u_itemdef_itemname[li_row]=ls_itemname
  172. // dw_1.object.u_itemdef_itemtype[li_row]=ls_itemtype
  173. // dw_1.object.u_itemdef_itemflag[li_row]=li_itemflag
  174. // end if
  175. // dw_1.setredraw(true)
  176. // dw_1.setcolumn("u_iteminput_outamt")
  177. // return 0
  178. else
  179. if key = keyenter! or key = keydownarrow! then //
  180. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  181. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  182. return 0
  183. elseif key = keyuparrow! then
  184. keybd_event ( 16, 0, 0 , 0 )
  185. keybd_event ( 9, 0, 0 , 0 )
  186. keybd_event ( 9, 0, 2, 0 )
  187. keybd_event ( 16, 0, 2, 0 )
  188. return 0
  189. end if
  190. end if
  191. end event
  192. event doubleclicked;//string ls_itemcode
  193. //long li_row
  194. //dw_1.accepttext()
  195. //li_row=dw_1.getrow()
  196. //
  197. //ls_itemcode=trim(dw_1.object.u_itemdef_itemcode[li_row])
  198. //
  199. //if not isvalid(w_itemdef) then
  200. // s_edit_index_tran s_ch_tran //传递参数使用
  201. // s_ch_tran.if_retrieve_all=local_retrieve_all //是否一次retrieve所有行
  202. // s_ch_tran.work_mode=1 //0-单纯编辑模式 1-选择\编辑模式
  203. // s_ch_tran.arg_pkid=0 //目标定位pkid (备用)
  204. // s_ch_tran.arg_string_code=ls_itemcode //查询列(物料编码)部分内容,用于初步筛选
  205. //
  206. // openwithparm(w_itemdef,s_ch_tran) //调用
  207. //
  208. // s_itemdef s_inscust
  209. // s_inscust=message.powerobjectparm //接受返回结构
  210. //
  211. // if s_inscust.itemid > 0 then //正常返回值则可以取以下值
  212. // dw_1.setredraw(false)
  213. // dw_1.object.u_iteminput_itemid[li_row]=s_inscust.itemid
  214. // dw_1.object.u_itemdef_itemcode[li_row]=s_inscust.itemcode
  215. // dw_1.object.u_itemdef_itemname[li_row]=s_inscust.itemname
  216. // dw_1.object.u_itemdef_itemtype[li_row]=s_inscust.itemtype
  217. // dw_1.object.u_itemdef_itemflag[li_row]=s_inscust.itemflag
  218. // dw_1.setcolumn("u_iteminput_outamt")
  219. // dw_1.setredraw(true)
  220. // end if
  221. //end if
  222. //
  223. //
  224. end event
  225. event rbuttondown;Long ll_row,ll_column
  226. ll_row = THIS.GetRow()
  227. ll_column = THIS.GetColumn()
  228. IF ll_row <= 0 THEN RETURN
  229. IF ll_column <= 0 THEN RETURN
  230. IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
  231. s_calender_arg s_calender
  232. s_calender.PointerX = THIS.PointerX()
  233. s_calender.PointerY = THIS.PointerY()
  234. s_calender.X = THIS.X + PARENT.X
  235. s_calender.Y = THIS.Y + PARENT.Y
  236. OpenWithParm(w_calendar,s_calender)
  237. THIS.SetItem(ll_row,ll_column,id_date_selected)
  238. end if
  239. end event
  240. type cb_2 from uo_imflatbutton within w_rapmoney_mod
  241. integer x = 1152
  242. integer y = 956
  243. integer width = 329
  244. integer height = 96
  245. integer taborder = 40
  246. string text = "保存[C^+S]"
  247. end type
  248. event clicked;call super::clicked;if wf_save() = 0 then return
  249. close(parent)
  250. end event
  251. type cb_1 from uo_imflatbutton within w_rapmoney_mod
  252. integer x = 750
  253. integer y = 956
  254. integer width = 407
  255. integer height = 96
  256. integer taborder = 40
  257. string text = "保存&新增[&S]"
  258. end type
  259. event clicked;call super::clicked;if wf_save() = 0 then return
  260. long ll_row
  261. dw_1.reset()
  262. ll_row = dw_1.insertrow(0)
  263. dw_1.object.accountid[ll_row] = s_tran.c_long
  264. dw_1.setfocus()
  265. dw_1.setcolumn('billcode')
  266. end event
  267. type gb_1 from groupbox within w_rapmoney_mod
  268. integer width = 1824
  269. integer height = 1068
  270. integer taborder = 30
  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. end type