w_rp_ware_warebalc_his.srw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. $PBExportHeader$w_rp_ware_warebalc_his.srw
  2. forward
  3. global type w_rp_ware_warebalc_his from w_publ_easyq
  4. end type
  5. type tv_1 from uo_tv_mtrltype within w_rp_ware_warebalc_his
  6. end type
  7. type ddlb_1 from dropdownlistbox within w_rp_ware_warebalc_his
  8. end type
  9. type st_1 from statictext within w_rp_ware_warebalc_his
  10. end type
  11. type ddlb_storageid from uo_ddlb_storageid within w_rp_ware_warebalc_his
  12. end type
  13. type rb_1 from radiobutton within w_rp_ware_warebalc_his
  14. end type
  15. type ddlb_balcdateint from dropdownlistbox within w_rp_ware_warebalc_his
  16. end type
  17. type cb_balc from uo_imflatbutton within w_rp_ware_warebalc_his
  18. end type
  19. type rb_2 from radiobutton within w_rp_ware_warebalc_his
  20. end type
  21. type ddlb_frist_date from dropdownlistbox within w_rp_ware_warebalc_his
  22. end type
  23. type st_2 from statictext within w_rp_ware_warebalc_his
  24. end type
  25. type ddlb_end_date from dropdownlistbox within w_rp_ware_warebalc_his
  26. end type
  27. end forward
  28. global type w_rp_ware_warebalc_his from w_publ_easyq
  29. string title = "仓库历史结存"
  30. tv_1 tv_1
  31. ddlb_1 ddlb_1
  32. st_1 st_1
  33. ddlb_storageid ddlb_storageid
  34. rb_1 rb_1
  35. ddlb_balcdateint ddlb_balcdateint
  36. cb_balc cb_balc
  37. rb_2 rb_2
  38. ddlb_frist_date ddlb_frist_date
  39. st_2 st_2
  40. ddlb_end_date ddlb_end_date
  41. end type
  42. global w_rp_ware_warebalc_his w_rp_ware_warebalc_his
  43. type variables
  44. long cur_storageid = -1
  45. long cur_storageid_arr[]
  46. long cur_balcdateint = 0
  47. Int cur_mtrlorigin = -1
  48. String ls_handtype = ''
  49. string ls_mtrltype = ''
  50. DateTime st_date,ed_date,ed_date1
  51. end variables
  52. forward prototypes
  53. public subroutine wf_hidecol ()
  54. public subroutine wf_facechange ()
  55. public function integer wf_waredate (long arg_storageid)
  56. end prototypes
  57. public subroutine wf_hidecol ();s_hide_col s_col_mtrlsectype
  58. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  59. f_hide_col(1308,dw_1,s_col_mtrlsectype)
  60. s_hide_col s_col_zxmtrlmode
  61. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  62. f_hide_col(1309,dw_1,s_col_zxmtrlmode)
  63. end subroutine
  64. public subroutine wf_facechange ();dw_1.SetRedraw(False)
  65. dw_1.uf_save_profile_layout()
  66. IF rb_1.Checked THEN
  67. rb_2.Checked = False
  68. ddlb_1.Enabled = true
  69. IF ddlb_1.Text = '客户产品统计表' THEN
  70. dw_1.DataObject = 'dw_rp_ware_warebalc_his_2'
  71. ELSEIF ddlb_1.Text = '汇总统计表' THEN
  72. dw_1.DataObject = 'dw_rp_ware_warebalc_his_sum'
  73. ELSEIF ddlb_1.Text = '产品明细统计表' THEN
  74. dw_1.DataObject = 'dw_rp_ware_warebalc_his_sum_1'
  75. ELSEIF ddlb_1.Text = '分类统计表' THEN
  76. dw_1.DataObject = 'dw_rp_ware_warebalc_his_3'
  77. ELSEIF ddlb_1.Text = '汇总统计表[含设定售价]' THEN
  78. dw_1.DataObject = 'dw_rp_ware_warebalc_his_sum_saleprice'
  79. ELSEIF ddlb_1.Text = '汇总统计表[分开仓库]' THEN
  80. dw_1.DataObject = 'dw_rp_ware_warebalc_his_sum_2'
  81. END IF
  82. END IF
  83. IF rb_2.Checked THEN
  84. rb_1.Checked = False
  85. ddlb_1.Enabled = False
  86. dw_1.DataObject = 'dw_rp_ware_warebalc_his_1'
  87. END IF
  88. wf_replacedw()
  89. dw_1.SetRedraw(True)
  90. cb_balc.Enabled = rb_1.Checked
  91. ddlb_balcdateint.Enabled = rb_1.Checked
  92. ddlb_frist_date.Enabled = rb_2.Checked
  93. ddlb_end_date.Enabled = rb_2.Checked
  94. end subroutine
  95. public function integer wf_waredate (long arg_storageid);DateTime warebalc_date, warebalc_date_first
  96. Long balcdateint, balcdateint_first
  97. Long ll_cnt
  98. ddlb_frist_date.Reset()
  99. ddlb_end_date.Reset()
  100. ddlb_balcdateint.Reset()
  101. DECLARE waredate_cur CURSOR FOR
  102. SELECT distinct u_warebalc.balcdate,u_warebalc.balcdateint
  103. FROM u_warebalc
  104. WHERE ( storageid = :arg_storageid OR :arg_storageid = -1 )
  105. AND balcdateint > 0
  106. Order By u_warebalc.balcdateint Desc;
  107. OPEN waredate_cur;
  108. FETCH waredate_cur Into :warebalc_date,:balcdateint;
  109. DO WHILE sqlca.SQLCode = 0 //循环读取明细数据
  110. ddlb_frist_date.AddItem (String(warebalc_date,'yyyy-mm-dd'))
  111. ddlb_end_date.AddItem (String(warebalc_date,'yyyy-mm-dd'))
  112. ddlb_balcdateint.AddItem (String(balcdateint))
  113. ll_cnt ++
  114. IF ll_cnt = 1 THEN
  115. warebalc_date_first = warebalc_date
  116. balcdateint_first = balcdateint
  117. END IF
  118. FETCH waredate_cur Into :warebalc_date,:balcdateint;
  119. LOOP
  120. CLOSE waredate_cur;
  121. ddlb_frist_date.Text = String(warebalc_date_first,'yyyy-mm-dd')
  122. ddlb_end_date.Text = String(warebalc_date_first,'yyyy-mm-dd')
  123. ddlb_balcdateint.Text = String(balcdateint_first)
  124. RETURN 1
  125. end function
  126. on w_rp_ware_warebalc_his.create
  127. int iCurrent
  128. call super::create
  129. this.tv_1=create tv_1
  130. this.ddlb_1=create ddlb_1
  131. this.st_1=create st_1
  132. this.ddlb_storageid=create ddlb_storageid
  133. this.rb_1=create rb_1
  134. this.ddlb_balcdateint=create ddlb_balcdateint
  135. this.cb_balc=create cb_balc
  136. this.rb_2=create rb_2
  137. this.ddlb_frist_date=create ddlb_frist_date
  138. this.st_2=create st_2
  139. this.ddlb_end_date=create ddlb_end_date
  140. iCurrent=UpperBound(this.Control)
  141. this.Control[iCurrent+1]=this.tv_1
  142. this.Control[iCurrent+2]=this.ddlb_1
  143. this.Control[iCurrent+3]=this.st_1
  144. this.Control[iCurrent+4]=this.ddlb_storageid
  145. this.Control[iCurrent+5]=this.rb_1
  146. this.Control[iCurrent+6]=this.ddlb_balcdateint
  147. this.Control[iCurrent+7]=this.cb_balc
  148. this.Control[iCurrent+8]=this.rb_2
  149. this.Control[iCurrent+9]=this.ddlb_frist_date
  150. this.Control[iCurrent+10]=this.st_2
  151. this.Control[iCurrent+11]=this.ddlb_end_date
  152. end on
  153. on w_rp_ware_warebalc_his.destroy
  154. call super::destroy
  155. destroy(this.tv_1)
  156. destroy(this.ddlb_1)
  157. destroy(this.st_1)
  158. destroy(this.ddlb_storageid)
  159. destroy(this.rb_1)
  160. destroy(this.ddlb_balcdateint)
  161. destroy(this.cb_balc)
  162. destroy(this.rb_2)
  163. destroy(this.ddlb_frist_date)
  164. destroy(this.st_2)
  165. destroy(this.ddlb_end_date)
  166. end on
  167. event ue_before_openretrieve;call super::ue_before_openretrieve;wf_facechange()
  168. end event
  169. event resize;call super::resize;tv_1.height=this.height - dw_1.y - 120
  170. end event
  171. type cb_func from w_publ_easyq`cb_func within w_rp_ware_warebalc_his
  172. end type
  173. type cb_exit from w_publ_easyq`cb_exit within w_rp_ware_warebalc_his
  174. end type
  175. type cb_2 from w_publ_easyq`cb_2 within w_rp_ware_warebalc_his
  176. boolean bringtotop = true
  177. end type
  178. type cb_psetup from w_publ_easyq`cb_psetup within w_rp_ware_warebalc_his
  179. boolean bringtotop = true
  180. end type
  181. type cb_1 from w_publ_easyq`cb_1 within w_rp_ware_warebalc_his
  182. boolean bringtotop = true
  183. end type
  184. event cb_1::clicked;call super::clicked;
  185. Date ls_enddate
  186. //cur_balcdateint = Long(ddlb_balcdateint.Text)
  187. IF rb_2.Checked THEN
  188. ls_enddate = Date(ddlb_end_date.Text)
  189. st_date = DateTime(Date(ddlb_frist_date.Text),Time('0:0'))
  190. ed_date = DateTime(RelativeDate(ls_enddate,1),Time('0:0'))
  191. ed_date1 = DateTime(ls_enddate,Time('0:0'))
  192. DELETE u_parm_balcdate ;
  193. IF sqlca.SQLCode <> 0 THEN
  194. ROLLBACK ;
  195. MessageBox('提示',"因网络或其它原因导致操作失败,请重试!",information!,OK!)
  196. RETURN
  197. END IF
  198. INSERT INTO u_parm_balcdate (first_date,end_date) Values (:st_date,:ed_date) ;
  199. IF sqlca.SQLCode <> 0 THEN
  200. ROLLBACK ;
  201. MessageBox('错误',"因网络或其它原因导致操作失败,请重试!",stopsign!,OK!)
  202. RETURN
  203. ELSE
  204. COMMIT ;
  205. END IF
  206. END IF
  207. //PARENT.TriggerEvent('retrieve_pageretr')
  208. //
  209. //IF retrieve_all THEN
  210. // PARENT.TriggerEvent("ue_usual_query_filt")
  211. //END IF
  212. //
  213. //
  214. //
  215. IF ddlb_balcdateint.Text = '[本期]' THEN
  216. cur_balcdateint = 0
  217. ELSE
  218. cur_balcdateint = Long(ddlb_balcdateint.Text)
  219. END IF
  220. IF rb_1.Checked THEN
  221. IF cur_balcdateint = 0 THEN
  222. dw_1.Reset()
  223. ELSE
  224. dw_1.Retrieve(cur_storageid_arr,cur_balcdateint,ls_handtype,publ_operator,ls_mtrltype)
  225. END IF
  226. ELSEIF rb_2.Checked THEN
  227. dw_1.Retrieve(cur_storageid_arr,ls_handtype,publ_operator,st_date,ed_date1)
  228. END IF
  229. //dw_1.retrieve(first_date,end_date,cur_flag)
  230. end event
  231. type st_3 from w_publ_easyq`st_3 within w_rp_ware_warebalc_his
  232. boolean visible = false
  233. integer x = 448
  234. end type
  235. type st_4 from w_publ_easyq`st_4 within w_rp_ware_warebalc_his
  236. boolean visible = false
  237. integer x = 1152
  238. end type
  239. type em_1 from w_publ_easyq`em_1 within w_rp_ware_warebalc_his
  240. boolean visible = false
  241. integer x = 649
  242. end type
  243. type em_2 from w_publ_easyq`em_2 within w_rp_ware_warebalc_his
  244. boolean visible = false
  245. integer x = 1257
  246. end type
  247. type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_ware_warebalc_his
  248. integer x = 1559
  249. integer y = 0
  250. end type
  251. type cbx_yl from w_publ_easyq`cbx_yl within w_rp_ware_warebalc_his
  252. integer x = 1349
  253. integer y = 4
  254. end type
  255. type dw_1 from w_publ_easyq`dw_1 within w_rp_ware_warebalc_his
  256. integer x = 763
  257. integer y = 420
  258. integer height = 1124
  259. string dataobject = "dw_rp_ware_warebalc_his_sum"
  260. end type
  261. type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_ware_warebalc_his
  262. end type
  263. type sle_cust from w_publ_easyq`sle_cust within w_rp_ware_warebalc_his
  264. end type
  265. type st_mtrl from w_publ_easyq`st_mtrl within w_rp_ware_warebalc_his
  266. end type
  267. type st_cust from w_publ_easyq`st_cust within w_rp_ware_warebalc_his
  268. end type
  269. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_ware_warebalc_his
  270. boolean visible = true
  271. integer x = 1349
  272. integer y = 100
  273. end type
  274. type pb_em1 from w_publ_easyq`pb_em1 within w_rp_ware_warebalc_his
  275. boolean visible = false
  276. integer x = 1056
  277. end type
  278. type pb_em2 from w_publ_easyq`pb_em2 within w_rp_ware_warebalc_his
  279. boolean visible = false
  280. integer x = 1669
  281. end type
  282. type pb_2 from w_publ_easyq`pb_2 within w_rp_ware_warebalc_his
  283. boolean visible = false
  284. integer x = 1778
  285. end type
  286. type cb_help from w_publ_easyq`cb_help within w_rp_ware_warebalc_his
  287. end type
  288. type cb_copyself from w_publ_easyq`cb_copyself within w_rp_ware_warebalc_his
  289. end type
  290. type gb_1 from w_publ_easyq`gb_1 within w_rp_ware_warebalc_his
  291. end type
  292. type ln_bar from w_publ_easyq`ln_bar within w_rp_ware_warebalc_his
  293. end type
  294. type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_ware_warebalc_his
  295. end type
  296. type r_bar from w_publ_easyq`r_bar within w_rp_ware_warebalc_his
  297. end type
  298. type ln_1 from w_publ_easyq`ln_1 within w_rp_ware_warebalc_his
  299. integer beginy = 412
  300. integer endy = 412
  301. end type
  302. type ln_2 from w_publ_easyq`ln_2 within w_rp_ware_warebalc_his
  303. integer beginy = 416
  304. integer endy = 416
  305. end type
  306. type ln_3 from w_publ_easyq`ln_3 within w_rp_ware_warebalc_his
  307. boolean visible = false
  308. end type
  309. type ln_4 from w_publ_easyq`ln_4 within w_rp_ware_warebalc_his
  310. boolean visible = false
  311. end type
  312. type tv_1 from uo_tv_mtrltype within w_rp_ware_warebalc_his
  313. integer y = 420
  314. integer width = 763
  315. integer height = 1312
  316. integer taborder = 200
  317. boolean bringtotop = true
  318. integer textsize = -9
  319. fontcharset fontcharset = gb2312charset!
  320. fontfamily fontfamily = anyfont!
  321. string facename = "宋体"
  322. end type
  323. event selectionchanged;call super::selectionchanged;ls_handtype = THIS.uo_cur_info.handtype
  324. ls_mtrltype = THIS.uo_cur_info.mtrltype
  325. ls_handtype = ls_handtype + '%'
  326. cb_1.triggerevent(clicked!)
  327. end event
  328. type ddlb_1 from dropdownlistbox within w_rp_ware_warebalc_his
  329. integer x = 1938
  330. integer y = 40
  331. integer width = 626
  332. integer height = 904
  333. integer taborder = 110
  334. boolean bringtotop = true
  335. integer textsize = -9
  336. integer weight = 400
  337. fontcharset fontcharset = gb2312charset!
  338. fontpitch fontpitch = variable!
  339. string facename = "宋体"
  340. long textcolor = 33554432
  341. string text = "汇总统计表"
  342. boolean sorted = false
  343. string item[] = {"汇总统计表","产品明细统计表","客户产品统计表","分类统计表","汇总统计表[含设定售价]","汇总统计表[分开仓库]"}
  344. borderstyle borderstyle = stylelowered!
  345. end type
  346. event selectionchanged;wf_facechange()
  347. cb_1.TriggerEvent(Clicked!)
  348. end event
  349. type st_1 from statictext within w_rp_ware_warebalc_his
  350. integer x = 55
  351. integer y = 204
  352. integer width = 165
  353. integer height = 52
  354. boolean bringtotop = true
  355. integer textsize = -9
  356. integer weight = 400
  357. fontcharset fontcharset = gb2312charset!
  358. fontpitch fontpitch = variable!
  359. string facename = "宋体"
  360. long textcolor = 33554432
  361. long backcolor = 134217739
  362. string text = "仓库:"
  363. alignment alignment = right!
  364. boolean focusrectangle = false
  365. end type
  366. type ddlb_storageid from uo_ddlb_storageid within w_rp_ware_warebalc_his
  367. integer x = 219
  368. integer y = 192
  369. integer width = 974
  370. integer height = 1276
  371. integer taborder = 140
  372. boolean bringtotop = true
  373. end type
  374. event constructor;call super::constructor;cur_storageid = this.uo_storageid
  375. cur_storageid_arr = this.uo_storageid_arr
  376. wf_waredate(cur_storageid)
  377. end event
  378. event selectionchanged;call super::selectionchanged;cur_storageid = this.uo_storageid
  379. cur_storageid_arr = this.uo_storageid_arr
  380. wf_waredate(cur_storageid)
  381. cb_1.triggerevent(clicked!)
  382. end event
  383. type rb_1 from radiobutton within w_rp_ware_warebalc_his
  384. integer x = 1243
  385. integer y = 204
  386. integer width = 210
  387. integer height = 60
  388. boolean bringtotop = true
  389. integer textsize = -9
  390. integer weight = 400
  391. fontcharset fontcharset = gb2312charset!
  392. fontpitch fontpitch = variable!
  393. string facename = "宋体"
  394. long textcolor = 33554432
  395. long backcolor = 134217739
  396. string text = "按次"
  397. boolean checked = true
  398. end type
  399. event clicked;wf_facechange()
  400. end event
  401. type ddlb_balcdateint from dropdownlistbox within w_rp_ware_warebalc_his
  402. integer x = 1477
  403. integer y = 192
  404. integer width = 480
  405. integer height = 1532
  406. integer taborder = 150
  407. boolean bringtotop = true
  408. integer textsize = -9
  409. integer weight = 400
  410. fontcharset fontcharset = gb2312charset!
  411. fontpitch fontpitch = variable!
  412. string facename = "宋体"
  413. long textcolor = 33554432
  414. boolean sorted = false
  415. boolean hscrollbar = true
  416. borderstyle borderstyle = stylelowered!
  417. end type
  418. event selectionchanged;cb_1.triggerevent(clicked!)
  419. end event
  420. type cb_balc from uo_imflatbutton within w_rp_ware_warebalc_his
  421. integer x = 1975
  422. integer y = 184
  423. integer width = 229
  424. integer height = 92
  425. integer taborder = 180
  426. boolean bringtotop = true
  427. string text = "反结存"
  428. end type
  429. event clicked;call super::clicked;IF Not f_power_ind(75) THEN
  430. MessageBox('提示','你没有使用权限!',information!,OK!)
  431. RETURN
  432. END IF
  433. IF cur_storageid = -1 THEN
  434. MessageBox("提示","请选择仓库结存",information!,OK!)
  435. RETURN
  436. END IF
  437. DateTime balcdate
  438. Long balcdateint
  439. IF ddlb_balcdateint.Text = '[本期]' THEN
  440. MessageBox("提示","不能反结存本期",information!,OK!)
  441. RETURN
  442. END IF
  443. balcdateint = Long(ddlb_balcdateint.Text)
  444. IF MessageBox ('询问',"是否确定要进行当前仓库反结存操作吗?"+'~n'+&
  445. '反结存过程中不能进行其它操作!',Question!,YesNo! ) = 2 THEN RETURN
  446. w_sys_wait.Show()
  447. String arg_msg = '',err_msg = ''
  448. uf_warebalc(0,balcdateint,cur_storageid,balcdate,arg_msg)
  449. w_sys_wait.Hide()
  450. MessageBox('提示',arg_msg,information!,OK!)
  451. wf_waredate(cur_storageid)
  452. cb_1.TriggerEvent(Clicked!)
  453. end event
  454. type rb_2 from radiobutton within w_rp_ware_warebalc_his
  455. integer x = 1243
  456. integer y = 316
  457. integer width = 635
  458. integer height = 60
  459. boolean bringtotop = true
  460. integer textsize = -9
  461. integer weight = 400
  462. fontcharset fontcharset = gb2312charset!
  463. fontpitch fontpitch = variable!
  464. string facename = "宋体"
  465. long textcolor = 33554432
  466. long backcolor = 134217739
  467. string text = "按日期 结存日期范围:"
  468. end type
  469. event clicked;wf_facechange()
  470. end event
  471. type ddlb_frist_date from dropdownlistbox within w_rp_ware_warebalc_his
  472. integer x = 1897
  473. integer y = 304
  474. integer width = 475
  475. integer height = 780
  476. integer taborder = 160
  477. boolean bringtotop = true
  478. integer textsize = -9
  479. integer weight = 400
  480. fontcharset fontcharset = gb2312charset!
  481. fontpitch fontpitch = variable!
  482. string facename = "宋体"
  483. long textcolor = 33554432
  484. boolean vscrollbar = true
  485. borderstyle borderstyle = stylelowered!
  486. end type
  487. event selectionchanged;cb_1.triggerevent(clicked!)
  488. end event
  489. type st_2 from statictext within w_rp_ware_warebalc_his
  490. integer x = 2382
  491. integer y = 320
  492. integer width = 46
  493. integer height = 56
  494. boolean bringtotop = true
  495. integer textsize = -10
  496. integer weight = 400
  497. fontcharset fontcharset = gb2312charset!
  498. fontpitch fontpitch = variable!
  499. string facename = "宋体"
  500. long textcolor = 33554432
  501. long backcolor = 134217739
  502. boolean enabled = false
  503. string text = "~~"
  504. boolean focusrectangle = false
  505. end type
  506. type ddlb_end_date from dropdownlistbox within w_rp_ware_warebalc_his
  507. integer x = 2427
  508. integer y = 304
  509. integer width = 475
  510. integer height = 780
  511. integer taborder = 170
  512. boolean bringtotop = true
  513. integer textsize = -9
  514. integer weight = 400
  515. fontcharset fontcharset = gb2312charset!
  516. fontpitch fontpitch = variable!
  517. string facename = "宋体"
  518. long textcolor = 33554432
  519. boolean vscrollbar = true
  520. borderstyle borderstyle = stylelowered!
  521. end type
  522. event selectionchanged;cb_1.triggerevent(clicked!)
  523. end event