123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620 |
- $PBExportHeader$w_rp_sale_mx_hc.srw
- forward
- global type w_rp_sale_mx_hc from w_publ_easyq
- end type
- type ddlb_flag from dropdownlistbox within w_rp_sale_mx_hc
- end type
- type ddlb_1 from uo_ddlb_storageid within w_rp_sale_mx_hc
- end type
- type st_1 from statictext within w_rp_sale_mx_hc
- end type
- type st_2 from statictext within w_rp_sale_mx_hc
- end type
- type ddlb_scid from uo_ddlb_scid within w_rp_sale_mx_hc
- end type
- type st_5 from statictext within w_rp_sale_mx_hc
- end type
- type cb_mod from uo_imflatbutton within w_rp_sale_mx_hc
- end type
- type cb_save from uo_imflatbutton within w_rp_sale_mx_hc
- end type
- type cb_3 from uo_imflatbutton within w_rp_sale_mx_hc
- end type
- end forward
- global type w_rp_sale_mx_hc from w_publ_easyq
- string title = "销售明细表修改成本价"
- ddlb_flag ddlb_flag
- ddlb_1 ddlb_1
- st_1 st_1
- st_2 st_2
- ddlb_scid ddlb_scid
- st_5 st_5
- cb_mod cb_mod
- cb_save cb_save
- cb_3 cb_3
- end type
- global w_rp_sale_mx_hc w_rp_sale_mx_hc
- type variables
- Long cur_storageid_arr[]
- Long cur_flag = -1 //-1:全部,0仓库未审,1仓库已审核
- Long cur_secflag = -1 //-1:全部,0财务未审
- long cur_scid_arr[]
- long cur_scid
- long cur_storageid
- end variables
- forward prototypes
- public function integer wf_dw ()
- end prototypes
- public function integer wf_dw ();String ls_windowname
- ls_windowname = THIS.ClassName ( )
- String ls_old_dwname,ls_new_dwname = ''
- ls_old_dwname = dw_1.DataObject
- ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname)
- IF ls_new_dwname = '' THEN
- ls_new_dwname = ls_old_dwname
- END IF
- dw_1.DataObject = ls_new_dwname
- dw_1.SetTransObject(sqlca)
- dw_1.uf_read_profile_layout()
- //
- f_title_change(dw_1)
- RETURN 1
- end function
- on w_rp_sale_mx_hc.create
- int iCurrent
- call super::create
- this.ddlb_flag=create ddlb_flag
- this.ddlb_1=create ddlb_1
- this.st_1=create st_1
- this.st_2=create st_2
- this.ddlb_scid=create ddlb_scid
- this.st_5=create st_5
- this.cb_mod=create cb_mod
- this.cb_save=create cb_save
- this.cb_3=create cb_3
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.ddlb_flag
- this.Control[iCurrent+2]=this.ddlb_1
- this.Control[iCurrent+3]=this.st_1
- this.Control[iCurrent+4]=this.st_2
- this.Control[iCurrent+5]=this.ddlb_scid
- this.Control[iCurrent+6]=this.st_5
- this.Control[iCurrent+7]=this.cb_mod
- this.Control[iCurrent+8]=this.cb_save
- this.Control[iCurrent+9]=this.cb_3
- end on
- on w_rp_sale_mx_hc.destroy
- call super::destroy
- destroy(this.ddlb_flag)
- destroy(this.ddlb_1)
- destroy(this.st_1)
- destroy(this.st_2)
- destroy(this.ddlb_scid)
- destroy(this.st_5)
- destroy(this.cb_mod)
- destroy(this.cb_save)
- destroy(this.cb_3)
- end on
- event ue_before_openretrieve;call super::ue_before_openretrieve;s_hide_col s_col1,s_col2,s_col3
- s_col1.col_1 = 'u_outwaremx_costamt'
- f_hide_col(490,dw_1,s_col1)
- s_col2.col_1 = 'gfamt'
- f_hide_col(843,dw_1,s_col2)
- s_col3.col_1 = 'u_outwaremx_enprice'
- s_col3.col_2 = 'enamt'
- s_col3.col_3 = 'fprice'
- s_col3.col_4 = 'amt_1'
- s_col3.col_5 = 'rebate'
- s_col3.col_6 = 'u_outwaremx_dftsaleprice'
- s_col3.col_7 = 'u_outwaremx_price'
- s_col3.col_8 = 'u_outwaremx_ware_fprice'
- s_col3.col_9 = 'ware_amt'
- f_hide_col(122,dw_1,s_col3)
- 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 event
- type cb_func from w_publ_easyq`cb_func within w_rp_sale_mx_hc
- end type
- type cb_exit from w_publ_easyq`cb_exit within w_rp_sale_mx_hc
- integer x = 1938
- end type
- type cb_2 from w_publ_easyq`cb_2 within w_rp_sale_mx_hc
- integer x = 1637
- boolean bringtotop = true
- end type
- type cb_psetup from w_publ_easyq`cb_psetup within w_rp_sale_mx_hc
- integer x = 1381
- boolean bringtotop = true
- end type
- type cb_1 from w_publ_easyq`cb_1 within w_rp_sale_mx_hc
- boolean bringtotop = true
- end type
- event cb_1::clicked;DateTime first_date,end_date
- 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 first_date = sys_showsaledata_mindt
- dw_1.Retrieve(cur_scid_arr,first_date,end_date,cur_flag,cur_secflag,cur_storageid_arr,sys_areaid)
- end event
- type st_3 from w_publ_easyq`st_3 within w_rp_sale_mx_hc
- integer x = 2066
- end type
- type st_4 from w_publ_easyq`st_4 within w_rp_sale_mx_hc
- integer x = 2784
- end type
- type em_1 from w_publ_easyq`em_1 within w_rp_sale_mx_hc
- integer x = 2286
- integer taborder = 130
- end type
- type em_2 from w_publ_easyq`em_2 within w_rp_sale_mx_hc
- integer x = 2875
- integer taborder = 140
- end type
- type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_sale_mx_hc
- integer x = 2377
- integer y = 0
- end type
- type cbx_yl from w_publ_easyq`cbx_yl within w_rp_sale_mx_hc
- integer x = 2167
- integer y = 4
- end type
- type dw_1 from w_publ_easyq`dw_1 within w_rp_sale_mx_hc
- integer y = 300
- integer width = 3557
- integer height = 1376
- string dataobject = "dw_rp_sale_mx_hc"
- end type
- event dw_1::doubleclicked;call super::doubleclicked;IF row > 0 THEN
- String ls_code
- Long ll_scid
- // int li_thflag
-
- ll_scid = THIS.Object.u_outware_scid[row]
- ls_code = THIS.Object.u_outware_outwarecode[row]
- // li_thflag = THIS.Object.thflag[row]
- f_open_win(ll_scid,ls_code)
- END IF
- end event
- event dw_1::clicked;call super::clicked; THIS.SetRow(row)
- end event
- type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_sale_mx_hc
- end type
- type sle_cust from w_publ_easyq`sle_cust within w_rp_sale_mx_hc
- end type
- type st_mtrl from w_publ_easyq`st_mtrl within w_rp_sale_mx_hc
- end type
- type st_cust from w_publ_easyq`st_cust within w_rp_sale_mx_hc
- end type
- type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_sale_mx_hc
- boolean visible = true
- integer x = 2167
- integer y = 96
- end type
- type pb_em1 from w_publ_easyq`pb_em1 within w_rp_sale_mx_hc
- integer x = 2702
- end type
- type pb_em2 from w_publ_easyq`pb_em2 within w_rp_sale_mx_hc
- integer x = 3287
- end type
- type pb_2 from w_publ_easyq`pb_2 within w_rp_sale_mx_hc
- integer x = 3397
- end type
- type cb_help from w_publ_easyq`cb_help within w_rp_sale_mx_hc
- integer x = 1787
- end type
- type cb_copyself from w_publ_easyq`cb_copyself within w_rp_sale_mx_hc
- integer x = 1125
- end type
- type gb_1 from w_publ_easyq`gb_1 within w_rp_sale_mx_hc
- end type
- type ln_bar from w_publ_easyq`ln_bar within w_rp_sale_mx_hc
- end type
- type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_sale_mx_hc
- end type
- type r_bar from w_publ_easyq`r_bar within w_rp_sale_mx_hc
- end type
- type ln_1 from w_publ_easyq`ln_1 within w_rp_sale_mx_hc
- end type
- type ln_2 from w_publ_easyq`ln_2 within w_rp_sale_mx_hc
- end type
- type ln_3 from w_publ_easyq`ln_3 within w_rp_sale_mx_hc
- end type
- type ln_4 from w_publ_easyq`ln_4 within w_rp_sale_mx_hc
- end type
- type ddlb_flag from dropdownlistbox within w_rp_sale_mx_hc
- integer x = 1669
- integer y = 200
- integer width = 379
- integer height = 484
- integer taborder = 90
- 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
- boolean vscrollbar = true
- string item[] = {"[全部]","待仓库审核","待财务审核","审核完毕"}
- borderstyle borderstyle = stylelowered!
- end type
- event selectionchanged;if index=1 then
- cur_flag=-1
- cur_secflag= -1
- elseif index=2 then
- cur_flag= 0
- cur_secflag= -1
- elseif index=3 then
- cur_flag= 1
- cur_secflag= 0
- elseif index=4 then
- cur_flag= 1
- cur_secflag= 1
- end if
- cb_1.triggerevent(clicked!)
- end event
- type ddlb_1 from uo_ddlb_storageid within w_rp_sale_mx_hc
- integer x = 814
- integer y = 200
- integer width = 681
- integer height = 1108
- integer taborder = 140
- boolean bringtotop = true
- end type
- event constructor;Long ls_storageid
- String ls_storagename
- Long cnt = 0
- Long ll_i
- String ls_space
- Int li_spacenum
-
- FOR ll_i = 1 TO UpperBound(sys_user_storageid)
- ls_storageid = sys_user_storageid[ll_i]
- SELECT storagename
- INTO :ls_storagename
- FROM u_storage
- Where storageid = :ls_storageid;
- IF sqlca.SQLCode <> 0 OR IsNull(ls_storagename) THEN ls_storagename = ''
-
- li_spacenum = 50 - Len(Trim(ls_storagename)) - 2 - Len(String(ls_storageid))
- ls_space = Fill(' ',li_spacenum)
-
- THIS.AddItem (ls_storagename+ls_space+'['+String(ls_storageid)+']')
-
- NEXT
- THIS.uo_storageid = ls_storageid
- uo_storageid_arr[1] = ls_storageid
- THIS.Text = ls_storagename+ls_space+'['+String(ls_storageid)+']'
- //THIS.Text = '[全部]'
- //uo_storageid = -1
- //uo_storageid_arr = sys_user_storageid
- //
- uf_get_storageid_arr(ls_storageid)
- cur_storageid_arr = this.uo_storageid_arr
- cur_storageid = this.uo_storageid_arr[1]
- end event
- event selectionchanged;call super::selectionchanged;cur_storageid_arr = this.uo_storageid_arr
- cur_storageid = this.uo_storageid_arr[1]
- cb_1.triggerevent(clicked!)
- end event
- type st_1 from statictext within w_rp_sale_mx_hc
- integer x = 654
- integer y = 208
- integer width = 146
- 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 = "仓库"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type st_2 from statictext within w_rp_sale_mx_hc
- integer x = 1527
- integer y = 212
- integer width = 128
- 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 = "状态"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type ddlb_scid from uo_ddlb_scid within w_rp_sale_mx_hc
- integer x = 142
- integer y = 200
- integer width = 480
- integer height = 620
- integer taborder = 130
- boolean bringtotop = true
- end type
- event constructor;
- Long ls_scid
- Long cnt = 0
- String ls_scname
- long ll_i
- string ls_space
- int li_spacenum
- for ll_i =1 to upperbound(sys_user_scid)
- ls_scid = sys_user_scid[ll_i]
- SELECT scname
- INTO :ls_scname
- FROM u_scdef
- Where scid = :ls_scid;
- if sqlca.sqlcode <> 0 or isnull(ls_scname) then ls_scname = ''
-
- li_spacenum = 50 - len(trim(ls_scname)) - 2 - len(string(ls_scid))
- ls_space = fill(' ',li_spacenum)
-
- THIS.AddItem (ls_scname+ls_space+'['+String(ls_scid)+']')
- next
- THIS.uo_scid = ls_scid
- uo_scid_arr[1] = ls_scid
- THIS.Text = ls_scname+ls_space+'['+String(ls_scid)+']'
- SELECT count(*) INTO :cnt FROM u_scdef ;
-
- cur_scid_arr = THIS.uo_scid_arr
- cur_scid = THIS.uo_scid_arr[1]
- end event
- event selectionchanged;call super::selectionchanged;
- cur_scid_arr = THIS.uo_scid_arr
- cur_scid = THIS.uo_scid_arr[1]
- cb_1.triggerevent(clicked!)
- end event
- type st_5 from statictext within w_rp_sale_mx_hc
- integer x = 5
- integer y = 208
- integer width = 128
- 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 = "分部"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type cb_mod from uo_imflatbutton within w_rp_sale_mx_hc
- integer x = 302
- integer width = 165
- integer height = 164
- integer taborder = 80
- boolean bringtotop = true
- string text = "修改"
- string normalpicname = "open.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;dw_edit_mode = NOT dw_edit_mode
- IF dw_edit_mode THEN
- dw_1.SetTabOrder('cost',10)
- cb_mod.Text = "放弃"
- cb_save.Enabled = TRUE
- ELSE
-
- dw_1.SetTabOrder('cost',0)
- cb_mod.Text = "修改"
- cb_save.Enabled = FALSE
- END IF
- cb_mod.TriggerEvent('ue_textchange')
- end event
- type cb_save from uo_imflatbutton within w_rp_sale_mx_hc
- integer x = 466
- integer width = 165
- integer height = 164
- integer taborder = 20
- boolean bringtotop = true
- boolean enabled = false
- string text = "保存"
- string normalpicname = "save.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;///////// //
- Long NbrRows,ll_row
- Long scid,outwareid,printid
- Decimal qty,cost
- dw_1.AcceptText()
- NbrRows = dw_1.RowCount()
- DO WHILE ll_row <= NbrRows
- ll_row = dw_1.GetNextModified(ll_row, Primary!)
- IF ll_row > 0 THEN
- scid = dw_1.Object.u_outware_scid[ll_row]
- outwareid = dw_1.Object.u_outware_outwareid[ll_row]
- printid = dw_1.Object.u_outwaremx_printid[ll_row]
- qty = dw_1.Object.u_outwaremx_qty[ll_row]
- cost = dw_1.Object.cost[ll_row]
-
- UPDATE u_outwaremx
- SET costamt = :cost * :qty
- WHERE scid = :scid AND
- outwareid = :outwareid AND
- printid = :printid;
- IF sqlca.SQLCode <> 0 THEN
- ROLLBACK;
- MessageBox('错误','保存失败')
- RETURN
- END IF
-
-
- ELSE
- ll_row = NbrRows + 1
- END IF
- LOOP
- COMMIT;
- dw_edit_mode = NOT dw_edit_mode
- dw_1.SetTabOrder('cost',0)
- cb_mod.Text = "修改"
- cb_save.Enabled = FALSE
- cb_mod.TriggerEvent('ue_textchange')
- MessageBox('提示','保存成功')
- end event
- type cb_3 from uo_imflatbutton within w_rp_sale_mx_hc
- integer x = 631
- integer width = 494
- integer height = 164
- integer taborder = 90
- boolean bringtotop = true
- string text = "调用成本价调整单"
- boolean border = false
- end type
- event clicked;call super::clicked;s_edit_index_tran s_tran //传递参数使用
- s_mtrlware_noalloc_array S_INSCUST
- Long it_mx,i
- dw_1.AcceptText()
- FOR i = 1 TO dw_1.RowCount()
- IF dw_1.Object.ch[i] = 1 THEN
- it_mx++
- S_INSCUST.mtrlwareid[it_mx] = dw_1.Object.u_outwaremx_mtrlwareid[i]
- S_INSCUST.mtrlid[it_mx] = dw_1.Object.u_outwaremx_mtrlid[i]
- S_INSCUST.u_mtrldef_mtrlcode[it_mx] = dw_1.Object.u_mtrldef_mtrlcode[i]
- S_INSCUST.u_mtrldef_mtrlname[it_mx] = dw_1.Object.u_mtrldef_mtrlname[i]
- S_INSCUST.u_mtrldef_mtrlmode[it_mx] = dw_1.Object.u_mtrldef_mtrlmode[i]
- S_INSCUST.u_mtrldef_unit[it_mx] = dw_1.Object.u_mtrldef_unit[i]
- S_INSCUST.noallocqty[it_mx] = dw_1.Object.u_mtrlware_noallocqty[i]
- S_INSCUST.cost[it_mx] = dw_1.Object.u_mtrlware_cost[i]
- S_INSCUST.planprice[it_mx] = dw_1.Object.u_mtrlware_planprice[i]
- S_INSCUST.plancode[it_mx] = dw_1.Object.u_mtrlware_plancode[i]
- S_INSCUST.status[it_mx] = dw_1.Object.u_outwaremx_status[i]
-
- S_INSCUST.woodcode[it_mx] = dw_1.Object.u_outwaremx_woodcode[i]
- S_INSCUST.pcode[it_mx] = dw_1.Object.u_outwaremx_pcode[i]
- S_INSCUST.u_mtrldef_zxmtrlmode[it_mx] = dw_1.Object.u_mtrldef_zxmtrlmode[i]
- S_INSCUST.u_mtrldef_mtrlsectype[it_mx] = dw_1.Object.u_mtrldef_mtrlsectype[i]
- S_INSCUST.sptname[it_mx] = dw_1.Object.sptname[i]
- S_INSCUST.sptcode[it_mx] = dw_1.Object.sptcode[i]
- S_INSCUST.scid[it_mx] = cur_scid
- S_INSCUST.storageid[it_mx] = cur_storageid
- END IF
- NEXT
- if it_mx = 0 then return
- OpenWithParm(w_update_cost,s_tran)
- w_update_cost.wf_auto_addmx(S_INSCUST)
- end event
|