w_mustpay_mod.srw 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. $PBExportHeader$w_mustpay_mod.srw
  2. forward
  3. global type w_mustpay_mod from w_publ_base
  4. end type
  5. type dw_1 from datawindow within w_mustpay_mod
  6. end type
  7. type cb_2 from uo_imflatbutton within w_mustpay_mod
  8. end type
  9. type cb_1 from uo_imflatbutton within w_mustpay_mod
  10. end type
  11. end forward
  12. global type w_mustpay_mod from w_publ_base
  13. integer width = 2560
  14. integer height = 1120
  15. string title = "应付帐录入"
  16. boolean minbox = false
  17. windowtype windowtype = response!
  18. dw_1 dw_1
  19. cb_2 cb_2
  20. cb_1 cb_1
  21. end type
  22. global w_mustpay_mod w_mustpay_mod
  23. type variables
  24. s_edit_index_tran s_tran
  25. uo_mustpay uo_pay
  26. long li_sptid,li_scid
  27. string ls_billcode
  28. decimal ld_payamt
  29. long ll_moneyid
  30. end variables
  31. forward prototypes
  32. public function integer wf_save ()
  33. public function integer wf_insertrow ()
  34. end prototypes
  35. public function integer wf_save ();Int rslt = 1
  36. Long li_row
  37. dw_1.AcceptText()
  38. li_row = dw_1.GetRow()
  39. IF li_row <= 0 THEN
  40. MessageBox('提示','记录错误',information!,ok!)
  41. rslt = 0
  42. GOTO ext
  43. END IF
  44. String arg_msg
  45. DateTime arg_paydate
  46. Decimal arg_oriamt
  47. Decimal arg_mstpayamt
  48. Decimal arg_payamt
  49. String arg_inrep
  50. Long arg_banktypeid
  51. String arg_billcode
  52. Long arg_sptid
  53. Long arg_scid
  54. String arg_payabout
  55. DateTime arg_viewdate
  56. Long arg_accountsid
  57. Long arg_itemid
  58. String arg_relcode
  59. arg_scid = dw_1.Object.scid[li_row]
  60. arg_sptid = dw_1.Object.sptid[li_row]
  61. arg_paydate = dw_1.Object.paydate[li_row]
  62. arg_oriamt = dw_1.Object.oriamt[li_row]
  63. arg_mstpayamt = dw_1.Object.mstpayamt[li_row]
  64. arg_payamt = dw_1.Object.payamt[li_row]
  65. arg_inrep = dw_1.Object.inrep[li_row]
  66. arg_banktypeid = dw_1.Object.banktypeid[li_row]
  67. arg_billcode = dw_1.Object.billcode[li_row]
  68. arg_payabout = dw_1.Object.dscrp[li_row]
  69. arg_viewdate = dw_1.Object.viewdate[li_row]
  70. arg_accountsid = dw_1.Object.accountsid[li_row]
  71. arg_itemid = dw_1.Object.itemid[li_row]
  72. arg_relcode = dw_1.Object.relcode[li_row]
  73. //IF arg_sptid = 0 THEN
  74. // MessageBox('提示','请选择当前供应商!',information!,ok!)
  75. // rslt = 0
  76. // GOTO ext
  77. //END IF
  78. IF uo_pay.add_payrec(arg_scid,arg_sptid,arg_paydate,arg_inrep,&
  79. arg_oriamt,arg_mstpayamt,arg_payamt,&
  80. arg_payabout,arg_billcode,arg_banktypeid,0,publ_operator,&
  81. 0,0,arg_msg,True,arg_viewdate,arg_accountsid,arg_itemid,ll_moneyid,arg_relcode) = 0 THEN
  82. MessageBox("错误",arg_msg,stopsign!,ok!)
  83. rslt = 0
  84. GOTO ext
  85. END IF
  86. f_SetProfileString(sys_empid, dw_1.DataObject, "dft_itemid", String(dw_1.Object.itemid[li_row]))
  87. f_SetProfileString(sys_empid, dw_1.DataObject, "dft_billcode", String(dw_1.Object.billcode[li_row]))
  88. f_SetProfileString(sys_empid, dw_1.DataObject, "dft_banktypeid", String(dw_1.Object.banktypeid[li_row]))
  89. ext:
  90. RETURN rslt
  91. end function
  92. public function integer wf_insertrow ();long li_newrow
  93. dw_1.setredraw(false)
  94. li_newrow = dw_1.insertrow(0)
  95. dw_1.object.sptid[li_newrow] = li_sptid
  96. dw_1.object.scid[li_newrow] = li_scid
  97. dw_1.object.moneyid[li_newrow] = ll_moneyid
  98. dw_1.object.billcode[li_newrow] = ls_billcode
  99. dw_1.object.payamt[li_newrow] = ld_payamt
  100. dw_1.object.oriamt[li_newrow] = 0 - ld_payamt
  101. dw_1.Object.itemid[li_newrow] = Long(f_profilestring(sys_empid, dw_1.DataObject, "dft_itemid", String(0)))
  102. dw_1.Object.billcode[li_newrow] = f_profilestring(sys_empid, dw_1.DataObject, "dft_billcode", String(0))
  103. dw_1.Object.banktypeid[li_newrow] = Long(f_profilestring(sys_empid, dw_1.DataObject, "dft_banktypeid", String(0)))
  104. dw_1.Object.inrep[li_newrow] = publ_operator
  105. dw_1.setfocus()
  106. dw_1.setcolumn('billcode')
  107. dw_1.setredraw(true)
  108. return 1
  109. end function
  110. on w_mustpay_mod.create
  111. int iCurrent
  112. call super::create
  113. this.dw_1=create dw_1
  114. this.cb_2=create cb_2
  115. this.cb_1=create cb_1
  116. iCurrent=UpperBound(this.Control)
  117. this.Control[iCurrent+1]=this.dw_1
  118. this.Control[iCurrent+2]=this.cb_2
  119. this.Control[iCurrent+3]=this.cb_1
  120. end on
  121. on w_mustpay_mod.destroy
  122. call super::destroy
  123. destroy(this.dw_1)
  124. destroy(this.cb_2)
  125. destroy(this.cb_1)
  126. end on
  127. event open;call super::open;dw_1.settransobject(sqlca)
  128. s_tran=message.powerobjectparm
  129. li_sptid = s_tran.b_long
  130. li_scid = s_tran.c_long
  131. ls_billcode = s_tran.b_string
  132. ld_payamt = s_tran.b_decimal
  133. ll_moneyid= s_tran.d_long
  134. datawindowchild childdw
  135. dw_1.SetTransObject (sqlca)
  136. dw_1.GetChild("accountsid",childdw)
  137. childdw.SetTransObject (sqlca)
  138. IF childdw.Retrieve(sys_user_account) = 0 THEN
  139. childdw.InsertRow(0)
  140. END IF
  141. wf_insertrow()
  142. uo_pay = create uo_mustpay
  143. end event
  144. event close;call super::close;destroy uo_pay
  145. end event
  146. type cb_func from w_publ_base`cb_func within w_mustpay_mod
  147. boolean visible = false
  148. integer x = 1129
  149. integer y = 912
  150. end type
  151. type cb_exit from w_publ_base`cb_exit within w_mustpay_mod
  152. integer x = 2185
  153. integer y = 900
  154. integer taborder = 30
  155. string text = "取消"
  156. end type
  157. type dw_1 from datawindow within w_mustpay_mod
  158. event key pbm_dwnkey
  159. event dwnkey pbm_dwnkey
  160. integer width = 2523
  161. integer height = 864
  162. integer taborder = 10
  163. boolean bringtotop = true
  164. string dataobject = "dw_mstpay_mod"
  165. boolean livescroll = true
  166. borderstyle borderstyle = stylelowered!
  167. end type
  168. event dwnkey;if key = keydownarrow! then return 1
  169. if key = keyenter! or key = keydownarrow! then //
  170. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  171. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  172. return 0
  173. elseif key = keyuparrow! then
  174. keybd_event ( 16, 0, 0 , 0 )
  175. keybd_event ( 9, 0, 0 , 0 )
  176. keybd_event ( 9, 0, 2, 0 )
  177. keybd_event ( 16, 0, 2, 0 )
  178. return 0
  179. end if
  180. end event
  181. event rbuttondown;Long ll_row,ll_column
  182. ll_row = THIS.GetRow()
  183. ll_column = THIS.GetColumn()
  184. IF ll_row <= 0 THEN RETURN
  185. IF ll_column <= 0 THEN RETURN
  186. IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
  187. s_calender_arg s_calender
  188. s_calender.PointerX = THIS.PointerX()
  189. s_calender.PointerY = THIS.PointerY()
  190. s_calender.X = THIS.X + PARENT.X
  191. s_calender.Y = THIS.Y + PARENT.Y
  192. OpenWithParm(w_calendar,s_calender)
  193. THIS.SetItem(ll_row,ll_column,id_date_selected)
  194. end if
  195. end event
  196. type cb_2 from uo_imflatbutton within w_mustpay_mod
  197. integer x = 1861
  198. integer y = 900
  199. integer width = 329
  200. integer height = 96
  201. integer taborder = 40
  202. string text = "保存[C^+S]"
  203. end type
  204. event clicked;call super::clicked;if wf_save() = 0 then return
  205. close(parent)
  206. end event
  207. type cb_1 from uo_imflatbutton within w_mustpay_mod
  208. integer x = 1458
  209. integer y = 900
  210. integer width = 407
  211. integer height = 96
  212. integer taborder = 40
  213. string text = "保存&新增[&S]"
  214. end type
  215. event clicked;call super::clicked;if wf_save() = 0 then return
  216. long li_newrow
  217. dw_1.reset()
  218. wf_insertrow()
  219. end event