123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404 |
- $PBExportHeader$w_rp_sptware_inout.srw
- forward
- global type w_rp_sptware_inout from w_publ_easyq
- end type
- type dw_mtrlware from u_dw_rbtnfilter within w_rp_sptware_inout
- end type
- type dw_spt from u_dw_rbtnfilter within w_rp_sptware_inout
- end type
- end forward
- global type w_rp_sptware_inout from w_publ_easyq
- string title = "外协商库存物料进出明细"
- dw_mtrlware dw_mtrlware
- dw_spt dw_spt
- end type
- global w_rp_sptware_inout w_rp_sptware_inout
- type variables
- datetime first_date,end_date,showsale_data
- long cur_storageid
- long cur_storageid_arr[]
- end variables
- forward prototypes
- public subroutine wf_changdate (long arg_sptid)
- end prototypes
- public subroutine wf_changdate (long arg_sptid);DateTime last_balcdate
- SELECT top 1 balcdate
- INTO :last_balcdate
- FROM ow_wfjgbalc
- WHERE sptid = :arg_sptid OR :arg_sptid = -1
- Order By balcdate Desc;
- IF sqlca.SQLCode <> 0 THEN
- last_balcdate = DateTime(sys_begin_date)
- END IF
- em_1.Text = String(last_balcdate,'yyyy-mm-dd')
- em_2.Text = String(Today(),'yyyy-mm-dd')
- end subroutine
- on w_rp_sptware_inout.create
- int iCurrent
- call super::create
- this.dw_mtrlware=create dw_mtrlware
- this.dw_spt=create dw_spt
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_mtrlware
- this.Control[iCurrent+2]=this.dw_spt
- end on
- on w_rp_sptware_inout.destroy
- call super::destroy
- destroy(this.dw_mtrlware)
- destroy(this.dw_spt)
- end on
- event open;this.triggerevent('ue_before_open')
- wf_movetocenter()
- dw_1.SetTransObject (sqlca)
- dw_mtrlware.SetTransObject (sqlca)
- dw_spt.SetTransObject (sqlca)
- dw_1.RBUTTON_FILTER_USE=true //右键查询功能开关
- dw_spt.retrieve(sys_user_spttype)
- s_hide_col s_col
- s_col.col_1 = 'ow_wfjgware_cost'
- s_col.col_2 = 'ow_wfjgware_wareamt'
- f_hide_col(1448,dw_mtrlware,s_col)
- s_col.col_1 = 'firstprice'
- s_col.col_2 = 'firstamt'
- s_col.col_3 = 'inprice'
- s_col.col_4 = 'inamt'
- s_col.col_5 = 'outprice'
- s_col.col_6 = 'outamt'
- s_col.col_7 = 'balcprice'
- s_col.col_8 = 'balcamt'
- f_hide_col(1448,dw_1,s_col)
-
- //
- s_hide_col s_col_mtrlsectype
- s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
- f_hide_col(1308,dw_mtrlware,s_col_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_mtrlware,s_col_zxmtrlmode)
- f_hide_col(1309,dw_1,s_col_zxmtrlmode)
- end event
- event resize;ln_bar.endx = this.width
- ln_bar2.endx = this.width
- ln_1.endx = this.width
- ln_2.endx = this.width
- r_bar.width = this.width
- dw_1.width=this.width - dw_1.x - 40
- dw_1.height=this.height - dw_1.y - 150
- dw_spt.height=this.height - dw_spt.y - 150
- dw_mtrlware.width=dw_1.width
- end event
- event ue_before_open;call super::ue_before_open;if_ue_filter=true
- if_ue_sort=true
- end event
- event ue_filter;OPENWITHPARM(w_filter_query,dw_mtrlware)
- STRING LS_EXPR
- LS_EXPR=Message.StringParm
- if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return
- dw_1.setfilter(LS_EXPR)
- dw_1.SetRedraw (false)
- dw_1.filter()
- dw_1.SetRedraw (TRUE)
- end event
- type cb_func from w_publ_easyq`cb_func within w_rp_sptware_inout
- end type
- type cb_exit from w_publ_easyq`cb_exit within w_rp_sptware_inout
- integer x = 859
- end type
- type cb_2 from w_publ_easyq`cb_2 within w_rp_sptware_inout
- integer x = 558
- integer taborder = 110
- boolean bringtotop = true
- end type
- type cb_psetup from w_publ_easyq`cb_psetup within w_rp_sptware_inout
- integer x = 1874
- integer y = 536
- integer taborder = 90
- boolean bringtotop = true
- end type
- type cb_1 from w_publ_easyq`cb_1 within w_rp_sptware_inout
- boolean bringtotop = true
- end type
- event cb_1::clicked;call super::clicked;Long ins_mtrlid,li_row,ins_sptid
- String ls_status,ls_woodcode,ls_pcode
- Dec ins_balcqty,ins_balcamt,ins_price
- first_date = DateTime(Date(em_1.Text),Time(0))
- end_date = DateTime(Date(em_2.Text),Time('23:59:59'))
- IF first_date < sys_showsaledata_mindt THEN
- showsale_data = sys_showsaledata_mindt
- ELSE
- showsale_data = first_date
- END IF
- IF dw_mtrlware.RowCount() > 0 THEN
-
- ins_sptid = Long(dw_mtrlware.Object.ow_wfjgware_sptid[dw_mtrlware.GetRow()])
- ins_mtrlid = Long(dw_mtrlware.Object.u_mtrldef_mtrlid[dw_mtrlware.GetRow()])
- ins_balcqty = Dec(dw_mtrlware.Object.ow_wfjgware_noallocqty[dw_mtrlware.GetRow()])
- ins_balcamt = Dec(dw_mtrlware.Object.ow_wfjgware_wareamt[dw_mtrlware.GetRow()])
-
- ls_status = dw_mtrlware.Object.ow_wfjgware_status[dw_mtrlware.GetRow()]
- ls_woodcode = dw_mtrlware.Object.ow_wfjgware_woodcode[dw_mtrlware.GetRow()]
- ls_pcode = dw_mtrlware.Object.ow_wfjgware_pcode[dw_mtrlware.GetRow()]
-
- dw_1.Retrieve(ins_sptid,ins_mtrlid,first_date,end_date,ls_status,ls_woodcode,ls_pcode)
- dw_1.Title = ' 进出明细 '
- dw_1.Title = RIGHTTRIM(dw_spt.Object.name[dw_spt.GetRow()]) + dw_mtrlware.Object.u_mtrldef_mtrlname[dw_mtrlware.GetRow()] + dw_1.Title
- IF dw_1.RowCount() > 0 THEN
- FOR li_row = 1 TO dw_1.RowCount()
-
- IF ins_balcqty = 0 THEN
- ins_price = 0
- ELSE
- ins_price = Round(ins_balcamt/ins_balcqty,4)
- END IF
- dw_1.Object.balcqty[li_row] = ins_balcqty
- dw_1.Object.balcamt[li_row] = ins_balcamt
- dw_1.Object.balcprice[li_row] = ins_price
-
- ins_balcqty = ins_balcqty + dw_1.Object.outqty[li_row] - dw_1.Object.inqty[li_row]
- ins_balcamt = ins_balcamt + dw_1.Object.outamt[li_row] - dw_1.Object.inamt[li_row]
-
-
- IF ins_balcqty = 0 THEN
- ins_price = 0
- ELSE
- ins_price = Round(ins_balcamt/ins_balcqty,4)
- END IF
-
- dw_1.Object.firstqty[li_row] = ins_balcqty
- dw_1.Object.firstamt[li_row] = ins_balcamt
- dw_1.Object.firstprice[li_row] = ins_price
-
- NEXT
- END IF
- ELSE
- dw_1.Reset()
- END IF
- end event
- type st_3 from w_publ_easyq`st_3 within w_rp_sptware_inout
- integer x = 0
- end type
- type st_4 from w_publ_easyq`st_4 within w_rp_sptware_inout
- integer x = 718
- integer width = 96
- end type
- type em_1 from w_publ_easyq`em_1 within w_rp_sptware_inout
- integer x = 206
- integer width = 393
- integer taborder = 120
- long backcolor = 1090519039
- end type
- type em_2 from w_publ_easyq`em_2 within w_rp_sptware_inout
- integer x = 818
- integer width = 393
- integer taborder = 140
- boolean enabled = false
- alignment alignment = center!
- boolean displayonly = true
- boolean spin = false
- end type
- type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_sptware_inout
- integer x = 2322
- integer y = 568
- integer taborder = 70
- end type
- type cbx_yl from w_publ_easyq`cbx_yl within w_rp_sptware_inout
- integer x = 2354
- integer y = 636
- integer width = 247
- integer taborder = 80
- string text = "预 览"
- end type
- type dw_1 from w_publ_easyq`dw_1 within w_rp_sptware_inout
- integer x = 1294
- integer y = 1156
- integer width = 2021
- integer height = 672
- boolean titlebar = true
- string title = "进出明细[黄色为出仓明细]"
- string dataobject = "dw_rp_sptware_inoutmx"
- boolean maxbox = true
- boolean border = false
- borderstyle borderstyle = stylebox!
- end type
- event dw_1::rowfocuschanged;if currentrow<=0 then return
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- end event
- event dw_1::doubleclicked;call super::doubleclicked;
- IF row > 0 THEN
- String ls_code,ls_relcode
- Long ll_scid
- Int li_thflag,li_billtype,li_inoutflag
-
- ll_scid = THIS.Object.scid[row]
- ls_code = THIS.Object.code[row]
-
- f_open_win(ll_scid,ls_code)
-
- END IF
- end event
- type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_sptware_inout
- end type
- type sle_cust from w_publ_easyq`sle_cust within w_rp_sptware_inout
- end type
- type st_mtrl from w_publ_easyq`st_mtrl within w_rp_sptware_inout
- end type
- type st_cust from w_publ_easyq`st_cust within w_rp_sptware_inout
- end type
- type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_sptware_inout
- end type
- type pb_em1 from w_publ_easyq`pb_em1 within w_rp_sptware_inout
- integer x = 603
- integer y = 188
- end type
- type pb_em2 from w_publ_easyq`pb_em2 within w_rp_sptware_inout
- integer x = 1221
- integer y = 188
- end type
- type pb_2 from w_publ_easyq`pb_2 within w_rp_sptware_inout
- integer x = 1335
- integer y = 188
- end type
- type cb_help from w_publ_easyq`cb_help within w_rp_sptware_inout
- integer x = 709
- end type
- type cb_copyself from w_publ_easyq`cb_copyself within w_rp_sptware_inout
- end type
- type gb_1 from w_publ_easyq`gb_1 within w_rp_sptware_inout
- end type
- type ln_bar from w_publ_easyq`ln_bar within w_rp_sptware_inout
- end type
- type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_sptware_inout
- end type
- type r_bar from w_publ_easyq`r_bar within w_rp_sptware_inout
- end type
- type ln_1 from w_publ_easyq`ln_1 within w_rp_sptware_inout
- end type
- type ln_2 from w_publ_easyq`ln_2 within w_rp_sptware_inout
- end type
- type ln_3 from w_publ_easyq`ln_3 within w_rp_sptware_inout
- end type
- type ln_4 from w_publ_easyq`ln_4 within w_rp_sptware_inout
- end type
- type dw_mtrlware from u_dw_rbtnfilter within w_rp_sptware_inout
- integer x = 1294
- integer y = 304
- integer width = 2021
- integer height = 852
- integer taborder = 20
- boolean bringtotop = true
- boolean titlebar = true
- string title = "物料摘要信息"
- string dataobject = "dw_rp_sptware_intout_ware"
- boolean maxbox = true
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean resizable = true
- borderstyle borderstyle = stylebox!
- end type
- event rowfocuschanged;if currentrow<=0 then return
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- cb_1.triggerevent(clicked!)
- end event
- event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序功能开关
- RBUTTON_FILTER_USE=true //右键查询功能开关
- end event
- type dw_spt from u_dw_rbtnfilter within w_rp_sptware_inout
- integer y = 304
- integer width = 1294
- integer height = 1520
- integer taborder = 20
- boolean bringtotop = true
- boolean titlebar = true
- string title = "外协商信息"
- string dataobject = "dw_rp_sptware_inout_spt"
- boolean controlmenu = true
- borderstyle borderstyle = stylebox!
- end type
- event rowfocuschanged;call super::rowfocuschanged;if currentrow<=0 then return
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- long ll_sptid
- ll_sptid = dw_spt.object.sptid[currentrow]
- wf_changdate ( ll_sptid)
- dw_mtrlware.retrieve(ll_sptid)
- end event
|