$PBExportHeader$w_outware_sale_mod_price.srw forward global type w_outware_sale_mod_price from w_publ_base end type type cb_ok from uo_imflatbutton within w_outware_sale_mod_price end type type cb_1 from commandbutton within w_outware_sale_mod_price end type type cb_select from commandbutton within w_outware_sale_mod_price end type type cb_savemx from commandbutton within w_outware_sale_mod_price end type type cb_out from commandbutton within w_outware_sale_mod_price end type type cb_delmtrl from commandbutton within w_outware_sale_mod_price end type type st_3 from statictext within w_outware_sale_mod_price end type type em_1 from editmask within w_outware_sale_mod_price end type type pb_em1 from picturebutton within w_outware_sale_mod_price end type type st_4 from statictext within w_outware_sale_mod_price end type type em_2 from editmask within w_outware_sale_mod_price end type type pb_em2 from picturebutton within w_outware_sale_mod_price end type type pb_2 from picturebutton within w_outware_sale_mod_price end type type dw_2 from u_dw_rbtnfilter within w_outware_sale_mod_price end type type cb_delmx from commandbutton within w_outware_sale_mod_price end type type dw_1 from u_dw_rbtnfilter within w_outware_sale_mod_price end type type cb_modprice from commandbutton within w_outware_sale_mod_price end type end forward global type w_outware_sale_mod_price from w_publ_base integer width = 5463 integer height = 2084 string title = "批量修改单价" boolean maxbox = true windowstate windowstate = maximized! event ue_view_status ( long arg_row, string arg_status ) event ue_allowedit ( ) event ue_calculate ( ) event ue_mod_face ( ) cb_ok cb_ok cb_1 cb_1 cb_select cb_select cb_savemx cb_savemx cb_out cb_out cb_delmtrl cb_delmtrl st_3 st_3 em_1 em_1 pb_em1 pb_em1 st_4 st_4 em_2 em_2 pb_em2 pb_em2 pb_2 pb_2 dw_2 dw_2 cb_delmx cb_delmx dw_1 dw_1 cb_modprice cb_modprice end type global w_outware_sale_mod_price w_outware_sale_mod_price type variables s_edit_index_tran s_tran long ins_scid,ins_inwareid string ins_inwarecode int ii_enamt_edit = 0//0:不使用录入,不能编辑; 1:使用录入,可以编辑 int flag = 0 int cur_pcode = 1,cur_status = 1,cur_woodcode = 1 end variables forward prototypes public subroutine wf_mod_face () public subroutine wf_savecheck () public subroutine wf_select (integer arg_mtrlid) end prototypes event ue_view_status(long arg_row, string arg_status);s_view_dscrp s_view,s_return String ls_dscrp long ll_mtrlid,ll_statusflag,ll_woodcodeflag,ll_pcodeflag dw_1.AcceptText() ll_mtrlid = dw_1.object.mtrlid[arg_row] SELECT statusflag, woodcodeflag, pcodeflag into :ll_statusflag,:ll_woodcodeflag,:ll_pcodeflag FROM U_MTRLDEF where mtrlid = :ll_mtrlid; IF arg_status = 'status' THEN IF ll_statusflag<>5 THEN RETURN ELSEIF arg_status = 'woodcode' THEN IF ll_woodcodeflag<>5 THEN RETURN ELSEIF arg_status = 'pcode' then IF ll_pcodeflag<>5 THEN RETURN ELSE RETURN END IF ls_dscrp = dw_1.GetItemString(arg_row, arg_status) s_view.Title = '配置内容' s_view.dscrp = ls_dscrp s_view.editmode = dw_edit_mode OpenWithParm(w_view_status,s_view) IF dw_edit_mode THEN s_return = Message.PowerObjectParm dw_1.setitem(arg_row,arg_status,s_return.dscrp) END IF end event event ue_allowedit();Long Columns Int i String ls_modify_str Long ll_row Long ll_value Long ll_statusflag,ll_woodcodeflag,ll_pcodeflag String ls_status,ls_woodcode,ls_pcode String ls_data_type ll_row = dw_1.GetRow() IF ll_row <= 0 THEN RETURN Columns = Long(dw_1.Describe("DataWindow.Column.Count")) FOR i = 1 To Columns ls_modify_str = dw_1.Describe("#" + String(i) + ".name") ls_modify_str = Lower(ls_modify_str) IF i = 1 THEN //第1个字段,约定物料ID ls_data_type = dw_1.Describe(ls_modify_str+".ColType") IF ls_data_type = "long" THEN ll_value = dw_1.GetItemNumber(ll_row,ls_modify_str) END IF END IF IF Pos(ls_modify_str,'statusflag') > 0 THEN ls_data_type = dw_1.Describe(ls_modify_str+".ColType") IF ls_data_type = "long" THEN ll_statusflag = dw_1.GetItemNumber(ll_row,ls_modify_str) END IF END IF IF Pos(ls_modify_str,'woodcodeflag') > 0 THEN ls_data_type = dw_1.Describe(ls_modify_str+".ColType") IF ls_data_type = "long" THEN ll_woodcodeflag = dw_1.GetItemNumber(ll_row,ls_modify_str) END IF END IF IF Pos(ls_modify_str,'pcodeflag') > 0 THEN ls_data_type = dw_1.Describe(ls_modify_str+".ColType") IF ls_data_type = "long" THEN ll_pcodeflag = dw_1.GetItemNumber(ll_row,ls_modify_str) END IF END IF IF Pos(ls_modify_str,'status') > 0 And Pos(ls_modify_str,'statusflag') = 0 And Pos(ls_modify_str,'statustype') = 0 THEN IF Len(ls_modify_str) = Len('status') Or Pos(ls_modify_str,'_status') > 0 THEN IF Not (Pos(ls_modify_str,'u_saletask_status') > 0 Or & Pos(ls_modify_str,'u_buytask_status') > 0 Or & Pos(ls_modify_str,'u_order_ml_status') > 0 Or & Pos(ls_modify_str,'u_order_wfjg_status') > 0 Or & Pos(ls_modify_str,'u_rs_empinfo_status') > 0 ) THEN ls_status = ls_modify_str END IF END IF END IF IF Pos(ls_modify_str,'woodcode') > 0 And Pos(ls_modify_str,'woodcodeflag') = 0 And Pos(ls_modify_str,'woodcodetype') = 0 THEN IF Len(ls_modify_str) = Len('woodcode') Or Pos(ls_modify_str,'_woodcode') > 0 THEN ls_woodcode = ls_modify_str END IF END IF IF Pos(ls_modify_str,'pcode') > 0 And Pos(ls_modify_str,'pcodeflag') = 0 And Pos(ls_modify_str,'pcodetype') = 0 THEN IF Len(ls_modify_str) = Len('pcode') Or Pos(ls_modify_str,'_pcode') > 0 THEN ls_pcode = ls_modify_str END IF END IF NEXT IF ls_status <> '' THEN IF ll_statusflag = 5 THEN //只有5-仅填写时,才能用向下键切换到下一行, 使用ddlb时向下键是被屏蔽的 dw_1.Modify(ls_status+".edit.case='any'") dw_1.Modify(ls_status+".edit.AutoSelect='Yes'") ELSE dw_1.Modify(ls_status+".ddlb.case='any'") IF ll_statusflag <> 0 Or ll_value = 0 THEN dw_1.Modify(ls_status+".dddw.allowedit = no") ELSE dw_1.Modify(ls_status+".dddw.allowedit = yes") END IF END IF END IF IF ls_woodcode <> '' THEN IF ll_woodcodeflag = 5 THEN dw_1.Modify(ls_woodcode+".edit.case='any'") dw_1.Modify(ls_woodcode+".edit.AutoSelect='Yes'") ELSE dw_1.Modify(ls_woodcode+".ddlb.case='any'") IF ll_woodcodeflag <> 0 Or ll_value = 0 THEN dw_1.Modify(ls_woodcode+".dddw.allowedit = no") ELSE dw_1.Modify(ls_woodcode+".dddw.allowedit = yes") END IF END IF END IF IF ls_pcode <> '' THEN IF ll_pcodeflag = 5 THEN dw_1.Modify(ls_pcode+".edit.case='any'") dw_1.Modify(ls_pcode+".edit.AutoSelect='Yes'") ELSE dw_1.Modify(ls_pcode+".ddlb.case='any'") IF ll_pcodeflag <> 0 Or ll_value = 0 THEN dw_1.Modify(ls_pcode+".dddw.allowedit = no") ELSE dw_1.Modify(ls_pcode+".dddw.allowedit = yes") END IF END IF END IF end event event ue_calculate();if dw_1.rowcount()<=0 then return if dw_2.rowcount()<=0 then return dw_1.accepttext() long ll_mtrlid string ll_status,ll_woodcode,ll_pcode int row,i for i = 1 to dw_1.rowcount() dw_1.object.oldprice[i] = dw_1.object.price[i] next for row = 1 to dw_1.rowcount() ll_mtrlid = dw_1.object.mtrlid[row] ll_status = dw_1.object.status[row] ll_woodcode = dw_1.object.woodcode[row] ll_pcode = dw_1.object.pcode[row] wf_select(ll_mtrlid) for i =1 to dw_2.rowcount() if dw_2.object.mtrlid[i] = ll_mtrlid and (dw_2.object.status[i] = ll_status or cur_status = 0) and (dw_2.object.woodcode[i] = ll_woodcode or cur_woodcode = 0) and (dw_2.object.pcode[i] = ll_pcode or cur_pcode = 0) then dw_2.object.price[i] = dw_1.object.price[row] end if next next for row= 1 to dw_2.rowcount() dw_2.object.fprice[row] = Round(dw_2.object.price[row] * dw_2.object.mrate[row] ,10) dw_2.object.enamt[row] = Round(dw_2.object.saleqty[row] *dw_2.object.price[row]* dw_2.object.rebate[row], 2) dw_2.object.enamt_tax[row] = Round((dw_2.object.saleqty[row] *dw_2.object.price[row]* dw_2.object.rebate[row]) * dw_2.object.tax[row] / (1 + dw_2.object.tax[row]), 2) dw_2.object.bsamt[row] = Round(dw_2.object.saleqty[row] * dw_2.object.fprice[row] * dw_2.object.rebate[row], 2) dw_2.object.bsamt_tax[row] = Round((dw_2.object.saleqty[row] * dw_2.object.fprice[row] * dw_2.object.rebate[row] ) * dw_2.object.tax[row] / (1 + dw_2.object.tax[row] ), 2) dw_2.object.ware_enprice[row] = Round((dw_2.object.price[row] * dw_2.object.saleqty[row] )/Round(dw_2.object.saleqty[row] * dw_2.object.rate[row] ,5),10) //原币,库存单位,单价 dw_2.object.ware_fprice[row] = Round((dw_2.object.price[row] * dw_2.object.saleqty[row] )/Round(dw_2.object.saleqty[row] * dw_2.object.rate[row] ,5),10) * dw_2.object.mrate[row] //本位币,库存单位,单价 dw_2.object.ware_price[row] = Round((dw_2.object.price[row] * dw_2.object.saleqty[row] )/Round(dw_2.object.saleqty[row] * dw_2.object.rate[row] ,5),10) * dw_2.object.mrate[row] * dw_2.object.rebate[row] //本位币,库存单位,实价 dw_2.object.enamt_notax[row] = dw_2.object.enamt[row] - dw_2.object.enamt_tax[row] dw_2.object.enprice_notax[row] = dw_2.Object.price[row] / (1 + dw_2.object.tax[row]) dw_2.object.relprice[row] = Round(dw_2.object.price[row] * dw_2.object.mrate[row] * dw_2.object.rebate[row],10) next end event event ue_mod_face();// if dw_1.rowcount() > 0 then cb_select.enabled = true else cb_select.enabled = false cb_delmtrl.enabled = false cb_modprice.enabled = false cb_delmx.enabled = false cb_savemx.enabled = false end if end event public subroutine wf_mod_face ();// if dw_1.rowcount() > 0 then cb_select.enabled = true cb_delmtrl.enabled = true cb_modprice.enabled = true cb_delmx.enabled = true cb_savemx.enabled = true else cb_select.enabled = false cb_delmtrl.enabled = false cb_modprice.enabled = false cb_delmx.enabled = false cb_savemx.enabled = false end if end subroutine public subroutine wf_savecheck ();// end subroutine public subroutine wf_select (integer arg_mtrlid);int arg_ifpz = 7 select price_ifpz into :arg_ifpz from u_mtrldef where mtrlid = :arg_mtrlid; if sqlca.sqlcode <> 0 then arg_ifpz = 7 end if if arg_ifpz = 1 then cur_status = 1 cur_woodcode =0 cur_pcode =0 elseif arg_ifpz = 2 then cur_status = 0 cur_woodcode =1 cur_pcode =0 elseif arg_ifpz = 3 then cur_status = 0 cur_woodcode =0 cur_pcode =1 elseif arg_ifpz = 4 then cur_status = 1 cur_woodcode =1 cur_pcode =0 elseif arg_ifpz = 5 then cur_status = 0 cur_woodcode =1 cur_pcode =1 elseif arg_ifpz = 6 then cur_status = 1 cur_woodcode =0 cur_pcode =1 elseif arg_ifpz = 7 then cur_status = 1 cur_woodcode =1 cur_pcode =1 else cur_status = 0 cur_woodcode =0 cur_pcode =0 end if end subroutine on w_outware_sale_mod_price.create int iCurrent call super::create this.cb_ok=create cb_ok this.cb_1=create cb_1 this.cb_select=create cb_select this.cb_savemx=create cb_savemx this.cb_out=create cb_out this.cb_delmtrl=create cb_delmtrl this.st_3=create st_3 this.em_1=create em_1 this.pb_em1=create pb_em1 this.st_4=create st_4 this.em_2=create em_2 this.pb_em2=create pb_em2 this.pb_2=create pb_2 this.dw_2=create dw_2 this.cb_delmx=create cb_delmx this.dw_1=create dw_1 this.cb_modprice=create cb_modprice iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_ok this.Control[iCurrent+2]=this.cb_1 this.Control[iCurrent+3]=this.cb_select this.Control[iCurrent+4]=this.cb_savemx this.Control[iCurrent+5]=this.cb_out this.Control[iCurrent+6]=this.cb_delmtrl this.Control[iCurrent+7]=this.st_3 this.Control[iCurrent+8]=this.em_1 this.Control[iCurrent+9]=this.pb_em1 this.Control[iCurrent+10]=this.st_4 this.Control[iCurrent+11]=this.em_2 this.Control[iCurrent+12]=this.pb_em2 this.Control[iCurrent+13]=this.pb_2 this.Control[iCurrent+14]=this.dw_2 this.Control[iCurrent+15]=this.cb_delmx this.Control[iCurrent+16]=this.dw_1 this.Control[iCurrent+17]=this.cb_modprice end on on w_outware_sale_mod_price.destroy call super::destroy destroy(this.cb_ok) destroy(this.cb_1) destroy(this.cb_select) destroy(this.cb_savemx) destroy(this.cb_out) destroy(this.cb_delmtrl) destroy(this.st_3) destroy(this.em_1) destroy(this.pb_em1) destroy(this.st_4) destroy(this.em_2) destroy(this.pb_em2) destroy(this.pb_2) destroy(this.dw_2) destroy(this.cb_delmx) destroy(this.dw_1) destroy(this.cb_modprice) end on event open;call super::open;//long li_row //li_row=dw_1.insertrow(0) //dw_1.scrolltorow(li_row) //dw_1.SetColumn ('mtrlcode') EM_1.text = string(today()) EM_2.text = string(today()) dw_edit_mode = true wf_mod_face() end event event resize;call super::resize;dw_1.height = THIS.workspaceheight() - dw_1.y - 10 dw_2.height = THIS.workspaceheight() - dw_2.y - 10 dw_2.Width = this.workspacewidth() - dw_2.X - 10 end event type cb_func from w_publ_base`cb_func within w_outware_sale_mod_price boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_outware_sale_mod_price boolean visible = false integer x = 2258 integer y = 1380 integer picsize = 16 end type type cb_ok from uo_imflatbutton within w_outware_sale_mod_price boolean visible = false integer x = 2258 integer y = 1276 integer width = 311 integer height = 92 integer taborder = 20 boolean bringtotop = true string text = "查找" string normalpicname = "ok.bmp" integer picsize = 16 end type event clicked;call super::clicked; Long rslt = 1 Long i long ll_printid Decimal ld_uprice,ld_jgprice, lde_rebate, lde_tax String arg_msg dw_1.AcceptText() uo_inware uo_ware uo_ware = create uo_inware uo_ware.commit_transaction = sqlca i = dw_1.GetNextModified(0 , Primary!) IF i = 0 THEN arg_msg = "单价没有修改" rslt = 0 GOTO ext END IF DO WHILE i > 0 ll_printid = dw_1.Object.u_inwaremx_printid[i] ld_uprice = abs(dw_1.Object.u_inwaremx_uprice[i]) ld_jgprice = 0 lde_rebate = dw_1.Object.u_inwaremx_rebate[i] lde_tax = dw_1.Object.u_inwaremx_tax[i] IF uo_ware.mod_price(ins_scid,ins_inwareid,ll_printid,ld_uprice,ld_jgprice,lde_rebate, lde_tax,arg_msg,false) = 0 THEN arg_msg = "行:"+string(i)+","+arg_msg rslt = 0 GOTO ext END IF i = dw_1.GetNextModified(i, Primary!) LOOP ext: destroy uo_ware IF rslt = 0 THEN ROLLBACK; MessageBox('错误',arg_msg, StopSign!, OK! ) RETURN ELSE COMMIT; MessageBox('提示','修改单价成功!', Information!, OK! ) Close(Parent) END IF end event type cb_1 from commandbutton within w_outware_sale_mod_price integer x = 59 integer y = 24 integer width = 302 integer height = 100 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "选择物料" end type event clicked; IF Not IsValid(W_mtrldef_edit) THEN s_edit_index_tran s_tranf8 //传递参数使用 //s_tranf8.if_retrieve_all = This.retrieve_all //是否一次retrieve所有行 s_tranf8.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式 s_tranf8.arg_pkid = 0 //目标定位pkid (备用) s_tranf8.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选 s_tranf8.if_select_all = True //多选 s_tranf8.b_long = -2 //选产品 --20190401 暂时更改为记录上次选择 s_tranf8.d_long = -1 //仓库 Long ls_j,child_row child_row = dw_1.GetRow() IF dw_1.GetRow() > 0 THEN s_tranf8.arg_string_code = Trim(dw_1.Object.mtrlcode[dw_1.GetRow()]) OpenWithParm(W_mtrldef_edit,s_tranf8) //调用 s_mtrldef_array s_inscust s_inscust = Message.PowerObjectParm //接受返回结构 IF UpperBound(s_inscust.mtrlid) > 0 and s_inscust.mtrlid[1] > 0 THEN dw_2.reset() FOR ls_j = 1 To UpperBound(s_inscust.mtrlid) IF s_inscust.mtrlid[ls_j] > 0 THEN //正常返回值则可以取以下值 IF dw_1.GetRow() > 0 THEN IF dw_1.Object.mtrlid[child_row] <> 0 THEN child_row = dw_1.InsertRow (0) ELSE child_row = dw_1.GetRow() END IF ELSE child_row = dw_1.InsertRow (0) END IF dw_1.Object.mtrlid[child_row] = s_inscust.mtrlid[ls_j] dw_1.Object.mtrlcode[child_row] = s_inscust.mtrlcode[ls_j] dw_1.Object.mtrlname[child_row] = s_inscust.mtrlname[ls_j] dw_1.Object.statusflag[child_row] = s_inscust.statusflag[ls_j] dw_1.Object.woodcodeflag[child_row] = s_inscust.woodcodeflag[ls_j] dw_1.Object.pcodeflag[child_row] = s_inscust.pcodeflag[ls_j] end if next end if wf_mod_face() parent.TriggerEvent('ue_allowedit') end event type cb_select from commandbutton within w_outware_sale_mod_price integer x = 2199 integer y = 32 integer width = 302 integer height = 100 integer taborder = 40 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "查找" end type event clicked;if dw_1.rowcount()<=0 then return dw_1.AcceptText() dw_2.Reset() s_outware_price s_outp long i,j,row long ll_mtrlid string ll_status,ll_woodcode,ll_pcode,ll_mtrlname,ll_mtrlcode decimal ll_price,ll_saleqty,ll_rebate,ll_tax,ll_mrate,ll_rate decimal ll_fprice,ll_enamt,ll_enamt_tax,ll_bsamt,ll_bsamt_tax,ll_ware_enprice,ll_ware_price,ll_ware_fprice,ll_enamt_notax,ll_enprice_notax datetime bdate,edate long ls_scid,ls_outwareid,ls_enprice,ls_printid string ls_outwarecode,arg_msg bdate = datetime(date(EM_1.TEXT),time(0)) edate = datetime(date(EM_2.TEXT),time('23:59:59')) for i = 1 to dw_1.rowcount() ll_mtrlid = dw_1.object.mtrlid[i] ll_status = dw_1.object.status[i] ll_woodcode = dw_1.object.woodcode[i] ll_pcode = dw_1.object.pcode[i] ll_price = dw_1.object.price[i]//修改后单价 ll_mtrlname = dw_1.object.mtrlname[i] ll_mtrlcode = dw_1.object.mtrlcode[i] wf_select(ll_mtrlid) DECLARE C1 CURSOR FOR select u_outware.mrate, u_outwaremx.scid, u_outwaremx.outwareid, u_outware.outwarecode, u_outwaremx.printid, u_outwaremx.enprice, u_outwaremx.saleqty, u_outwaremx.rebate, u_outwaremx.tax, u_outwaremx.rate, u_outwaremx.fprice, u_outwaremx.enamt, u_outwaremx.enamt_tax, u_outwaremx.bsamt, u_outwaremx.bsamt_tax, u_outwaremx.ware_enprice, u_outwaremx.ware_fprice, u_outwaremx.ware_price, u_outwaremx.enprice_notax, u_outwaremx.status, u_outwaremx.woodcode, u_outwaremx.pcode from u_outware inner join u_outwaremx on u_outware.outwareid = u_outwaremx.outwareid where u_outwaremx.mtrlid =:ll_mtrlid and (u_outwaremx.status = :ll_status or :cur_status = 0) and (u_outwaremx.woodcode =:ll_woodcode or :cur_woodcode = 0) and (u_outwaremx.pcode = :ll_pcode or :cur_pcode = 0) and u_outware.outdate >= :bdate and u_outware.outdate<=:edate and u_outware.flag = 0 and u_outware.secflag = 0; OPEN C1; FETCH C1 INTO :ll_mrate,:ls_scid,:ls_outwareid,:ls_outwarecode,:ls_printid,:ls_enprice,:ll_saleqty,:ll_rebate,:ll_tax,:ll_rate,:ll_fprice,:ll_enamt,:ll_enamt_tax,:ll_bsamt,:ll_bsamt_tax,:ll_ware_enprice,:ll_ware_price,:ll_ware_fprice,:ll_enprice_notax,:ll_status,:ll_woodcode,:ll_pcode; DO WHILE sqlca.SQLCODE=0 j += 1 s_outp.scid[j] = ls_scid s_outp.mtrlid[j] = ll_mtrlid s_outp.mtrlcode[j] = ll_mtrlcode s_outp.mtrlname[j] = ll_mtrlname s_outp.outwareid[j] = ls_outwareid s_outp.outwarecode[j] = ls_outwarecode s_outp.printid[j] = ls_printid s_outp.enprice[j] = ls_enprice s_outp.status[j] = ll_status s_outp.woodcode[j] = ll_woodcode s_outp.pcode[j] = ll_pcode s_outp.price[j] =ll_price s_outp.saleqty[j] =ll_saleqty s_outp.rebate[j] =ll_rebate s_outp.tax[j] =ll_tax s_outp.mrate[j] =ll_mrate s_outp.rate[j] =ll_rate s_outp.fprice[j] =ll_fprice s_outp.enamt[j] =ll_enamt s_outp.enamt_tax[j] =ll_enamt_tax s_outp.bsamt[j] =ll_bsamt s_outp.bsamt_tax[j] =ll_bsamt_tax s_outp.ware_enprice[j] =ll_ware_enprice s_outp.ware_price[j] =ll_ware_price s_outp.ware_fprice[j] =ll_ware_fprice s_outp.enprice_notax[j] =ll_enprice_notax FETCH C1 INTO :ll_mrate,:ls_scid,:ls_outwareid,:ls_outwarecode,:ls_printid,:ls_enprice,:ll_saleqty,:ll_rebate,:ll_tax,:ll_rate,:ll_fprice,:ll_enamt,:ll_enamt_tax,:ll_bsamt,:ll_bsamt_tax,:ll_ware_enprice,:ll_ware_price,:ll_ware_fprice,:ll_enprice_notax,:ll_status,:ll_woodcode,:ll_pcode; LOOP CLOSE C1; next if upperbound(s_outp.outwareid) > 0 then for i = 1 to upperbound(s_outp.outwareid) if s_outp.outwareid[i] <=0 then continue row = dw_2.insertrow(0) dw_2.object.mtrlid[row] = s_outp.mtrlid[i] dw_2.object.mtrlname[row] = s_outp.mtrlname[i] dw_2.object.mtrlcode[row] = s_outp.mtrlcode[i] dw_2.object.scid[row] = s_outp.scid[i] dw_2.object.printid[row] = s_outp.printid[i] dw_2.object.outwareid[row] = s_outp.outwareid[i] dw_2.object.outwarecode[row] = s_outp.outwarecode[i] dw_2.object.enprice[row] = s_outp.enprice[i] dw_2.object.price[row] = s_outp.enprice[i] dw_2.object.status[row] = s_outp.status[i] dw_2.object.woodcode[row] = s_outp.woodcode[i] dw_2.object.pcode[row] = s_outp.pcode[i] dw_2.object.saleqty[row] = s_outp.saleqty[i] dw_2.object.rate[row] = s_outp.rate[i] dw_2.object.tax[row] = s_outp.tax[i] dw_2.object.mrate[row] = s_outp.mrate[i] dw_2.object.rebate[row] = s_outp.rebate[i] dw_2.object.fprice[row] = s_outp.fprice[i] dw_2.object.enamt[row] = s_outp.enamt[i] dw_2.object.enamt_tax[row] = s_outp.enamt_tax[i] dw_2.object.bsamt[row] = s_outp.bsamt[i] dw_2.object.bsamt_tax[row] = s_outp.bsamt_tax[i] dw_2.object.ware_enprice[row] = s_outp.ware_enprice[i] dw_2.object.ware_fprice[row] = s_outp.ware_fprice[i] dw_2.object.ware_price[row] = s_outp.ware_price[i] dw_2.object.enamt_notax[row] = dw_2.object.enamt[row] - dw_2.object.enamt_tax[row] dw_2.object.enprice_notax[row] = s_outp.enprice_notax[i] dw_2.object.relprice[row] = Round(s_outp.price[i] * s_outp.mrate[i] * s_outp.rebate[i],10) next end if wf_mod_face() end event type cb_savemx from commandbutton within w_outware_sale_mod_price integer x = 2967 integer y = 32 integer width = 302 integer height = 100 integer taborder = 50 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "更新" end type event clicked;if dw_2.rowcount() <= 0 then return parent.TriggerEvent('ue_calculate') wf_mod_face() long i long ll_scid,ll_outwareid,ll_printid,ll_mtrlid string ll_status,ll_woodcode,ll_pcode,ll_opemp datetime ll_updatetime decimal ll_enprice,ll_price,ll_enamt,ll_enamt_tax,ll_bsamt,ll_bsamt_tax,ll_oldprice,ll_fprice decimal ll_ware_enprice,ll_ware_fprice ,ll_ware_price,ll_enamt_notax,ll_enprice_notax,ll_relprice string arg_msg dw_1.accepttext() for i = 1 to dw_1.rowcount() if dw_1.object.oldprice[i] <> dw_1.object.price[i] then IF MessageBox('是否继续','修改单价数据已经改变,是否继续更新??',Question!,YesNo!,1 ) = 2 THEN RETURN END IF end if next for i = 1 to dw_2.rowcount() SELECT Top 1 getdate() Into :ll_updatetime From u_user; ll_scid = dw_2.object.scid[i] ll_outwareid = dw_2.object.outwareid[i] ll_printid = dw_2.object.printid[i] ll_mtrlid = dw_2.object.mtrlid[i] ll_status = dw_2.object.status[i] ll_woodcode = dw_2.object.woodcode[i] ll_pcode = dw_2.object.pcode[i] ll_enprice = dw_2.object.enprice[i] ll_opemp = publ_operator ll_price = dw_2.object.price[i] ll_enamt = dw_2.object.enamt[i] ll_enamt_tax = dw_2.object.enamt_tax[i] ll_bsamt = dw_2.object.bsamt[i] ll_bsamt_tax = dw_2.object.bsamt_tax[i] ll_fprice = dw_2.object.fprice[i] ll_ware_enprice = dw_2.object.ware_enprice[i] ll_ware_fprice = dw_2.object.ware_fprice[i] ll_ware_price = dw_2.object.ware_price[i] ll_ware_fprice = dw_2.object.ware_fprice[i] ll_ware_price = dw_2.object.ware_price[i] ll_enamt_notax = dw_2.object.enamt_notax[i] ll_enprice_notax = dw_2.object.enprice_notax[i] ll_relprice = dw_2.object.relprice[i] update u_outwaremx set enprice = :ll_price, enamt = :ll_enamt, enamt_tax = :ll_enamt_tax, bsamt = :ll_bsamt, bsamt_tax = :ll_bsamt_tax, fprice = :ll_fprice, ware_enprice = :ll_ware_enprice, ware_fprice = :ll_ware_fprice, ware_price = :ll_ware_price, enprice_notax = :ll_enprice_notax, price = :ll_relprice, ware_amt = :ll_bsamt where scid = :ll_scid and outwareid = :ll_outwareid and printid = :ll_printid and mtrlid = :ll_mtrlid and status = :ll_status and woodcode = :ll_woodcode and pcode = :ll_pcode ; if sqlca.sqlcode = 0 then INSERT INTO u_outware_mod_price (scid, outwareid, printid, mtrlid, status, woodcode, pcode, enprice, updatetime, opemp ) VALUES ( :ll_scid, :ll_outwareid, :ll_printid, :ll_mtrlid, :ll_status, :ll_woodcode, :ll_pcode, :ll_enprice, :ll_updatetime, :ll_opemp ); if sqlca.sqlcode <> 0 then arg_msg = '无法插入更新记录' messagebox('提示',arg_msg) rollback; return; end if else arg_msg = '无法更新单价' messagebox('提示',arg_msg) rollback; return; end if next messagebox('提示','更新单价成功') commit; wf_mod_face() end event type cb_out from commandbutton within w_outware_sale_mod_price integer x = 3282 integer y = 32 integer width = 302 integer height = 100 integer taborder = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "退出" boolean cancel = true end type event clicked;close(parent) end event type cb_delmtrl from commandbutton within w_outware_sale_mod_price integer x = 366 integer y = 24 integer width = 302 integer height = 100 integer taborder = 70 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "删除物料" end type event clicked;if dw_1.getrow() <=0 then return long ll_mtrlid string ll_status,ll_woodcode,ll_pcode ll_mtrlid = dw_1.object.mtrlid[dw_1.getrow()] ll_status = dw_1.object.status[dw_1.getrow()] ll_woodcode = dw_1.object.woodcode[dw_1.getrow()] ll_pcode = dw_1.object.pcode[dw_1.getrow()] wf_select(ll_mtrlid) dw_1.deleterow(dw_1.getrow()) int i for i = 1 to dw_2.rowcount() if dw_2.object.mtrlid[i] = ll_mtrlid and (dw_2.object.status[i] = ll_status or cur_pcode = 0) and (dw_2.object.woodcode[i] = ll_woodcode or cur_woodcode = 0) and (dw_2.object.pcode[i] = ll_pcode or cur_pcode = 0) then dw_2.deleterow(i) i -- end if next wf_mod_face() end event type st_3 from statictext within w_outware_sale_mod_price integer x = 699 integer y = 48 integer width = 201 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 boolean enabled = false string text = "日期从:" alignment alignment = right! boolean focusrectangle = false end type type em_1 from editmask within w_outware_sale_mod_price integer x = 901 integer y = 32 integer width = 407 integer height = 92 integer taborder = 110 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! maskdatatype maskdatatype = datemask! string mask = "yyyy-mm-dd" boolean spin = true end type event rbuttondown;s_calender_arg s_calender s_calender.PointerX = THIS.PointerX() s_calender.PointerY = THIS.PointerY() s_calender.X = THIS.X s_calender.Y = THIS.Y OpenWithParm(w_calendar,s_calender) THIS.Text = String(id_date_selected) end event type pb_em1 from picturebutton within w_outware_sale_mod_price integer x = 1317 integer y = 32 integer width = 101 integer height = 92 integer taborder = 120 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string picturename = "date.BMP" alignment htextalign = left! end type event clicked;em_1.triggerevent(rbuttondown!) end event type st_4 from statictext within w_outware_sale_mod_price integer x = 1431 integer y = 48 integer width = 105 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 boolean enabled = false string text = "到:" alignment alignment = right! boolean focusrectangle = false end type type em_2 from editmask within w_outware_sale_mod_price integer x = 1563 integer y = 36 integer width = 407 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 borderstyle borderstyle = stylelowered! maskdatatype maskdatatype = datemask! string mask = "yyyy-mm-dd" boolean spin = true end type event rbuttondown;s_calender_arg s_calender s_calender.PointerX = THIS.PointerX() s_calender.PointerY = THIS.PointerY() s_calender.X = THIS.X s_calender.Y = THIS.Y OpenWithParm(w_calendar,s_calender) THIS.Text = String(id_date_selected) end event type pb_em2 from picturebutton within w_outware_sale_mod_price integer x = 1979 integer y = 36 integer width = 101 integer height = 92 integer taborder = 140 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string picturename = "date.BMP" alignment htextalign = left! end type event clicked;em_2.triggerevent(rbuttondown!) end event type pb_2 from picturebutton within w_outware_sale_mod_price integer x = 2089 integer y = 36 integer width = 101 integer height = 92 integer taborder = 150 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string picturename = "date1.BMP" alignment htextalign = left! end type event clicked;m_Dfc_Control_PopupMenu dmPopupMenu string menustr menustr="Text=本日~tEvent=ue_date1" menustr = menustr + "|" + "Text=本周~tEvent=ue_date2" menustr = menustr + "|" + "Text=本月~tEvent=ue_date3" menustr = menustr + "|" + "Text=上月~tEvent=ue_date4" if len(trim(menustr))<>0 then dmPopupMenu = Create m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(This, menustr) dmPopupMenu.mf_PopMenu() Destroy dmPopupMenu end if end event type dw_2 from u_dw_rbtnfilter within w_outware_sale_mod_price integer x = 2642 integer y = 140 integer height = 1420 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_outware_sale_mod_price_mx" boolean hscrollbar = true boolean vscrollbar = true end type event clicked;call super::clicked;if row <= 0 then return this.selectrow(0,false) this.setrow(row) this.selectrow(row,true) end event type cb_delmx from commandbutton within w_outware_sale_mod_price integer x = 2661 integer y = 32 integer width = 302 integer height = 100 integer taborder = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "删除明细" end type event clicked;if dw_2.getrow() <=0 then return dw_2.deleterow(dw_2.getrow()) wf_mod_face() end event type dw_1 from u_dw_rbtnfilter within w_outware_sale_mod_price event ue_dropdown pbm_dwndropdown integer y = 140 integer width = 2619 integer height = 1540 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_outware_sale_mod_price" boolean hscrollbar = true boolean vscrollbar = true end type event ue_dropdown;String ls_col_pz,ls_col_mtrlid String ls_pz_ch String ls_col_value String ls_data_type Long ll_row,ll_mtrlid s_pzwin_open arg_s_win ll_row = This.GetRow() IF ll_row > 0 THEN ls_col_mtrlid = This.Describe("#1.Name") //IF Not Pos(Lower(ls_col_mtrlid),'mtrlid') > 0 THEN RETURN ll_mtrlid = this.object.mtrlid[ll_row] ls_col_pz = This.GetColumnName( ) ls_data_type = this.Describe(ls_col_pz+".ColType") IF Pos(Lower(ls_data_type),"char") > 0 THEN ls_col_value = This.GetItemString(ll_row,ls_col_pz) END IF arg_s_win.arg_x = This.X + This.PointerX() + Parent.X arg_s_win.arg_y = This.Y + This.PointerY() + Parent.Y arg_s_win.arg_col = ls_col_pz arg_s_win.arg_mtrlid = ll_mtrlid arg_s_win.arg_col_value = ls_col_value ls_pz_ch = f_mtrl_pz(arg_s_win) IF isnull(ls_pz_ch) THEN RETURN This.SetItem(ll_row,ls_col_pz,ls_pz_ch) END IF return 1 end event event clicked;call super::clicked;if row <= 0 then return this.selectrow(0,false) this.setrow(row) this.selectrow(row,true) end event event itemfocuschanged;call super::itemfocuschanged;dw_1.accepttext() end event event doubleclicked;call super::doubleclicked; if dwo.name = 'status' or dwo.name = 'woodcode' or dwo.name = 'pcode' then string name name =dwo.name PARENT.trigger event ue_view_status(row,name) end if end event type cb_modprice from commandbutton within w_outware_sale_mod_price boolean visible = false integer x = 2656 integer y = 144 integer width = 302 integer height = 100 integer taborder = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "修改单价" end type event clicked;if dw_2.getrow() <=0 then return if dw_1.getrow() <=0 then return parent.TriggerEvent('ue_calculate') wf_mod_face() end event