w_rp_sptware_inout.srw 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. $PBExportHeader$w_rp_sptware_inout.srw
  2. forward
  3. global type w_rp_sptware_inout from w_publ_easyq
  4. end type
  5. type dw_mtrlware from u_dw_rbtnfilter within w_rp_sptware_inout
  6. end type
  7. type dw_spt from u_dw_rbtnfilter within w_rp_sptware_inout
  8. end type
  9. end forward
  10. global type w_rp_sptware_inout from w_publ_easyq
  11. string title = "外协商库存物料进出明细"
  12. dw_mtrlware dw_mtrlware
  13. dw_spt dw_spt
  14. end type
  15. global w_rp_sptware_inout w_rp_sptware_inout
  16. type variables
  17. datetime first_date,end_date,showsale_data
  18. long cur_storageid
  19. long cur_storageid_arr[]
  20. end variables
  21. forward prototypes
  22. public subroutine wf_changdate (long arg_sptid)
  23. end prototypes
  24. public subroutine wf_changdate (long arg_sptid);DateTime last_balcdate
  25. SELECT top 1 balcdate
  26. INTO :last_balcdate
  27. FROM ow_wfjgbalc
  28. WHERE sptid = :arg_sptid OR :arg_sptid = -1
  29. Order By balcdate Desc;
  30. IF sqlca.SQLCode <> 0 THEN
  31. last_balcdate = DateTime(sys_begin_date)
  32. END IF
  33. em_1.Text = String(last_balcdate,'yyyy-mm-dd')
  34. em_2.Text = String(Today(),'yyyy-mm-dd')
  35. end subroutine
  36. on w_rp_sptware_inout.create
  37. int iCurrent
  38. call super::create
  39. this.dw_mtrlware=create dw_mtrlware
  40. this.dw_spt=create dw_spt
  41. iCurrent=UpperBound(this.Control)
  42. this.Control[iCurrent+1]=this.dw_mtrlware
  43. this.Control[iCurrent+2]=this.dw_spt
  44. end on
  45. on w_rp_sptware_inout.destroy
  46. call super::destroy
  47. destroy(this.dw_mtrlware)
  48. destroy(this.dw_spt)
  49. end on
  50. event open;this.triggerevent('ue_before_open')
  51. wf_movetocenter()
  52. dw_1.SetTransObject (sqlca)
  53. dw_mtrlware.SetTransObject (sqlca)
  54. dw_spt.SetTransObject (sqlca)
  55. dw_1.RBUTTON_FILTER_USE=true //右键查询功能开关
  56. dw_spt.retrieve(sys_user_spttype)
  57. s_hide_col s_col
  58. s_col.col_1 = 'ow_wfjgware_cost'
  59. s_col.col_2 = 'ow_wfjgware_wareamt'
  60. f_hide_col(1448,dw_mtrlware,s_col)
  61. s_col.col_1 = 'firstprice'
  62. s_col.col_2 = 'firstamt'
  63. s_col.col_3 = 'inprice'
  64. s_col.col_4 = 'inamt'
  65. s_col.col_5 = 'outprice'
  66. s_col.col_6 = 'outamt'
  67. s_col.col_7 = 'balcprice'
  68. s_col.col_8 = 'balcamt'
  69. f_hide_col(1448,dw_1,s_col)
  70. //
  71. s_hide_col s_col_mtrlsectype
  72. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  73. f_hide_col(1308,dw_mtrlware,s_col_mtrlsectype)
  74. f_hide_col(1308,dw_1,s_col_mtrlsectype)
  75. s_hide_col s_col_zxmtrlmode
  76. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  77. f_hide_col(1309,dw_mtrlware,s_col_zxmtrlmode)
  78. f_hide_col(1309,dw_1,s_col_zxmtrlmode)
  79. end event
  80. event resize;ln_bar.endx = this.width
  81. ln_bar2.endx = this.width
  82. ln_1.endx = this.width
  83. ln_2.endx = this.width
  84. r_bar.width = this.width
  85. dw_1.width=this.width - dw_1.x - 40
  86. dw_1.height=this.height - dw_1.y - 150
  87. dw_spt.height=this.height - dw_spt.y - 150
  88. dw_mtrlware.width=dw_1.width
  89. end event
  90. event ue_before_open;call super::ue_before_open;if_ue_filter=true
  91. if_ue_sort=true
  92. end event
  93. event ue_filter;OPENWITHPARM(w_filter_query,dw_mtrlware)
  94. STRING LS_EXPR
  95. LS_EXPR=Message.StringParm
  96. if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return
  97. dw_1.setfilter(LS_EXPR)
  98. dw_1.SetRedraw (false)
  99. dw_1.filter()
  100. dw_1.SetRedraw (TRUE)
  101. end event
  102. type cb_func from w_publ_easyq`cb_func within w_rp_sptware_inout
  103. end type
  104. type cb_exit from w_publ_easyq`cb_exit within w_rp_sptware_inout
  105. integer x = 859
  106. end type
  107. type cb_2 from w_publ_easyq`cb_2 within w_rp_sptware_inout
  108. integer x = 558
  109. integer taborder = 110
  110. boolean bringtotop = true
  111. end type
  112. type cb_psetup from w_publ_easyq`cb_psetup within w_rp_sptware_inout
  113. integer x = 1874
  114. integer y = 536
  115. integer taborder = 90
  116. boolean bringtotop = true
  117. end type
  118. type cb_1 from w_publ_easyq`cb_1 within w_rp_sptware_inout
  119. boolean bringtotop = true
  120. end type
  121. event cb_1::clicked;call super::clicked;Long ins_mtrlid,li_row,ins_sptid
  122. String ls_status,ls_woodcode,ls_pcode
  123. Dec ins_balcqty,ins_balcamt,ins_price
  124. first_date = DateTime(Date(em_1.Text),Time(0))
  125. end_date = DateTime(Date(em_2.Text),Time('23:59:59'))
  126. IF first_date < sys_showsaledata_mindt THEN
  127. showsale_data = sys_showsaledata_mindt
  128. ELSE
  129. showsale_data = first_date
  130. END IF
  131. IF dw_mtrlware.RowCount() > 0 THEN
  132. ins_sptid = Long(dw_mtrlware.Object.ow_wfjgware_sptid[dw_mtrlware.GetRow()])
  133. ins_mtrlid = Long(dw_mtrlware.Object.u_mtrldef_mtrlid[dw_mtrlware.GetRow()])
  134. ins_balcqty = Dec(dw_mtrlware.Object.ow_wfjgware_noallocqty[dw_mtrlware.GetRow()])
  135. ins_balcamt = Dec(dw_mtrlware.Object.ow_wfjgware_wareamt[dw_mtrlware.GetRow()])
  136. ls_status = dw_mtrlware.Object.ow_wfjgware_status[dw_mtrlware.GetRow()]
  137. ls_woodcode = dw_mtrlware.Object.ow_wfjgware_woodcode[dw_mtrlware.GetRow()]
  138. ls_pcode = dw_mtrlware.Object.ow_wfjgware_pcode[dw_mtrlware.GetRow()]
  139. dw_1.Retrieve(ins_sptid,ins_mtrlid,first_date,end_date,ls_status,ls_woodcode,ls_pcode)
  140. dw_1.Title = ' 进出明细 '
  141. dw_1.Title = RIGHTTRIM(dw_spt.Object.name[dw_spt.GetRow()]) + dw_mtrlware.Object.u_mtrldef_mtrlname[dw_mtrlware.GetRow()] + dw_1.Title
  142. IF dw_1.RowCount() > 0 THEN
  143. FOR li_row = 1 TO dw_1.RowCount()
  144. IF ins_balcqty = 0 THEN
  145. ins_price = 0
  146. ELSE
  147. ins_price = Round(ins_balcamt/ins_balcqty,4)
  148. END IF
  149. dw_1.Object.balcqty[li_row] = ins_balcqty
  150. dw_1.Object.balcamt[li_row] = ins_balcamt
  151. dw_1.Object.balcprice[li_row] = ins_price
  152. ins_balcqty = ins_balcqty + dw_1.Object.outqty[li_row] - dw_1.Object.inqty[li_row]
  153. ins_balcamt = ins_balcamt + dw_1.Object.outamt[li_row] - dw_1.Object.inamt[li_row]
  154. IF ins_balcqty = 0 THEN
  155. ins_price = 0
  156. ELSE
  157. ins_price = Round(ins_balcamt/ins_balcqty,4)
  158. END IF
  159. dw_1.Object.firstqty[li_row] = ins_balcqty
  160. dw_1.Object.firstamt[li_row] = ins_balcamt
  161. dw_1.Object.firstprice[li_row] = ins_price
  162. NEXT
  163. END IF
  164. ELSE
  165. dw_1.Reset()
  166. END IF
  167. end event
  168. type st_3 from w_publ_easyq`st_3 within w_rp_sptware_inout
  169. integer x = 0
  170. end type
  171. type st_4 from w_publ_easyq`st_4 within w_rp_sptware_inout
  172. integer x = 718
  173. integer width = 96
  174. end type
  175. type em_1 from w_publ_easyq`em_1 within w_rp_sptware_inout
  176. integer x = 206
  177. integer width = 393
  178. integer taborder = 120
  179. long backcolor = 1090519039
  180. end type
  181. type em_2 from w_publ_easyq`em_2 within w_rp_sptware_inout
  182. integer x = 818
  183. integer width = 393
  184. integer taborder = 140
  185. boolean enabled = false
  186. alignment alignment = center!
  187. boolean displayonly = true
  188. boolean spin = false
  189. end type
  190. type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_sptware_inout
  191. integer x = 2322
  192. integer y = 568
  193. integer taborder = 70
  194. end type
  195. type cbx_yl from w_publ_easyq`cbx_yl within w_rp_sptware_inout
  196. integer x = 2354
  197. integer y = 636
  198. integer width = 247
  199. integer taborder = 80
  200. string text = "预 览"
  201. end type
  202. type dw_1 from w_publ_easyq`dw_1 within w_rp_sptware_inout
  203. integer x = 1294
  204. integer y = 1156
  205. integer width = 2021
  206. integer height = 672
  207. boolean titlebar = true
  208. string title = "进出明细[黄色为出仓明细]"
  209. string dataobject = "dw_rp_sptware_inoutmx"
  210. boolean maxbox = true
  211. boolean border = false
  212. borderstyle borderstyle = stylebox!
  213. end type
  214. event dw_1::rowfocuschanged;if currentrow<=0 then return
  215. this.selectrow(0,false)
  216. this.selectrow(currentrow,true)
  217. end event
  218. event dw_1::doubleclicked;call super::doubleclicked;
  219. IF row > 0 THEN
  220. String ls_code,ls_relcode
  221. Long ll_scid
  222. Int li_thflag,li_billtype,li_inoutflag
  223. ll_scid = THIS.Object.scid[row]
  224. ls_code = THIS.Object.code[row]
  225. f_open_win(ll_scid,ls_code)
  226. END IF
  227. end event
  228. type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_sptware_inout
  229. end type
  230. type sle_cust from w_publ_easyq`sle_cust within w_rp_sptware_inout
  231. end type
  232. type st_mtrl from w_publ_easyq`st_mtrl within w_rp_sptware_inout
  233. end type
  234. type st_cust from w_publ_easyq`st_cust within w_rp_sptware_inout
  235. end type
  236. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_sptware_inout
  237. end type
  238. type pb_em1 from w_publ_easyq`pb_em1 within w_rp_sptware_inout
  239. integer x = 603
  240. integer y = 188
  241. end type
  242. type pb_em2 from w_publ_easyq`pb_em2 within w_rp_sptware_inout
  243. integer x = 1221
  244. integer y = 188
  245. end type
  246. type pb_2 from w_publ_easyq`pb_2 within w_rp_sptware_inout
  247. integer x = 1335
  248. integer y = 188
  249. end type
  250. type cb_help from w_publ_easyq`cb_help within w_rp_sptware_inout
  251. integer x = 709
  252. end type
  253. type cb_copyself from w_publ_easyq`cb_copyself within w_rp_sptware_inout
  254. end type
  255. type gb_1 from w_publ_easyq`gb_1 within w_rp_sptware_inout
  256. end type
  257. type ln_bar from w_publ_easyq`ln_bar within w_rp_sptware_inout
  258. end type
  259. type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_sptware_inout
  260. end type
  261. type r_bar from w_publ_easyq`r_bar within w_rp_sptware_inout
  262. end type
  263. type ln_1 from w_publ_easyq`ln_1 within w_rp_sptware_inout
  264. end type
  265. type ln_2 from w_publ_easyq`ln_2 within w_rp_sptware_inout
  266. end type
  267. type ln_3 from w_publ_easyq`ln_3 within w_rp_sptware_inout
  268. end type
  269. type ln_4 from w_publ_easyq`ln_4 within w_rp_sptware_inout
  270. end type
  271. type dw_mtrlware from u_dw_rbtnfilter within w_rp_sptware_inout
  272. integer x = 1294
  273. integer y = 304
  274. integer width = 2021
  275. integer height = 852
  276. integer taborder = 20
  277. boolean bringtotop = true
  278. boolean titlebar = true
  279. string title = "物料摘要信息"
  280. string dataobject = "dw_rp_sptware_intout_ware"
  281. boolean maxbox = true
  282. boolean hscrollbar = true
  283. boolean vscrollbar = true
  284. boolean resizable = true
  285. borderstyle borderstyle = stylebox!
  286. end type
  287. event rowfocuschanged;if currentrow<=0 then return
  288. this.selectrow(0,false)
  289. this.selectrow(currentrow,true)
  290. cb_1.triggerevent(clicked!)
  291. end event
  292. event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序功能开关
  293. RBUTTON_FILTER_USE=true //右键查询功能开关
  294. end event
  295. type dw_spt from u_dw_rbtnfilter within w_rp_sptware_inout
  296. integer y = 304
  297. integer width = 1294
  298. integer height = 1520
  299. integer taborder = 20
  300. boolean bringtotop = true
  301. boolean titlebar = true
  302. string title = "外协商信息"
  303. string dataobject = "dw_rp_sptware_inout_spt"
  304. boolean controlmenu = true
  305. borderstyle borderstyle = stylebox!
  306. end type
  307. event rowfocuschanged;call super::rowfocuschanged;if currentrow<=0 then return
  308. this.selectrow(0,false)
  309. this.selectrow(currentrow,true)
  310. long ll_sptid
  311. ll_sptid = dw_spt.object.sptid[currentrow]
  312. wf_changdate ( ll_sptid)
  313. dw_mtrlware.retrieve(ll_sptid)
  314. end event