123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672 |
- $PBExportHeader$w_rp_ware_inoutmx.srw
- forward
- global type w_rp_ware_inoutmx from w_publ_easyq
- end type
- type ddlb_1 from dropdownlistbox within w_rp_ware_inoutmx
- end type
- type rb_1 from radiobutton within w_rp_ware_inoutmx
- end type
- type rb_2 from radiobutton within w_rp_ware_inoutmx
- end type
- type st_2 from statictext within w_rp_ware_inoutmx
- end type
- type cbx_1 from checkbox within w_rp_ware_inoutmx
- end type
- type dw_2 from u_dw_rbtnfilter within w_rp_ware_inoutmx
- end type
- end forward
- global type w_rp_ware_inoutmx from w_publ_easyq
- string title = "物料进出明细统计表"
- ddlb_1 ddlb_1
- rb_1 rb_1
- rb_2 rb_2
- st_2 st_2
- cbx_1 cbx_1
- dw_2 dw_2
- end type
- global w_rp_ware_inoutmx w_rp_ware_inoutmx
- type variables
- datetime first_date,end_date,showsale_data
- long cur_storageid
- boolean lb_r1=true
- boolean lb_r2=false
- end variables
- forward prototypes
- public subroutine wf_cmpbalc ()
- public subroutine wf_rtrdw2 ()
- end prototypes
- public subroutine wf_cmpbalc ();Long ll_rowcount,i
- Dec ld_sumbalc
- IF dw_1.RowCount() > 0 THEN
- dwobject dwod
- dwod = dw_1.Object.mxreport
- ll_rowcount = dwod.Object.dwrowcount[1]
-
-
- Long ll_mtrlid
- ll_mtrlid = dw_2.Object.mtrlid[dw_2.GetRow()]
- SELECT sum(noallocqty) INTO :ld_sumbalc FROM u_mtrlware
- WHERE storageid = :cur_storageid
- AND mtrlid = :ll_mtrlid Group By mtrlid;
- IF sqlca.SQLCode <> 0 OR IsNull(ld_sumbalc) THEN
- ld_sumbalc = 0
- END IF
-
- IF ll_rowcount = 1 THEN
- dwod.Object.balc[1] = ld_sumbalc
- RETURN
- END IF
- dwod.Object.balc[ll_rowcount] = ld_sumbalc
- FOR i = ll_rowcount - 1 TO 1 STEP - 1
- ld_sumbalc = (ld_sumbalc - dwod.Object.inqty[i+1]) + dwod.Object.outqty[i+1]
- dwod.Object.balc[i] = ld_sumbalc
- dwod.Object.bgqty[i] = dwod.Object.balc[i] - dwod.Object.inqty[i] + dwod.Object.outqty[i]
- NEXT
- END IF
- end subroutine
- public subroutine wf_rtrdw2 ();dw_2.retrieve(cur_storageid)
- end subroutine
- on w_rp_ware_inoutmx.create
- int iCurrent
- call super::create
- this.ddlb_1=create ddlb_1
- this.rb_1=create rb_1
- this.rb_2=create rb_2
- this.st_2=create st_2
- this.cbx_1=create cbx_1
- this.dw_2=create dw_2
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.ddlb_1
- this.Control[iCurrent+2]=this.rb_1
- this.Control[iCurrent+3]=this.rb_2
- this.Control[iCurrent+4]=this.st_2
- this.Control[iCurrent+5]=this.cbx_1
- this.Control[iCurrent+6]=this.dw_2
- end on
- on w_rp_ware_inoutmx.destroy
- call super::destroy
- destroy(this.ddlb_1)
- destroy(this.rb_1)
- destroy(this.rb_2)
- destroy(this.st_2)
- destroy(this.cbx_1)
- destroy(this.dw_2)
- end on
- event activate;call super::activate;//int i=1
- end event
- event resize;call super::resize;dw_1.width=this.width - dw_1.x - 40
- dw_1.height=this.height - dw_1.y - 115
- dw_2.Height=dw_1.height - 80
- end event
- event ue_before_open;call super::ue_before_open;dw_2.settransobject(sqlca)
- IF TRIM(DW_1.DATAOBJECT)<>'' THEN
- DW_1.OBJECT.DataWindow.PRINT.MARGIN.TOP=INTEGER(f_ProfileString (sys_empid,DW_1.DATAOBJECT, "MARGIN_TOP", "110"))
- DW_1.OBJECT.DataWindow.PRINT.MARGIN.LEFT=INTEGER(f_ProfileString (sys_empid,DW_1.DATAOBJECT, "MARGIN_LEFT", "96" ))
- DW_1.OBJECT.DataWindow.PRINT.MARGIN.bottom=INTEGER(f_ProfileString (sys_empid,DW_1.DATAOBJECT, "MARGIN_BOTTOM", "110"))
- DW_1.OBJECT.DataWindow.PRINT.MARGIN.right=INTEGER(f_ProfileString (sys_empid,DW_1.DATAOBJECT, "MARGIN_RIGHT", "96" ))
-
- dw_1.object.DataWindow.Print.Preview = 'yes'
- dw_1.Object.DataWindow.Print.Duplex = 2
- dw_1.Object.DataWindow.Print.Preview.Rulers = "yes"
- end if
- end event
- event ue_sentdataout;IF NOT if_power_sendout THEN
- MessageBox(publ_operator,'你没有使用权限!')
- RETURN
- END IF
- Long i
- IF rb_1.Checked THEN
- Boolean printflag = FALSE
- FOR i = 1 TO dw_2.RowCount()
- IF dw_2.Object.selectflag[i] = 1 THEN
- dw_2.ScrollToRow(i)
- OpenWithParm(w_sentdataout,DW_1)
- END IF
- NEXT
- ELSE
- OpenWithParm(w_sentdataout,DW_1)
- END IF
- end event
- event ue_before_openretrieve;call super::ue_before_openretrieve;wf_rtrdw2()
- ddlb_1.triggerevent(selectionchanged!)
- end event
- type cb_func from w_publ_easyq`cb_func within w_rp_ware_inoutmx
- end type
- type cb_exit from w_publ_easyq`cb_exit within w_rp_ware_inoutmx
- end type
- type cb_2 from w_publ_easyq`cb_2 within w_rp_ware_inoutmx
- integer x = 558
- boolean bringtotop = true
- end type
- event cb_2::clicked;//
- //IF NOT f_power_ind(127) THEN
- // MessageBox('提示','你没有使用权限!',information!,OK!)
- // RETURN
- //END IF
- //
- //IF NOT f_power_ind(1253) THEN
- // MessageBox('提示','你没有使用权限!',information!,OK!)
- // RETURN
- //END IF
- dw_1.Object.datawindow.Print.page.range = ''
- dw_1.Object.datawindow.Print.copies = 1
- Long i
- IF rb_1.Checked THEN
- Boolean printflag = FALSE
- FOR i = 1 TO dw_2.RowCount()
- IF dw_2.Object.selectflag[i] = 1 THEN
- dw_2.ScrollToRow(i)
- printflag = TRUE
- dw_1.Print()
- END IF
- NEXT
-
- IF printflag = FALSE THEN
- MessageBox('提示','没有可打印的产品,请选择产品!',information!,OK!)
- RETURN
- END IF
- ELSE
- CALL SUPER::Clicked
- END IF
- end event
- type cb_psetup from w_publ_easyq`cb_psetup within w_rp_ware_inoutmx
- integer x = 859
- boolean bringtotop = true
- end type
- type cb_1 from w_publ_easyq`cb_1 within w_rp_ware_inoutmx
- boolean bringtotop = true
- end type
- event cb_1::clicked;Long ll_mtrlid
- 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
- Long a,b,c,d,e
- IF rb_1.Checked THEN
- IF dw_2.RowCount() > 0 THEN ll_mtrlid = dw_2.Object.mtrlid[dw_2.GetRow()]
- dw_1.Retrieve(cur_storageid,first_date,end_date,ll_mtrlid,showsale_data)
-
- //====================================================================
- // Script - w_rp_mtrl_inoutmx::cb_1 for clicked
- // Reason:
- //--------------------------------------------------------------------
- // Modified By: yyx Date: 2004.01.10
- //--------------------------------------------------------------------
- IF dw_2.RowCount() > 0 THEN
- ll_mtrlid = dw_2.Object.mtrlid[dw_2.GetRow()]
-
- Long in_cnt,out_cnt
- SELECT count(*) INTO :out_cnt FROM u_outware,u_outwaremx
- WHERE u_outware.flag = 1
- AND u_outware.scid = u_outwaremx.scid
- AND u_outware.outwareid = u_outwaremx.outwareid
- AND u_outware.storageid = :cur_storageid
- AND u_outwaremx.mtrlid = :ll_mtrlid
- AND (( u_outware.billtype = 1 AND u_outware.outdate > = :showsale_data AND u_outware.outdate <= :end_date) OR
- ( u_outware.billtype <> 1 And u_outware.outdate > = :first_date And u_outware.outdate <= :end_date ));
- IF sqlca.SQLCode <> 0 THEN out_cnt = 0
-
- SELECT count(*) INTO :in_cnt FROM u_inware,u_inwaremx
- WHERE u_inware.flag = 1
- AND u_inware.scid = u_inwaremx.scid
- AND u_inware.inwareid = u_inwaremx.inwareid
- AND u_inware.storageid = :cur_storageid
- AND u_inwaremx.mtrlid = :ll_mtrlid
- AND u_inware.indate > = :first_date
- And u_inware.indate <= :end_date;
-
- IF sqlca.SQLCode <> 0 THEN in_cnt = 0
-
- IF in_cnt + out_cnt > 0 THEN
- wf_cmpbalc()
- END IF
- ELSE
- dw_1.Reset()
- END IF
- ELSE
- dw_1.Retrieve(cur_storageid,first_date,end_date,showsale_data)
-
-
- dw_1.SetRedraw(False)
- dw_1.SetSort("mtrltype A, mtrlcode A, auditingdate D")
- dw_1.Sort()
- IF dw_1.RowCount() > 0 THEN //2
- Long ins_mtrlid,piro_mtrlid,li_row
- Dec ins_balcqty = 0
- IF dw_1.RowCount() > 1 THEN //产品行数多于1 //3
- ins_mtrlid = Long(dw_1.Object.mtrlid[1])
- SELECT sum(noallocqty) INTO :ins_balcqty FROM u_mtrlware
- WHERE storageid = :cur_storageid
- And mtrlid = :ins_mtrlid Group By mtrlid;
-
- IF sqlca.SQLCode = -1 Or IsNull(ins_balcqty) THEN
- MessageBox('错误',sqlca.SQLErrText,stopsign!,OK!)
- ins_balcqty = 0
- END IF
- dw_1.Object.balc[1] = ins_balcqty
- ins_balcqty = ins_balcqty + dw_1.Object.outqty[1] - dw_1.Object.inqty[1]
-
- FOR li_row = 2 To dw_1.RowCount()
- ins_mtrlid = Long(dw_1.Object.mtrlid[li_row])
- piro_mtrlid = Long(dw_1.Object.mtrlid[li_row - 1])
-
- IF ins_mtrlid <> piro_mtrlid THEN
- SELECT sum(noallocqty) INTO :ins_balcqty FROM u_mtrlware
- WHERE storageid = :cur_storageid
- And mtrlid = :ins_mtrlid Group By mtrlid;
-
- IF sqlca.SQLCode = -1 Or IsNull(ins_balcqty) THEN
- ins_balcqty = 0
- END IF
- dw_1.Object.balc[li_row] = ins_balcqty
- ins_balcqty = ins_balcqty + dw_1.Object.outqty[li_row] - dw_1.Object.inqty[li_row]
- ELSE
- a = dw_1.Object.outqty[li_row]
- b = dw_1.Object.inqty[li_row]
-
- dw_1.Object.balc[li_row] = ins_balcqty
- ins_balcqty = ins_balcqty + dw_1.Object.outqty[li_row] - dw_1.Object.inqty[li_row]
-
- END IF
- NEXT
- ELSE
- ins_mtrlid = Long(dw_1.Object.mtrlid[dw_1.RowCount()])
- SELECT sum(noallocqty) INTO :ins_balcqty FROM u_mtrlware
- WHERE storageid = :cur_storageid
- And mtrlid = :ins_mtrlid Group By mtrlid;
-
- IF sqlca.SQLCode = -1 Or IsNull(ins_balcqty) THEN
- ins_balcqty = 0
- END IF
- ins_balcqty = 0
- END IF //3
-
- dw_1.SetSort("mtrltype A, mtrlcode A, auditingdate A")
- dw_1.Sort()
- dw_1.SetRedraw(True)
- ELSE
- dw_1.Reset()
- END IF //2
- END IF
- //IF rb_2.Checked THEN //1
- //ELSE
- //
- // //====================================================================
- //END IF //1
- //
- end event
- type st_3 from w_publ_easyq`st_3 within w_rp_ware_inoutmx
- integer x = 1413
- end type
- type st_4 from w_publ_easyq`st_4 within w_rp_ware_inoutmx
- integer x = 2149
- end type
- type em_1 from w_publ_easyq`em_1 within w_rp_ware_inoutmx
- integer x = 1641
- integer taborder = 140
- end type
- type em_2 from w_publ_easyq`em_2 within w_rp_ware_inoutmx
- integer x = 2249
- integer taborder = 150
- end type
- type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_ware_inoutmx
- integer x = 1605
- integer y = 8
- integer taborder = 80
- end type
- type cbx_yl from w_publ_easyq`cbx_yl within w_rp_ware_inoutmx
- integer x = 1390
- integer y = 12
- integer taborder = 90
- boolean enabled = false
- end type
- type dw_1 from w_publ_easyq`dw_1 within w_rp_ware_inoutmx
- integer x = 672
- integer y = 308
- integer width = 2523
- integer height = 1124
- string dataobject = "dw_rp_ware_inoutmx_1"
- borderstyle borderstyle = stylebox!
- boolean autosave_sort_use = false
- boolean autosave_setlayout_use = false
- end type
- type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_ware_inoutmx
- end type
- type sle_cust from w_publ_easyq`sle_cust within w_rp_ware_inoutmx
- end type
- type st_mtrl from w_publ_easyq`st_mtrl within w_rp_ware_inoutmx
- end type
- type st_cust from w_publ_easyq`st_cust within w_rp_ware_inoutmx
- end type
- type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_ware_inoutmx
- integer x = 1390
- end type
- type pb_em1 from w_publ_easyq`pb_em1 within w_rp_ware_inoutmx
- integer x = 2053
- end type
- type pb_em2 from w_publ_easyq`pb_em2 within w_rp_ware_inoutmx
- integer x = 2661
- end type
- type pb_2 from w_publ_easyq`pb_2 within w_rp_ware_inoutmx
- integer x = 2770
- end type
- type cb_help from w_publ_easyq`cb_help within w_rp_ware_inoutmx
- integer x = 709
- end type
- type cb_copyself from w_publ_easyq`cb_copyself within w_rp_ware_inoutmx
- end type
- type gb_1 from w_publ_easyq`gb_1 within w_rp_ware_inoutmx
- end type
- type ln_bar from w_publ_easyq`ln_bar within w_rp_ware_inoutmx
- integer beginx = -9
- integer endx = 1998
- end type
- type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_ware_inoutmx
- end type
- type r_bar from w_publ_easyq`r_bar within w_rp_ware_inoutmx
- end type
- type ln_1 from w_publ_easyq`ln_1 within w_rp_ware_inoutmx
- end type
- type ln_2 from w_publ_easyq`ln_2 within w_rp_ware_inoutmx
- end type
- type ln_3 from w_publ_easyq`ln_3 within w_rp_ware_inoutmx
- boolean visible = false
- end type
- type ln_4 from w_publ_easyq`ln_4 within w_rp_ware_inoutmx
- boolean visible = false
- end type
- type ddlb_1 from dropdownlistbox within w_rp_ware_inoutmx
- integer x = 713
- integer y = 196
- integer width = 667
- integer height = 452
- integer taborder = 20
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean sorted = false
- boolean vscrollbar = true
- borderstyle borderstyle = stylelowered!
- end type
- event selectionchanged;cur_storageid=long(Mid ( ddlb_1.text,pos(ddlb_1.text,'[') + 1,len(ddlb_1.text) - pos(ddlb_1.text,'[') - 1 ))
- wf_rtrdw2()
- if dw_2.rowcount()>0 then dw_2.ScrollToRow(1)
- cb_1.triggerevent(clicked!)
- end event
- event constructor;long ins_storageid,ls_storageid
- string ins_storagename,ls_storagestr
- ///yyx0822
- ls_storagestr=sys_user_storagestr
- if ls_storagestr='0' then
- DECLARE storage_cur CURSOR FOR
- SELECT u_storage.storageid,
- u_storage.storagename
- FROM u_storage;
-
- open storage_cur;
- fetch storage_cur into :ins_storageid,:ins_storagename;
-
- do while sqlca.sqlcode=0 //循环读取明细数据
- ddlb_1.AddItem (ins_storagename+'['+string(ins_storageid)+']')
- fetch storage_cur into :ins_storageid,:ins_storagename;
- loop
- close storage_cur;
- // ddlb_1.AddItem ('[全部]')
- else
- DO WHILE len(ls_storagestr)<>1
- ls_storagestr=Replace( ls_storagestr, 1, 1, '' )
- ls_storageid=long(left(ls_storagestr,pos(ls_storagestr,',',1) - 1))
- /////
- SELECT u_storage.storageid,
- u_storage.storagename
- INTO :ins_storageid,:ins_storagename
- FROM u_storage where u_storage.storageid= :ls_storageid;
- ddlb_1.AddItem (ins_storagename+'['+string(ins_storageid)+']')
- ///////////////////////////////
- ls_storagestr=Replace ( ls_storagestr, 1, pos(ls_storagestr,',',1) - 1, '' )
- LOOP
- end if
- ////////
- ddlb_1.text=ins_storagename+'['+string(ins_storageid)+']'
- cur_storageid=ins_storageid
- end event
- type rb_1 from radiobutton within w_rp_ware_inoutmx
- integer x = 18
- integer y = 208
- integer width = 315
- integer height = 76
- 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;em_2.enabled=true
- cbx_yl.checked=false
- cbx_yl.enabled=false
- dw_1.dataobject='dw_rp_ware_inoutmx_1'
- dw_1.SetTransObject (sqlca)
- dw_1.object.DataWindow.Print.Preview = 'yes'
- dw_1.Object.DataWindow.Print.Duplex = 2
- dw_1.Object.DataWindow.Print.Preview.Rulers = "yes"
- wf_rtrdw2()
- cb_1.triggerevent(clicked!)
- if lb_r1=false then
- dw_1.x=681
- dw_1.Width=dw_1.Width - dw_2.Width
- dw_2.visible=true
- st_2.visible=true
- cbx_1.visible=true
- lb_r2=false
- lb_r1=true
- end if
- end event
- type rb_2 from radiobutton within w_rp_ware_inoutmx
- integer x = 389
- integer y = 208
- integer width = 261
- integer height = 76
- 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;EM_1.TEXT=STRING(TODAY(),'YYYY-MM-DD')
- EM_2.TEXT=STRING(TODAY(),'YYYY-MM-DD')
- em_2.enabled=false
- cbx_yl.enabled=true
- dw_1.dataobject='dw_mtrl_inoutmx_2'
- dw_1.SetTransObject (sqlca)
- if lb_r2=false then
- dw_1.x=dw_2.x
- dw_1.Width=dw_1.Width+dw_2.Width
- dw_2.visible=false
- st_2.visible=false
- cbx_1.visible=false
- lb_r1=false
- lb_r2=true
- end if
- cb_1.triggerevent(clicked!)
- end event
- type st_2 from statictext within w_rp_ware_inoutmx
- integer x = 5
- integer y = 308
- integer width = 663
- integer height = 80
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- boolean enabled = false
- alignment alignment = right!
- boolean border = true
- boolean focusrectangle = false
- end type
- type cbx_1 from checkbox within w_rp_ware_inoutmx
- integer x = 41
- integer y = 316
- integer width = 251
- integer height = 68
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "全选"
- end type
- event clicked;long i
- int k=0
- if this.checked then k=1
- for i= 1 to dw_2.rowcount()
- dw_2.object.selectflag[i]=k
- next
- end event
- type dw_2 from u_dw_rbtnfilter within w_rp_ware_inoutmx
- integer x = 5
- integer y = 380
- integer width = 663
- integer height = 1048
- integer taborder = 30
- string dataobject = "dw_rp_ware_inoutmx_2"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean resizable = true
- borderstyle borderstyle = stylebox!
- end type
- event rowfocuschanged;if currentrow<=0 then return
- //DW_2.SETROW(currentrow)
- //DW_2.ScrollToRow (currentrow)
- this.SelectRow(0,false)
- this.SelectRow(currentrow,true)
- cb_1.triggerevent(clicked!)
- end event
- event clicked;call super::clicked;//if row<=0 then return
- //DW_2.SETROW(row)
- //DW_2.ScrollToRow (row)
- //this.SelectRow(0,false)
- //this.SelectRow(row,true)
- end event
- event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序功能开关
- RBUTTON_FILTER_USE=true //右键查询功能开关
- end event
|