$PBExportHeader$w_rp_ware_warebalc_his.srw forward global type w_rp_ware_warebalc_his from w_publ_easyq end type type tv_1 from uo_tv_mtrltype within w_rp_ware_warebalc_his end type type ddlb_1 from dropdownlistbox within w_rp_ware_warebalc_his end type type st_1 from statictext within w_rp_ware_warebalc_his end type type ddlb_storageid from uo_ddlb_storageid within w_rp_ware_warebalc_his end type type rb_1 from radiobutton within w_rp_ware_warebalc_his end type type ddlb_balcdateint from dropdownlistbox within w_rp_ware_warebalc_his end type type cb_balc from uo_imflatbutton within w_rp_ware_warebalc_his end type type rb_2 from radiobutton within w_rp_ware_warebalc_his end type type ddlb_frist_date from dropdownlistbox within w_rp_ware_warebalc_his end type type st_2 from statictext within w_rp_ware_warebalc_his end type type ddlb_end_date from dropdownlistbox within w_rp_ware_warebalc_his end type end forward global type w_rp_ware_warebalc_his from w_publ_easyq string title = "仓库历史结存" tv_1 tv_1 ddlb_1 ddlb_1 st_1 st_1 ddlb_storageid ddlb_storageid rb_1 rb_1 ddlb_balcdateint ddlb_balcdateint cb_balc cb_balc rb_2 rb_2 ddlb_frist_date ddlb_frist_date st_2 st_2 ddlb_end_date ddlb_end_date end type global w_rp_ware_warebalc_his w_rp_ware_warebalc_his type variables long cur_storageid = -1 long cur_storageid_arr[] long cur_balcdateint = 0 Int cur_mtrlorigin = -1 String ls_handtype = '' string ls_mtrltype = '' DateTime st_date,ed_date,ed_date1 end variables forward prototypes public subroutine wf_hidecol () public subroutine wf_facechange () public function integer wf_waredate (long arg_storageid) end prototypes public subroutine wf_hidecol ();s_hide_col s_col_mtrlsectype s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype' f_hide_col(1308,dw_1,s_col_mtrlsectype) s_hide_col s_col_zxmtrlmode s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode' f_hide_col(1309,dw_1,s_col_zxmtrlmode) end subroutine public subroutine wf_facechange ();dw_1.SetRedraw(False) dw_1.uf_save_profile_layout() IF rb_1.Checked THEN rb_2.Checked = False ddlb_1.Enabled = true IF ddlb_1.Text = '客户产品统计表' THEN dw_1.DataObject = 'dw_rp_ware_warebalc_his_2' ELSEIF ddlb_1.Text = '汇总统计表' THEN dw_1.DataObject = 'dw_rp_ware_warebalc_his_sum' ELSEIF ddlb_1.Text = '产品明细统计表' THEN dw_1.DataObject = 'dw_rp_ware_warebalc_his_sum_1' ELSEIF ddlb_1.Text = '分类统计表' THEN dw_1.DataObject = 'dw_rp_ware_warebalc_his_3' ELSEIF ddlb_1.Text = '汇总统计表[含设定售价]' THEN dw_1.DataObject = 'dw_rp_ware_warebalc_his_sum_saleprice' ELSEIF ddlb_1.Text = '汇总统计表[分开仓库]' THEN dw_1.DataObject = 'dw_rp_ware_warebalc_his_sum_2' END IF END IF IF rb_2.Checked THEN rb_1.Checked = False ddlb_1.Enabled = False dw_1.DataObject = 'dw_rp_ware_warebalc_his_1' END IF wf_replacedw() dw_1.SetRedraw(True) cb_balc.Enabled = rb_1.Checked ddlb_balcdateint.Enabled = rb_1.Checked ddlb_frist_date.Enabled = rb_2.Checked ddlb_end_date.Enabled = rb_2.Checked end subroutine public function integer wf_waredate (long arg_storageid);DateTime warebalc_date, warebalc_date_first Long balcdateint, balcdateint_first Long ll_cnt ddlb_frist_date.Reset() ddlb_end_date.Reset() ddlb_balcdateint.Reset() DECLARE waredate_cur CURSOR FOR SELECT distinct u_warebalc.balcdate,u_warebalc.balcdateint FROM u_warebalc WHERE ( storageid = :arg_storageid OR :arg_storageid = -1 ) AND balcdateint > 0 Order By u_warebalc.balcdateint Desc; OPEN waredate_cur; FETCH waredate_cur Into :warebalc_date,:balcdateint; DO WHILE sqlca.SQLCode = 0 //循环读取明细数据 ddlb_frist_date.AddItem (String(warebalc_date,'yyyy-mm-dd')) ddlb_end_date.AddItem (String(warebalc_date,'yyyy-mm-dd')) ddlb_balcdateint.AddItem (String(balcdateint)) ll_cnt ++ IF ll_cnt = 1 THEN warebalc_date_first = warebalc_date balcdateint_first = balcdateint END IF FETCH waredate_cur Into :warebalc_date,:balcdateint; LOOP CLOSE waredate_cur; ddlb_frist_date.Text = String(warebalc_date_first,'yyyy-mm-dd') ddlb_end_date.Text = String(warebalc_date_first,'yyyy-mm-dd') ddlb_balcdateint.Text = String(balcdateint_first) RETURN 1 end function on w_rp_ware_warebalc_his.create int iCurrent call super::create this.tv_1=create tv_1 this.ddlb_1=create ddlb_1 this.st_1=create st_1 this.ddlb_storageid=create ddlb_storageid this.rb_1=create rb_1 this.ddlb_balcdateint=create ddlb_balcdateint this.cb_balc=create cb_balc this.rb_2=create rb_2 this.ddlb_frist_date=create ddlb_frist_date this.st_2=create st_2 this.ddlb_end_date=create ddlb_end_date iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.tv_1 this.Control[iCurrent+2]=this.ddlb_1 this.Control[iCurrent+3]=this.st_1 this.Control[iCurrent+4]=this.ddlb_storageid this.Control[iCurrent+5]=this.rb_1 this.Control[iCurrent+6]=this.ddlb_balcdateint this.Control[iCurrent+7]=this.cb_balc this.Control[iCurrent+8]=this.rb_2 this.Control[iCurrent+9]=this.ddlb_frist_date this.Control[iCurrent+10]=this.st_2 this.Control[iCurrent+11]=this.ddlb_end_date end on on w_rp_ware_warebalc_his.destroy call super::destroy destroy(this.tv_1) destroy(this.ddlb_1) destroy(this.st_1) destroy(this.ddlb_storageid) destroy(this.rb_1) destroy(this.ddlb_balcdateint) destroy(this.cb_balc) destroy(this.rb_2) destroy(this.ddlb_frist_date) destroy(this.st_2) destroy(this.ddlb_end_date) end on event ue_before_openretrieve;call super::ue_before_openretrieve;wf_facechange() end event event resize;call super::resize;tv_1.height=this.height - dw_1.y - 120 end event type cb_func from w_publ_easyq`cb_func within w_rp_ware_warebalc_his end type type cb_exit from w_publ_easyq`cb_exit within w_rp_ware_warebalc_his end type type cb_2 from w_publ_easyq`cb_2 within w_rp_ware_warebalc_his boolean bringtotop = true end type type cb_psetup from w_publ_easyq`cb_psetup within w_rp_ware_warebalc_his boolean bringtotop = true end type type cb_1 from w_publ_easyq`cb_1 within w_rp_ware_warebalc_his boolean bringtotop = true end type event cb_1::clicked;call super::clicked; Date ls_enddate //cur_balcdateint = Long(ddlb_balcdateint.Text) IF rb_2.Checked THEN ls_enddate = Date(ddlb_end_date.Text) st_date = DateTime(Date(ddlb_frist_date.Text),Time('0:0')) ed_date = DateTime(RelativeDate(ls_enddate,1),Time('0:0')) ed_date1 = DateTime(ls_enddate,Time('0:0')) DELETE u_parm_balcdate ; IF sqlca.SQLCode <> 0 THEN ROLLBACK ; MessageBox('提示',"因网络或其它原因导致操作失败,请重试!",information!,OK!) RETURN END IF INSERT INTO u_parm_balcdate (first_date,end_date) Values (:st_date,:ed_date) ; IF sqlca.SQLCode <> 0 THEN ROLLBACK ; MessageBox('错误',"因网络或其它原因导致操作失败,请重试!",stopsign!,OK!) RETURN ELSE COMMIT ; END IF END IF //PARENT.TriggerEvent('retrieve_pageretr') // //IF retrieve_all THEN // PARENT.TriggerEvent("ue_usual_query_filt") //END IF // // // IF ddlb_balcdateint.Text = '[本期]' THEN cur_balcdateint = 0 ELSE cur_balcdateint = Long(ddlb_balcdateint.Text) END IF IF rb_1.Checked THEN IF cur_balcdateint = 0 THEN dw_1.Reset() ELSE dw_1.Retrieve(cur_storageid_arr,cur_balcdateint,ls_handtype,publ_operator,ls_mtrltype) END IF ELSEIF rb_2.Checked THEN dw_1.Retrieve(cur_storageid_arr,ls_handtype,publ_operator,st_date,ed_date1) END IF //dw_1.retrieve(first_date,end_date,cur_flag) end event type st_3 from w_publ_easyq`st_3 within w_rp_ware_warebalc_his boolean visible = false integer x = 448 end type type st_4 from w_publ_easyq`st_4 within w_rp_ware_warebalc_his boolean visible = false integer x = 1152 end type type em_1 from w_publ_easyq`em_1 within w_rp_ware_warebalc_his boolean visible = false integer x = 649 end type type em_2 from w_publ_easyq`em_2 within w_rp_ware_warebalc_his boolean visible = false integer x = 1257 end type type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_ware_warebalc_his integer x = 1559 integer y = 0 end type type cbx_yl from w_publ_easyq`cbx_yl within w_rp_ware_warebalc_his integer x = 1349 integer y = 4 end type type dw_1 from w_publ_easyq`dw_1 within w_rp_ware_warebalc_his integer x = 763 integer y = 420 integer height = 1124 string dataobject = "dw_rp_ware_warebalc_his_sum" end type type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_ware_warebalc_his end type type sle_cust from w_publ_easyq`sle_cust within w_rp_ware_warebalc_his end type type st_mtrl from w_publ_easyq`st_mtrl within w_rp_ware_warebalc_his end type type st_cust from w_publ_easyq`st_cust within w_rp_ware_warebalc_his end type type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_ware_warebalc_his boolean visible = true integer x = 1349 integer y = 100 end type type pb_em1 from w_publ_easyq`pb_em1 within w_rp_ware_warebalc_his boolean visible = false integer x = 1056 end type type pb_em2 from w_publ_easyq`pb_em2 within w_rp_ware_warebalc_his boolean visible = false integer x = 1669 end type type pb_2 from w_publ_easyq`pb_2 within w_rp_ware_warebalc_his boolean visible = false integer x = 1778 end type type cb_help from w_publ_easyq`cb_help within w_rp_ware_warebalc_his end type type cb_copyself from w_publ_easyq`cb_copyself within w_rp_ware_warebalc_his end type type gb_1 from w_publ_easyq`gb_1 within w_rp_ware_warebalc_his end type type ln_bar from w_publ_easyq`ln_bar within w_rp_ware_warebalc_his end type type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_ware_warebalc_his end type type r_bar from w_publ_easyq`r_bar within w_rp_ware_warebalc_his end type type ln_1 from w_publ_easyq`ln_1 within w_rp_ware_warebalc_his integer beginy = 412 integer endy = 412 end type type ln_2 from w_publ_easyq`ln_2 within w_rp_ware_warebalc_his integer beginy = 416 integer endy = 416 end type type ln_3 from w_publ_easyq`ln_3 within w_rp_ware_warebalc_his boolean visible = false end type type ln_4 from w_publ_easyq`ln_4 within w_rp_ware_warebalc_his boolean visible = false end type type tv_1 from uo_tv_mtrltype within w_rp_ware_warebalc_his integer y = 420 integer width = 763 integer height = 1312 integer taborder = 200 boolean bringtotop = true integer textsize = -9 fontcharset fontcharset = gb2312charset! fontfamily fontfamily = anyfont! string facename = "宋体" end type event selectionchanged;call super::selectionchanged;ls_handtype = THIS.uo_cur_info.handtype ls_mtrltype = THIS.uo_cur_info.mtrltype ls_handtype = ls_handtype + '%' cb_1.triggerevent(clicked!) end event type ddlb_1 from dropdownlistbox within w_rp_ware_warebalc_his integer x = 1938 integer y = 40 integer width = 626 integer height = 904 integer taborder = 110 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 string text = "汇总统计表" boolean sorted = false string item[] = {"汇总统计表","产品明细统计表","客户产品统计表","分类统计表","汇总统计表[含设定售价]","汇总统计表[分开仓库]"} borderstyle borderstyle = stylelowered! end type event selectionchanged;wf_facechange() cb_1.TriggerEvent(Clicked!) end event type st_1 from statictext within w_rp_ware_warebalc_his integer x = 55 integer y = 204 integer width = 165 integer height = 52 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "仓库:" alignment alignment = right! boolean focusrectangle = false end type type ddlb_storageid from uo_ddlb_storageid within w_rp_ware_warebalc_his integer x = 219 integer y = 192 integer width = 974 integer height = 1276 integer taborder = 140 boolean bringtotop = true end type event constructor;call super::constructor;cur_storageid = this.uo_storageid cur_storageid_arr = this.uo_storageid_arr wf_waredate(cur_storageid) end event event selectionchanged;call super::selectionchanged;cur_storageid = this.uo_storageid cur_storageid_arr = this.uo_storageid_arr wf_waredate(cur_storageid) cb_1.triggerevent(clicked!) end event type rb_1 from radiobutton within w_rp_ware_warebalc_his integer x = 1243 integer y = 204 integer width = 210 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "按次" boolean checked = true end type event clicked;wf_facechange() end event type ddlb_balcdateint from dropdownlistbox within w_rp_ware_warebalc_his integer x = 1477 integer y = 192 integer width = 480 integer height = 1532 integer taborder = 150 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean sorted = false boolean hscrollbar = true borderstyle borderstyle = stylelowered! end type event selectionchanged;cb_1.triggerevent(clicked!) end event type cb_balc from uo_imflatbutton within w_rp_ware_warebalc_his integer x = 1975 integer y = 184 integer width = 229 integer height = 92 integer taborder = 180 boolean bringtotop = true string text = "反结存" end type event clicked;call super::clicked;IF Not f_power_ind(75) THEN MessageBox('提示','你没有使用权限!',information!,OK!) RETURN END IF IF cur_storageid = -1 THEN MessageBox("提示","请选择仓库结存",information!,OK!) RETURN END IF DateTime balcdate Long balcdateint IF ddlb_balcdateint.Text = '[本期]' THEN MessageBox("提示","不能反结存本期",information!,OK!) RETURN END IF balcdateint = Long(ddlb_balcdateint.Text) IF MessageBox ('询问',"是否确定要进行当前仓库反结存操作吗?"+'~n'+& '反结存过程中不能进行其它操作!',Question!,YesNo! ) = 2 THEN RETURN w_sys_wait.Show() String arg_msg = '',err_msg = '' uf_warebalc(0,balcdateint,cur_storageid,balcdate,arg_msg) w_sys_wait.Hide() MessageBox('提示',arg_msg,information!,OK!) wf_waredate(cur_storageid) cb_1.TriggerEvent(Clicked!) end event type rb_2 from radiobutton within w_rp_ware_warebalc_his integer x = 1243 integer y = 316 integer width = 635 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "按日期 结存日期范围:" end type event clicked;wf_facechange() end event type ddlb_frist_date from dropdownlistbox within w_rp_ware_warebalc_his integer x = 1897 integer y = 304 integer width = 475 integer height = 780 integer taborder = 160 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean vscrollbar = true borderstyle borderstyle = stylelowered! end type event selectionchanged;cb_1.triggerevent(clicked!) end event type st_2 from statictext within w_rp_ware_warebalc_his integer x = 2382 integer y = 320 integer width = 46 integer height = 56 boolean bringtotop = true integer textsize = -10 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 boolean enabled = false string text = "~~" boolean focusrectangle = false end type type ddlb_end_date from dropdownlistbox within w_rp_ware_warebalc_his integer x = 2427 integer y = 304 integer width = 475 integer height = 780 integer taborder = 170 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean vscrollbar = true borderstyle borderstyle = stylelowered! end type event selectionchanged;cb_1.triggerevent(clicked!) end event