123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464 |
- $PBExportHeader$w_outware_tsale_ch.srw
- forward
- global type w_outware_tsale_ch from w_pageretr_ch2
- end type
- type st_2 from statictext within w_outware_tsale_ch
- end type
- type em_1 from editmask within w_outware_tsale_ch
- end type
- type cb_other from uo_imflatbutton within w_outware_tsale_ch
- end type
- end forward
- global type w_outware_tsale_ch from w_pageretr_ch2
- string title = "销售退货单选择销售发货明细 [按Ctrl键反选]"
- st_2 st_2
- em_1 em_1
- cb_other cb_other
- end type
- global w_outware_tsale_ch w_outware_tsale_ch
- type variables
- s_outware_tsale_array INS_RT_STRU
- long cur_cusid,cur_storageid,cur_scid
- end variables
- event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
- //<INS_RT_STRU> 窗体级子定义结构变量,用于返回
- end event
- on w_outware_tsale_ch.create
- int iCurrent
- call super::create
- this.st_2=create st_2
- this.em_1=create em_1
- this.cb_other=create cb_other
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.st_2
- this.Control[iCurrent+2]=this.em_1
- this.Control[iCurrent+3]=this.cb_other
- end on
- on w_outware_tsale_ch.destroy
- call super::destroy
- destroy(this.st_2)
- destroy(this.em_1)
- destroy(this.cb_other)
- end on
- event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
- boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
- cb_nextpage_enabled=cb_nextpage.enabled
- cb_retrieveall_enabled=cb_retrieveall.enabled
- cb_func_enabled=cb_func.enabled
- cb_nextpage.enabled=false
- cb_retrieveall.enabled=false
- cb_func.enabled=false
- SetPointer(HourGlass!)
- datetime first_date
- first_date=datetime(date(em_1.text),time('23:59:59'))
- dw_pageretr.retrieve(cur_scid,cur_cusid,cur_storageid,first_date)
- if dw_pageretr.rowcount()>0 and dw_pageretr.getrow()=0 then dw_pageretr.setrow(1)
- SetPointer(Arrow!)
- cb_nextpage.enabled=cb_nextpage_enabled
- cb_retrieveall.enabled=cb_retrieveall_enabled
- cb_func.enabled=cb_func_enabled
- IF cbx_mlselect.Checked AND dw_pageretr.RowCount() > 1 THEN
- dw_pageretr.SelectRow(1,FALSE)
- END IF
- end event
- event open;This.TriggerEvent('ue_before_open')
- wf_movetocenter()
- OLD_TITLE = This.Title
- EM_1.Text = String(Today(),'yyyy-mm-dd')
- s_tran = Message.PowerObjectParm
- IF Not IsNull(s_tran) THEN
- retrieve_all = s_tran.if_retrieve_all
- mode = s_tran.work_mode
- arg_pkid = s_tran.arg_pkid
- arg_string_code = s_tran.arg_string_code
- cur_cusid = s_tran.d_long
- cur_storageid = s_tran.c_long
- cur_scid = s_tran.b_long
- END IF
- dw_pageretr.RBUTTON_FILTER_USE = True
- dw_pageretr.titleclick_sort_use = True
- dw_pageretr.SetTransObject (sqlca)
- pkcolumndbtname = dw_pageretr.Describe("#1.dbname")
- ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select")
- ls_newselect = ori_oldselect
- ds_curquery = Create DATASTORE
- ds_curquery.DataObject = 'd_extr_find'
- ds_curquery.SetTransObject (sqlca)
- wf_editindex_lockf()
- s_hide_col s_col_mtrlsectype
- s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
- f_hide_col(1308,dw_pageretr,s_col_mtrlsectype)
- s_hide_col s_col_zxmtrlmode
- s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
- f_hide_col(1309,dw_pageretr,s_col_zxmtrlmode)
- sle_usual_query.Text = Trim(arg_string_code)
- IF Not retrieve_all THEN
- This.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve
- ELSE
- IF if_sharedata THEN
- ds_share.ShareData(dw_pageretr)
- ELSE
- wf_retrieveuc(dw_pageretr,ls_newselect,1)
- This.TriggerEvent('RETRIEVE_pageretr')
- END IF
- END IF
- IF retrieve_all THEN
- This.TriggerEvent("ue_usual_query_filt")
- END IF
- wf_face_change()
- s_hide_col s_col,s_col1
- s_col.col_1 = 'u_outwaremx_enprice'
- s_col.col_2 = 'u_outwaremx_rebate'
- s_col.col_3 = 'enamt'
- s_col.col_4 = 'u_outwaremx_ware_fprice'
- s_col.col_5 = 'u_outwaremx_fprice'
- s_col.col_6 = 'amt'
- f_hide_col(122,dw_pageretr,s_col)
- s_col1.col_1 = 'u_outwaremx_cost'
- f_hide_col(490,dw_pageretr,s_col1)
- end event
- event ue_usual_query_retr;call super::ue_usual_query_retr;String ls_querystrpart = ''
- ls_newselect = Lower(ori_oldselect)
- IF Trim(sle_usual_query.Text) <> '' THEN
- IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
- ls_querystrpart = ls_querystrpart + "(u_mtrldef.mtrlcode like '%"+Trim(sle_usual_query.Text)+"%'"
- ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '%"+Trim(sle_usual_query.Text)+"%')"
- ELSE
- ls_querystrpart = ls_querystrpart + "( u_mtrldef.mtrlcode like '"+Trim(sle_usual_query.Text)+"'"
- ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '"+Trim(sle_usual_query.Text)+"')"
- END IF
-
- IF Pos(ls_newselect," where ") <> 0 THEN
- ls_newselect = ls_newselect+" AND ("+ls_querystrpart+')'
- ELSE
- ls_newselect = ls_newselect+" where ("+ls_querystrpart+')'
- END IF
- END IF
- wf_retrieveuc(dw_pageretr,ls_newselect,1)
- THIS.TriggerEvent('retrieve_pageretr')
- end event
- event ue_retrieve_info;call super::ue_retrieve_info;Long ll_row
- Long ll_mtrlid
- ll_row = dw_pageretr.GetRow()
- IF ll_row <= 0 THEN
- ll_mtrlid = 0
- ELSE
- ll_mtrlid = dw_pageretr.Object.u_outwaremx_mtrlid[ll_row]
- END IF
- IF IsValid(w_mtrl_info) THEN
- w_mtrl_info.WindowState = Normal!
- w_mtrl_info.ins_mtrlid = ll_mtrlid
- w_mtrl_info.wf_retrieve(ll_mtrlid)
- END IF
- end event
- type cb_func from w_pageretr_ch2`cb_func within w_outware_tsale_ch
- end type
- type cb_exit from w_pageretr_ch2`cb_exit within w_outware_tsale_ch
- integer x = 869
- end type
- type sle_usual_query from w_pageretr_ch2`sle_usual_query within w_outware_tsale_ch
- end type
- type cb_retrieveall from w_pageretr_ch2`cb_retrieveall within w_outware_tsale_ch
- integer x = 1385
- end type
- type em_pagerowno from w_pageretr_ch2`em_pagerowno within w_outware_tsale_ch
- integer x = 1074
- end type
- type dw_pageretr from w_pageretr_ch2`dw_pageretr within w_outware_tsale_ch
- string dataobject = "dw_outware_tsale_ch"
- end type
- type st_1 from w_pageretr_ch2`st_1 within w_outware_tsale_ch
- end type
- type cb_nextpage from w_pageretr_ch2`cb_nextpage within w_outware_tsale_ch
- integer x = 1536
- end type
- type cb_choice from w_pageretr_ch2`cb_choice within w_outware_tsale_ch
- integer x = 718
- end type
- event cb_choice::clicked;call super::clicked;Long ROW,ls_i = 0,chC = 0
- datawindow dw
- IF cbx_ml.Checked THEN
- dw = dw_pageretr
-
- // ROW = dw.GetRow()
- // IF ROW <= 0 THEN
- // MessageBox('提示','请先选择目标行!', Information!, OK! )
- // RETURN
- // END IF
- ELSE
- dw = dw_choice
- dw.AcceptText()
- ROW = dw.RowCount()
- IF ROW <= 0 THEN
- MessageBox('提示','请先选择缓冲目标!', Information!, OK! )
- RETURN
- END IF
- END IF
- FOR ls_i = 1 To dw.RowCount()
- IF not cbx_ml.Checked or dw.IsSelected(ls_i) THEN
- IF dw.Object.u_outwaremx_qty[ls_i] < 0 THEN
- MessageBox('提示',"该记录为退货记录不能选择",information!,OK!)
- dw.SelectRow(0,FALSE)
- dw.SelectRow(ls_i,TRUE)
- RETURN
- END IF
- CHC++
- INS_RT_STRU.mtrlwareid[chC] = dw.Object.u_outwaremx_mtrlwareid[ls_i]
- INS_RT_STRU.outwareid[chC] = dw.Object.u_outware_outwareid[ls_i]
- INS_RT_STRU.outwarecode[chC] = dw.Object.u_outware_outwarecode[ls_i]
- INS_RT_STRU.mtrlid[chC] = dw.Object.u_outwaremx_mtrlid[ls_i]
- INS_RT_STRU.storageid[chC] = dw.Object.u_outware_storageid[ls_i]
- INS_RT_STRU.plancode[chC] = dw.Object.u_outwaremx_plancode[ls_i]
- INS_RT_STRU.qty[chC] = dw.Object.u_outwaremx_qty[ls_i]
- INS_RT_STRU.addqty[chC] = dw.Object.u_outwaremx_addqty[ls_i]
- INS_RT_STRU.price[chC] = dw.Object.u_outwaremx_price[ls_i]
- INS_RT_STRU.cost[chC] = dw.Object.u_outwaremx_cost[ls_i]
- INS_RT_STRU.planprice[chC] = dw.Object.u_outwaremx_planprice[ls_i]
-
- INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i]
- INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i]
- INS_RT_STRU.mtrltype[chC] = dw.Object.u_mtrldef_mtrltype[ls_i]
- INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i]
- INS_RT_STRU.dxflag[chC] = dw.Object.u_outwaremx_dxflag[ls_i]
- INS_RT_STRU.sptid[chC] = dw.Object.u_outwaremx_sptid[ls_i]
- IF IsNull(INS_RT_STRU.qty[chC]) THEN INS_RT_STRU.qty[chC] = 0
-
- INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[ls_i]
- INS_RT_STRU.fprice[chC] = dw.Object.u_outwaremx_fprice[ls_i]
- INS_RT_STRU.enprice[chC] = dw.Object.u_outwaremx_enprice[ls_i]
- INS_RT_STRU.rebate[chC] = dw.Object.u_outwaremx_rebate[ls_i]
-
- INS_RT_STRU.status[chC] = dw.Object.u_outwaremx_status[ls_i]
- INS_RT_STRU.woodcode[chC] = dw.Object.u_outwaremx_woodcode[ls_i]
- INS_RT_STRU.pcode[chC] = dw.Object.u_outwaremx_pcode[ls_i]
-
- INS_RT_STRU.mtrlsectype[chC] = dw.Object.u_mtrldef_mtrlsectype[ls_i]
- INS_RT_STRU.zxmtrlmode[chC] = dw.Object.u_mtrldef_zxmtrlmode[ls_i]
- INS_RT_STRU.outwarecode[chC] = dw.Object.u_outware_outwarecode[ls_i]
-
- INS_RT_STRU.unit[chC] = dw.Object.u_outwaremx_unit[ls_i]
- INS_RT_STRU.rate[chC] = dw.Object.u_outwaremx_rate[ls_i]
- INS_RT_STRU.uqty[chC] = dw.Object.u_outwaremx_uqty[ls_i]
- INS_RT_STRU.ware_enprice[chC] = dw.Object.u_outwaremx_ware_enprice[ls_i]
- INS_RT_STRU.ware_fprice[chC] = dw.Object.u_outwaremx_ware_fprice[ls_i]
-
- INS_RT_STRU.mxdscrp[chC] = dw.Object.u_outwaremx_mxdscrp[ls_i]
- INS_RT_STRU.mxdscrp2[chC] = dw.Object.u_outwaremx_mxdscrp2[ls_i]
-
-
-
- INS_RT_STRU.rel_address[chC] = dw.Object.u_outware_rel_address[ls_i]
- INS_RT_STRU.rel_rep[chC] = dw.Object.u_outware_rel_rep[ls_i]
- INS_RT_STRU.rel_tele[chC] = dw.Object.u_outware_rel_tele[ls_i]
- INS_RT_STRU.rel_tele1[chC] = dw.Object.u_outware_rel_tele1[ls_i]
- INS_RT_STRU.relstr_1[chC] = dw.Object.u_outware_relstr_1[ls_i]
- INS_RT_STRU.relstr_2[chC] = dw.Object.u_outware_relstr_2[ls_i]
- INS_RT_STRU.relstr_3[chC] = dw.Object.u_outware_relstr_3[ls_i]
- INS_RT_STRU.transcode[chC] = dw.Object.u_outware_transcode[ls_i]
- INS_RT_STRU.paytype[chC] = dw.Object.u_outware_paytype[ls_i]
- INS_RT_STRU.dscrp[chC] = dw.Object.u_outware_dscrp[ls_i]
- INS_RT_STRU.dscrp2[chC] = dw.Object.u_outware_dscrp2[ls_i]
- INS_RT_STRU.dscrp3[chC] = dw.Object.u_outware_dscrp3[ls_i]
- INS_RT_STRU.outrep[chC] = dw.Object.u_outware_outrep[ls_i]
-
- INS_RT_STRU.tax[chC] = dw.Object.u_outwaremx_tax[ls_i]
-
- INS_RT_STRU.relid[chC] = dw.Object.u_outwaremx_relid[ls_i]
- INS_RT_STRU.relprintid[chC] = dw.Object.u_outwaremx_relprintid[ls_i]
- END IF
- NEXT
- IF chC = 0 THEN
- MessageBox('提示','请至少选择一个目标行!', Information!, OK! )
- RETURN
- END IF
- CLOSE(PARENT)
- end event
- type cb_refresh from w_pageretr_ch2`cb_refresh within w_outware_tsale_ch
- end type
- type cb_help from w_pageretr_ch2`cb_help within w_outware_tsale_ch
- end type
- type ln_bar from w_pageretr_ch2`ln_bar within w_outware_tsale_ch
- end type
- type ln_bar2 from w_pageretr_ch2`ln_bar2 within w_outware_tsale_ch
- end type
- type r_bar from w_pageretr_ch2`r_bar within w_outware_tsale_ch
- integer x = 1518
- end type
- type ln_1 from w_pageretr_ch2`ln_1 within w_outware_tsale_ch
- end type
- type ln_2 from w_pageretr_ch2`ln_2 within w_outware_tsale_ch
- end type
- type cbx_ml from w_pageretr_ch2`cbx_ml within w_outware_tsale_ch
- end type
- type cb_ok from w_pageretr_ch2`cb_ok within w_outware_tsale_ch
- end type
- event cb_ok::clicked;call super::clicked;Long ROW,ls_i,chC = 0
- ROW = dw_pageretr.GetRow()
- IF ROW <= 0 THEN
- MessageBox('提示','请先选择目标行!', Information!, OK! )
- RETURN
- END IF
- FOR ls_i = 1 To dw_pageretr.RowCount()
- IF dw_pageretr.IsSelected(ls_i) THEN
- IF dw_choice.Find('u_outware_outwareid ='+String(dw_pageretr.Object.u_outware_outwareid[ls_i]) &
- + ' and u_outwaremx_printid = '+ String(dw_pageretr.Object.u_outwaremx_printid[ls_i]),1,dw_choice.RowCount()) = 0 THEN
- chC++
- dw_pageretr.RowsCopy(ls_i, ls_i, Primary!, dw_choice, dw_choice.RowCount() + 1, Primary!)
- END IF
- END IF
- NEXT
- end event
- type cb_del from w_pageretr_ch2`cb_del within w_outware_tsale_ch
- end type
- type cbx_mlselect from w_pageretr_ch2`cbx_mlselect within w_outware_tsale_ch
- end type
- type dw_choice from w_pageretr_ch2`dw_choice within w_outware_tsale_ch
- string dataobject = "dw_outware_tsale_ch"
- end type
- type cbx_allselect from w_pageretr_ch2`cbx_allselect within w_outware_tsale_ch
- end type
- type st_2 from statictext within w_outware_tsale_ch
- integer x = 1847
- integer y = 204
- integer width = 457
- integer height = 48
- 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 focusrectangle = false
- end type
- type em_1 from editmask within w_outware_tsale_ch
- integer x = 2295
- integer y = 180
- integer width = 402
- integer height = 92
- integer taborder = 130
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "none"
- alignment alignment = center!
- borderstyle borderstyle = stylelowered!
- maskdatatype maskdatatype = datemask!
- string mask = "yyyy-mm-dd"
- boolean spin = true
- end type
- type cb_other from uo_imflatbutton within w_outware_tsale_ch
- integer x = 453
- integer width = 265
- integer height = 164
- integer taborder = 40
- boolean bringtotop = true
- string text = "相关信息"
- string normalpicname = "find2.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;Long ll_row
- ll_row = dw_pageretr.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('系统提示','请选择物料')
- RETURN
- END IF
- Long ll_mtrlid
- ll_mtrlid = dw_pageretr.Object.u_outwaremx_mtrlid[ll_row]
- IF IsValid(w_mtrl_info) THEN
- w_mtrl_info.WindowState = Normal!
- w_mtrl_info.ins_mtrlid = ll_mtrlid
- w_mtrl_info.wf_retrieve(ll_mtrlid)
- ELSE
- OpenWithParm(w_mtrl_info,ll_mtrlid)
- END IF
- end event
|