w_outware_tsale_ch.srw 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. $PBExportHeader$w_outware_tsale_ch.srw
  2. forward
  3. global type w_outware_tsale_ch from w_pageretr_ch2
  4. end type
  5. type st_2 from statictext within w_outware_tsale_ch
  6. end type
  7. type em_1 from editmask within w_outware_tsale_ch
  8. end type
  9. type cb_other from uo_imflatbutton within w_outware_tsale_ch
  10. end type
  11. end forward
  12. global type w_outware_tsale_ch from w_pageretr_ch2
  13. string title = "销售退货单选择销售发货明细 [按Ctrl键反选]"
  14. st_2 st_2
  15. em_1 em_1
  16. cb_other cb_other
  17. end type
  18. global w_outware_tsale_ch w_outware_tsale_ch
  19. type variables
  20. s_outware_tsale_array INS_RT_STRU
  21. long cur_cusid,cur_storageid,cur_scid
  22. end variables
  23. event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  24. //<INS_RT_STRU> 窗体级子定义结构变量,用于返回
  25. end event
  26. on w_outware_tsale_ch.create
  27. int iCurrent
  28. call super::create
  29. this.st_2=create st_2
  30. this.em_1=create em_1
  31. this.cb_other=create cb_other
  32. iCurrent=UpperBound(this.Control)
  33. this.Control[iCurrent+1]=this.st_2
  34. this.Control[iCurrent+2]=this.em_1
  35. this.Control[iCurrent+3]=this.cb_other
  36. end on
  37. on w_outware_tsale_ch.destroy
  38. call super::destroy
  39. destroy(this.st_2)
  40. destroy(this.em_1)
  41. destroy(this.cb_other)
  42. end on
  43. event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  44. boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
  45. cb_nextpage_enabled=cb_nextpage.enabled
  46. cb_retrieveall_enabled=cb_retrieveall.enabled
  47. cb_func_enabled=cb_func.enabled
  48. cb_nextpage.enabled=false
  49. cb_retrieveall.enabled=false
  50. cb_func.enabled=false
  51. SetPointer(HourGlass!)
  52. datetime first_date
  53. first_date=datetime(date(em_1.text),time('23:59:59'))
  54. dw_pageretr.retrieve(cur_scid,cur_cusid,cur_storageid,first_date)
  55. if dw_pageretr.rowcount()>0 and dw_pageretr.getrow()=0 then dw_pageretr.setrow(1)
  56. SetPointer(Arrow!)
  57. cb_nextpage.enabled=cb_nextpage_enabled
  58. cb_retrieveall.enabled=cb_retrieveall_enabled
  59. cb_func.enabled=cb_func_enabled
  60. IF cbx_mlselect.Checked AND dw_pageretr.RowCount() > 1 THEN
  61. dw_pageretr.SelectRow(1,FALSE)
  62. END IF
  63. end event
  64. event open;This.TriggerEvent('ue_before_open')
  65. wf_movetocenter()
  66. OLD_TITLE = This.Title
  67. EM_1.Text = String(Today(),'yyyy-mm-dd')
  68. s_tran = Message.PowerObjectParm
  69. IF Not IsNull(s_tran) THEN
  70. retrieve_all = s_tran.if_retrieve_all
  71. mode = s_tran.work_mode
  72. arg_pkid = s_tran.arg_pkid
  73. arg_string_code = s_tran.arg_string_code
  74. cur_cusid = s_tran.d_long
  75. cur_storageid = s_tran.c_long
  76. cur_scid = s_tran.b_long
  77. END IF
  78. dw_pageretr.RBUTTON_FILTER_USE = True
  79. dw_pageretr.titleclick_sort_use = True
  80. dw_pageretr.SetTransObject (sqlca)
  81. pkcolumndbtname = dw_pageretr.Describe("#1.dbname")
  82. ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select")
  83. ls_newselect = ori_oldselect
  84. ds_curquery = Create DATASTORE
  85. ds_curquery.DataObject = 'd_extr_find'
  86. ds_curquery.SetTransObject (sqlca)
  87. wf_editindex_lockf()
  88. s_hide_col s_col_mtrlsectype
  89. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  90. f_hide_col(1308,dw_pageretr,s_col_mtrlsectype)
  91. s_hide_col s_col_zxmtrlmode
  92. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  93. f_hide_col(1309,dw_pageretr,s_col_zxmtrlmode)
  94. sle_usual_query.Text = Trim(arg_string_code)
  95. IF Not retrieve_all THEN
  96. This.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve
  97. ELSE
  98. IF if_sharedata THEN
  99. ds_share.ShareData(dw_pageretr)
  100. ELSE
  101. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  102. This.TriggerEvent('RETRIEVE_pageretr')
  103. END IF
  104. END IF
  105. IF retrieve_all THEN
  106. This.TriggerEvent("ue_usual_query_filt")
  107. END IF
  108. wf_face_change()
  109. s_hide_col s_col,s_col1
  110. s_col.col_1 = 'u_outwaremx_enprice'
  111. s_col.col_2 = 'u_outwaremx_rebate'
  112. s_col.col_3 = 'enamt'
  113. s_col.col_4 = 'u_outwaremx_ware_fprice'
  114. s_col.col_5 = 'u_outwaremx_fprice'
  115. s_col.col_6 = 'amt'
  116. f_hide_col(122,dw_pageretr,s_col)
  117. s_col1.col_1 = 'u_outwaremx_cost'
  118. f_hide_col(490,dw_pageretr,s_col1)
  119. end event
  120. event ue_usual_query_retr;call super::ue_usual_query_retr;String ls_querystrpart = ''
  121. ls_newselect = Lower(ori_oldselect)
  122. IF Trim(sle_usual_query.Text) <> '' THEN
  123. IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
  124. ls_querystrpart = ls_querystrpart + "(u_mtrldef.mtrlcode like '%"+Trim(sle_usual_query.Text)+"%'"
  125. ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '%"+Trim(sle_usual_query.Text)+"%')"
  126. ELSE
  127. ls_querystrpart = ls_querystrpart + "( u_mtrldef.mtrlcode like '"+Trim(sle_usual_query.Text)+"'"
  128. ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '"+Trim(sle_usual_query.Text)+"')"
  129. END IF
  130. IF Pos(ls_newselect," where ") <> 0 THEN
  131. ls_newselect = ls_newselect+" AND ("+ls_querystrpart+')'
  132. ELSE
  133. ls_newselect = ls_newselect+" where ("+ls_querystrpart+')'
  134. END IF
  135. END IF
  136. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  137. THIS.TriggerEvent('retrieve_pageretr')
  138. end event
  139. event ue_retrieve_info;call super::ue_retrieve_info;Long ll_row
  140. Long ll_mtrlid
  141. ll_row = dw_pageretr.GetRow()
  142. IF ll_row <= 0 THEN
  143. ll_mtrlid = 0
  144. ELSE
  145. ll_mtrlid = dw_pageretr.Object.u_outwaremx_mtrlid[ll_row]
  146. END IF
  147. IF IsValid(w_mtrl_info) THEN
  148. w_mtrl_info.WindowState = Normal!
  149. w_mtrl_info.ins_mtrlid = ll_mtrlid
  150. w_mtrl_info.wf_retrieve(ll_mtrlid)
  151. END IF
  152. end event
  153. type cb_func from w_pageretr_ch2`cb_func within w_outware_tsale_ch
  154. end type
  155. type cb_exit from w_pageretr_ch2`cb_exit within w_outware_tsale_ch
  156. integer x = 869
  157. end type
  158. type sle_usual_query from w_pageretr_ch2`sle_usual_query within w_outware_tsale_ch
  159. end type
  160. type cb_retrieveall from w_pageretr_ch2`cb_retrieveall within w_outware_tsale_ch
  161. integer x = 1385
  162. end type
  163. type em_pagerowno from w_pageretr_ch2`em_pagerowno within w_outware_tsale_ch
  164. integer x = 1074
  165. end type
  166. type dw_pageretr from w_pageretr_ch2`dw_pageretr within w_outware_tsale_ch
  167. string dataobject = "dw_outware_tsale_ch"
  168. end type
  169. type st_1 from w_pageretr_ch2`st_1 within w_outware_tsale_ch
  170. end type
  171. type cb_nextpage from w_pageretr_ch2`cb_nextpage within w_outware_tsale_ch
  172. integer x = 1536
  173. end type
  174. type cb_choice from w_pageretr_ch2`cb_choice within w_outware_tsale_ch
  175. integer x = 718
  176. end type
  177. event cb_choice::clicked;call super::clicked;Long ROW,ls_i = 0,chC = 0
  178. datawindow dw
  179. IF cbx_ml.Checked THEN
  180. dw = dw_pageretr
  181. // ROW = dw.GetRow()
  182. // IF ROW <= 0 THEN
  183. // MessageBox('提示','请先选择目标行!', Information!, OK! )
  184. // RETURN
  185. // END IF
  186. ELSE
  187. dw = dw_choice
  188. dw.AcceptText()
  189. ROW = dw.RowCount()
  190. IF ROW <= 0 THEN
  191. MessageBox('提示','请先选择缓冲目标!', Information!, OK! )
  192. RETURN
  193. END IF
  194. END IF
  195. FOR ls_i = 1 To dw.RowCount()
  196. IF not cbx_ml.Checked or dw.IsSelected(ls_i) THEN
  197. IF dw.Object.u_outwaremx_qty[ls_i] < 0 THEN
  198. MessageBox('提示',"该记录为退货记录不能选择",information!,OK!)
  199. dw.SelectRow(0,FALSE)
  200. dw.SelectRow(ls_i,TRUE)
  201. RETURN
  202. END IF
  203. CHC++
  204. INS_RT_STRU.mtrlwareid[chC] = dw.Object.u_outwaremx_mtrlwareid[ls_i]
  205. INS_RT_STRU.outwareid[chC] = dw.Object.u_outware_outwareid[ls_i]
  206. INS_RT_STRU.outwarecode[chC] = dw.Object.u_outware_outwarecode[ls_i]
  207. INS_RT_STRU.mtrlid[chC] = dw.Object.u_outwaremx_mtrlid[ls_i]
  208. INS_RT_STRU.storageid[chC] = dw.Object.u_outware_storageid[ls_i]
  209. INS_RT_STRU.plancode[chC] = dw.Object.u_outwaremx_plancode[ls_i]
  210. INS_RT_STRU.qty[chC] = dw.Object.u_outwaremx_qty[ls_i]
  211. INS_RT_STRU.addqty[chC] = dw.Object.u_outwaremx_addqty[ls_i]
  212. INS_RT_STRU.price[chC] = dw.Object.u_outwaremx_price[ls_i]
  213. INS_RT_STRU.cost[chC] = dw.Object.u_outwaremx_cost[ls_i]
  214. INS_RT_STRU.planprice[chC] = dw.Object.u_outwaremx_planprice[ls_i]
  215. INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i]
  216. INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i]
  217. INS_RT_STRU.mtrltype[chC] = dw.Object.u_mtrldef_mtrltype[ls_i]
  218. INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i]
  219. INS_RT_STRU.dxflag[chC] = dw.Object.u_outwaremx_dxflag[ls_i]
  220. INS_RT_STRU.sptid[chC] = dw.Object.u_outwaremx_sptid[ls_i]
  221. IF IsNull(INS_RT_STRU.qty[chC]) THEN INS_RT_STRU.qty[chC] = 0
  222. INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[ls_i]
  223. INS_RT_STRU.fprice[chC] = dw.Object.u_outwaremx_fprice[ls_i]
  224. INS_RT_STRU.enprice[chC] = dw.Object.u_outwaremx_enprice[ls_i]
  225. INS_RT_STRU.rebate[chC] = dw.Object.u_outwaremx_rebate[ls_i]
  226. INS_RT_STRU.status[chC] = dw.Object.u_outwaremx_status[ls_i]
  227. INS_RT_STRU.woodcode[chC] = dw.Object.u_outwaremx_woodcode[ls_i]
  228. INS_RT_STRU.pcode[chC] = dw.Object.u_outwaremx_pcode[ls_i]
  229. INS_RT_STRU.mtrlsectype[chC] = dw.Object.u_mtrldef_mtrlsectype[ls_i]
  230. INS_RT_STRU.zxmtrlmode[chC] = dw.Object.u_mtrldef_zxmtrlmode[ls_i]
  231. INS_RT_STRU.outwarecode[chC] = dw.Object.u_outware_outwarecode[ls_i]
  232. INS_RT_STRU.unit[chC] = dw.Object.u_outwaremx_unit[ls_i]
  233. INS_RT_STRU.rate[chC] = dw.Object.u_outwaremx_rate[ls_i]
  234. INS_RT_STRU.uqty[chC] = dw.Object.u_outwaremx_uqty[ls_i]
  235. INS_RT_STRU.ware_enprice[chC] = dw.Object.u_outwaremx_ware_enprice[ls_i]
  236. INS_RT_STRU.ware_fprice[chC] = dw.Object.u_outwaremx_ware_fprice[ls_i]
  237. INS_RT_STRU.mxdscrp[chC] = dw.Object.u_outwaremx_mxdscrp[ls_i]
  238. INS_RT_STRU.mxdscrp2[chC] = dw.Object.u_outwaremx_mxdscrp2[ls_i]
  239. INS_RT_STRU.rel_address[chC] = dw.Object.u_outware_rel_address[ls_i]
  240. INS_RT_STRU.rel_rep[chC] = dw.Object.u_outware_rel_rep[ls_i]
  241. INS_RT_STRU.rel_tele[chC] = dw.Object.u_outware_rel_tele[ls_i]
  242. INS_RT_STRU.rel_tele1[chC] = dw.Object.u_outware_rel_tele1[ls_i]
  243. INS_RT_STRU.relstr_1[chC] = dw.Object.u_outware_relstr_1[ls_i]
  244. INS_RT_STRU.relstr_2[chC] = dw.Object.u_outware_relstr_2[ls_i]
  245. INS_RT_STRU.relstr_3[chC] = dw.Object.u_outware_relstr_3[ls_i]
  246. INS_RT_STRU.transcode[chC] = dw.Object.u_outware_transcode[ls_i]
  247. INS_RT_STRU.paytype[chC] = dw.Object.u_outware_paytype[ls_i]
  248. INS_RT_STRU.dscrp[chC] = dw.Object.u_outware_dscrp[ls_i]
  249. INS_RT_STRU.dscrp2[chC] = dw.Object.u_outware_dscrp2[ls_i]
  250. INS_RT_STRU.dscrp3[chC] = dw.Object.u_outware_dscrp3[ls_i]
  251. INS_RT_STRU.outrep[chC] = dw.Object.u_outware_outrep[ls_i]
  252. INS_RT_STRU.tax[chC] = dw.Object.u_outwaremx_tax[ls_i]
  253. INS_RT_STRU.relid[chC] = dw.Object.u_outwaremx_relid[ls_i]
  254. INS_RT_STRU.relprintid[chC] = dw.Object.u_outwaremx_relprintid[ls_i]
  255. END IF
  256. NEXT
  257. IF chC = 0 THEN
  258. MessageBox('提示','请至少选择一个目标行!', Information!, OK! )
  259. RETURN
  260. END IF
  261. CLOSE(PARENT)
  262. end event
  263. type cb_refresh from w_pageretr_ch2`cb_refresh within w_outware_tsale_ch
  264. end type
  265. type cb_help from w_pageretr_ch2`cb_help within w_outware_tsale_ch
  266. end type
  267. type ln_bar from w_pageretr_ch2`ln_bar within w_outware_tsale_ch
  268. end type
  269. type ln_bar2 from w_pageretr_ch2`ln_bar2 within w_outware_tsale_ch
  270. end type
  271. type r_bar from w_pageretr_ch2`r_bar within w_outware_tsale_ch
  272. integer x = 1518
  273. end type
  274. type ln_1 from w_pageretr_ch2`ln_1 within w_outware_tsale_ch
  275. end type
  276. type ln_2 from w_pageretr_ch2`ln_2 within w_outware_tsale_ch
  277. end type
  278. type cbx_ml from w_pageretr_ch2`cbx_ml within w_outware_tsale_ch
  279. end type
  280. type cb_ok from w_pageretr_ch2`cb_ok within w_outware_tsale_ch
  281. end type
  282. event cb_ok::clicked;call super::clicked;Long ROW,ls_i,chC = 0
  283. ROW = dw_pageretr.GetRow()
  284. IF ROW <= 0 THEN
  285. MessageBox('提示','请先选择目标行!', Information!, OK! )
  286. RETURN
  287. END IF
  288. FOR ls_i = 1 To dw_pageretr.RowCount()
  289. IF dw_pageretr.IsSelected(ls_i) THEN
  290. IF dw_choice.Find('u_outware_outwareid ='+String(dw_pageretr.Object.u_outware_outwareid[ls_i]) &
  291. + ' and u_outwaremx_printid = '+ String(dw_pageretr.Object.u_outwaremx_printid[ls_i]),1,dw_choice.RowCount()) = 0 THEN
  292. chC++
  293. dw_pageretr.RowsCopy(ls_i, ls_i, Primary!, dw_choice, dw_choice.RowCount() + 1, Primary!)
  294. END IF
  295. END IF
  296. NEXT
  297. end event
  298. type cb_del from w_pageretr_ch2`cb_del within w_outware_tsale_ch
  299. end type
  300. type cbx_mlselect from w_pageretr_ch2`cbx_mlselect within w_outware_tsale_ch
  301. end type
  302. type dw_choice from w_pageretr_ch2`dw_choice within w_outware_tsale_ch
  303. string dataobject = "dw_outware_tsale_ch"
  304. end type
  305. type cbx_allselect from w_pageretr_ch2`cbx_allselect within w_outware_tsale_ch
  306. end type
  307. type st_2 from statictext within w_outware_tsale_ch
  308. integer x = 1847
  309. integer y = 204
  310. integer width = 457
  311. integer height = 48
  312. boolean bringtotop = true
  313. integer textsize = -9
  314. integer weight = 400
  315. fontcharset fontcharset = gb2312charset!
  316. fontpitch fontpitch = variable!
  317. string facename = "宋体"
  318. long textcolor = 33554432
  319. long backcolor = 134217739
  320. string text = " 出仓日期在以前:"
  321. boolean focusrectangle = false
  322. end type
  323. type em_1 from editmask within w_outware_tsale_ch
  324. integer x = 2295
  325. integer y = 180
  326. integer width = 402
  327. integer height = 92
  328. integer taborder = 130
  329. boolean bringtotop = true
  330. integer textsize = -9
  331. integer weight = 400
  332. fontcharset fontcharset = gb2312charset!
  333. fontpitch fontpitch = variable!
  334. string facename = "宋体"
  335. long textcolor = 33554432
  336. string text = "none"
  337. alignment alignment = center!
  338. borderstyle borderstyle = stylelowered!
  339. maskdatatype maskdatatype = datemask!
  340. string mask = "yyyy-mm-dd"
  341. boolean spin = true
  342. end type
  343. type cb_other from uo_imflatbutton within w_outware_tsale_ch
  344. integer x = 453
  345. integer width = 265
  346. integer height = 164
  347. integer taborder = 40
  348. boolean bringtotop = true
  349. string text = "相关信息"
  350. string normalpicname = "find2.BMP"
  351. integer picsize = 16
  352. toolbaralignment pic_align = alignattop!
  353. boolean border = false
  354. end type
  355. event clicked;call super::clicked;Long ll_row
  356. ll_row = dw_pageretr.GetRow()
  357. IF ll_row <= 0 THEN
  358. MessageBox('系统提示','请选择物料')
  359. RETURN
  360. END IF
  361. Long ll_mtrlid
  362. ll_mtrlid = dw_pageretr.Object.u_outwaremx_mtrlid[ll_row]
  363. IF IsValid(w_mtrl_info) THEN
  364. w_mtrl_info.WindowState = Normal!
  365. w_mtrl_info.ins_mtrlid = ll_mtrlid
  366. w_mtrl_info.wf_retrieve(ll_mtrlid)
  367. ELSE
  368. OpenWithParm(w_mtrl_info,ll_mtrlid)
  369. END IF
  370. end event