$PBExportHeader$w_outwaremx_p_scanqty.srw forward global type w_outwaremx_p_scanqty from w_publ_base end type type cb_ok from uo_imflatbutton within w_outwaremx_p_scanqty end type type st_1 from statictext within w_outwaremx_p_scanqty end type type st_msg from statictext within w_outwaremx_p_scanqty end type type sle_1 from u_sleedit within w_outwaremx_p_scanqty end type type cb_1 from uo_imflatbutton within w_outwaremx_p_scanqty end type type cb_err from uo_imflatbutton within w_outwaremx_p_scanqty end type type dw_1 from u_dw_rbtnfilter within w_outwaremx_p_scanqty end type type dw_2 from u_dw_rbtnfilter within w_outwaremx_p_scanqty end type end forward global type w_outwaremx_p_scanqty from w_publ_base integer width = 3922 integer height = 2064 string title = "扫描窗口" boolean minbox = false windowtype windowtype = response! windowstate windowstate = maximized! cb_ok cb_ok st_1 st_1 st_msg st_msg sle_1 sle_1 cb_1 cb_1 cb_err cb_err dw_1 dw_1 dw_2 dw_2 end type global w_outwaremx_p_scanqty w_outwaremx_p_scanqty type variables s_edit_index_tran s_tran long ins_scid,ins_inwareid string ins_inwarecode long cur_thflag long err_num=0 w_outware_sale parent_win w_outware_sale_th parent_win_th long ll_VerticalScroll//垂直滚动条位置 end variables on w_outwaremx_p_scanqty.create int iCurrent call super::create this.cb_ok=create cb_ok this.st_1=create st_1 this.st_msg=create st_msg this.sle_1=create sle_1 this.cb_1=create cb_1 this.cb_err=create cb_err this.dw_1=create dw_1 this.dw_2=create dw_2 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_ok this.Control[iCurrent+2]=this.st_1 this.Control[iCurrent+3]=this.st_msg this.Control[iCurrent+4]=this.sle_1 this.Control[iCurrent+5]=this.cb_1 this.Control[iCurrent+6]=this.cb_err this.Control[iCurrent+7]=this.dw_1 this.Control[iCurrent+8]=this.dw_2 end on on w_outwaremx_p_scanqty.destroy call super::destroy destroy(this.cb_ok) destroy(this.st_1) destroy(this.st_msg) destroy(this.sle_1) destroy(this.cb_1) destroy(this.cb_err) destroy(this.dw_1) destroy(this.dw_2) end on event open;call super::open;dw_1.SetTransObject(sqlca) dw_2.SetTransObject(sqlca) dw_2.Visible = False s_tran = Message.PowerObjectParm ins_scid = s_tran.b_long ins_inwareid = s_tran.c_long ins_inwarecode = s_tran.c_string cur_thflag = s_tran.d_long IF cur_thflag = 0 THEN parent_win = ParentWindow() ELSE parent_win_th = ParentWindow() END IF dw_1.Retrieve( ins_scid,ins_inwareid) dw_1.SetTabOrder('u_outwaremx_scanqty',10) sle_1.SetFocus() Long i FOR i = 1 To dw_1.RowCount() dw_1.Object.u_outwaremx_scanqty[i] = 0 NEXT end event event resize;call super::resize;dw_1.height=this.height - dw_1.y - 500 dw_1.width=this.width - 150 cb_1.y= dw_1.y + dw_1.height + 50 cb_ok.y= cb_1.y cb_exit.y= cb_1.y cb_err.y= cb_1.y end event type cb_func from w_publ_base`cb_func within w_outwaremx_p_scanqty boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_outwaremx_p_scanqty integer x = 2025 integer y = 1860 integer picsize = 16 end type type cb_ok from uo_imflatbutton within w_outwaremx_p_scanqty integer x = 1371 integer y = 1864 integer width = 311 integer height = 96 integer taborder = 20 boolean bringtotop = true string normalpicname = "ok.bmp" integer picsize = 16 end type event clicked;call super::clicked; Long rslt = 1 Long i Long ll_printid Decimal lde_buyqty,ld_jgprice, lde_rebate, lde_tax String arg_msg Decimal dec_scanqty dw_1.AcceptText() FOR i = 1 To dw_1.RowCount() IF dw_1.Object.u_outwaremx_scanqty[i] <> dw_1.Object.u_outwaremx_uqty[i] THEN MessageBox('','第' + String(i) + '行出仓数不等于扫描数!') RETURN END IF NEXT FOR i = 1 To dw_1.RowCount() ll_printid = dw_1.Object.u_outwaremx_printid[i] dec_scanqty = dw_1.Object.u_outwaremx_scanqty[i] IF IsNull(dec_scanqty) THEN dec_scanqty = 0 IF cur_thflag = 1 THEN dec_scanqty = Abs(dec_scanqty) * (-1) UPDATE u_outwaremx Set scanqty = :dec_scanqty Where scid = :ins_scid And outwareid = :ins_inwareid And printid = :ll_printid; NEXT UPDATE u_outware Set scanflag = 1 Where scid = :ins_scid And outwareid = :ins_inwareid ; IF rslt = 0 THEN ROLLBACK; MessageBox('错误',arg_msg, StopSign!, OK! ) RETURN ELSE COMMIT; MessageBox('提示','修改扫描数量成功!', Information!, OK! ) IF cur_thflag = 0 THEN parent_win = ParentWindow() parent_win.dw_pageretr.Object.scanflag[parent_win.dw_pageretr.GetRow()] = 1 ELSE parent_win_th = ParentWindow() parent_win_th.dw_pageretr.Object.u_outware_scanflag[parent_win_th.dw_pageretr.GetRow()] = 1 END IF Close(Parent) END IF end event type st_1 from statictext within w_outwaremx_p_scanqty integer x = 64 integer y = 28 integer width = 402 integer height = 184 boolean bringtotop = true integer textsize = -20 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 255 long backcolor = 67108864 string text = "扫描框" long bordercolor = 255 boolean focusrectangle = false end type type st_msg from statictext within w_outwaremx_p_scanqty integer x = 2382 integer y = 12 integer width = 1193 integer height = 184 boolean bringtotop = true integer textsize = -25 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 255 long backcolor = 67108864 long bordercolor = 255 boolean focusrectangle = false end type type sle_1 from u_sleedit within w_outwaremx_p_scanqty integer x = 489 integer y = 12 integer width = 1870 integer height = 196 integer taborder = 20 boolean bringtotop = true integer textsize = -15 end type event modified;call super::modified;//IF retrieve_all or retrmode=0 THEN //// PARENT.TRIGGEREVENT("ue_usual_query_filt") //ELSE // PARENT.TRIGGEREVENT("ue_usual_query_RETR") //END IF end event event keyup;call super::keyup;Long j String ls_Billcode Boolean lb_oo IF Key = KeyEnter! THEN // lb_oo = False sle_1.SetFocus() IF Trim(sle_1.Text) = '' THEN RETURN 1 ls_Billcode = Trim(sle_1.Text) ls_Billcode = f_pb_of_globalreplace(ls_Billcode,'~r','') ls_Billcode = f_pb_of_globalreplace(ls_Billcode,'~n','') //首先查询这个是否是条形码 如果是 找出物料编码 String ls_temp_code SELECT mtrlcode Into :ls_temp_code From u_mtrldef Where barcode = :ls_Billcode; IF Len(ls_temp_code) > 0 THEN ls_Billcode = ls_temp_code END IF //首先查询这个是否是条形码 如果是 找出物料编码 dw_1.AcceptText() FOR j = 1 To dw_1.RowCount() String lkks_temp_str lkks_temp_str = '' lkks_temp_str = '0' + String(dw_1.Object.u_mtrldef_mtrlcode[j]) IF ls_Billcode = dw_1.Object.u_mtrldef_mtrlcode[j] Or (ls_Billcode = lkks_temp_str ) THEN // IF Pos(ls_Billcode, trim(dw_1.Object.u_mtrldef_mtrlcode[j]) ) > 0 THEN lb_oo = True // messagebox('',string(dw_child.object.u_scanbillmx_scanqty[j])) IF cur_thflag = 0 THEN dw_1.Object.u_outwaremx_scanqty[j] = Long(dw_1.Object.u_outwaremx_scanqty[j]) + 1 ELSE dw_1.Object.u_outwaremx_scanqty[j] = Long(dw_1.Object.u_outwaremx_scanqty[j]) - 1 END IF dw_1.SelectRow(0,False) dw_1.SelectRow(j,True) dw_1.Object.DataWindow.VerticalScrollPosition = Long( j / Dec(dw_1.RowCount()) * Dec(dw_1.Object.DataWindow.VerticalScrollMaximum)) EXIT END IF NEXT // sle_1.Text = '' IF lb_oo = False THEN err_num = err_num + 1 st_msg.Text = '出错' + String(err_num) String lss_mtrlname,lss_mtrlmode,lss_unit,lss_mtrlsectype,lss_zxmtrlmode,lss_mtrlengname Long lkk_row Boolean lb_kk SELECT Top 1 mtrlname,mtrlmode,unit,mtrlsectype,zxmtrlmode,mtrlengname INTO : lss_mtrlname,:lss_mtrlmode,:lss_unit,:lss_mtrlsectype,:lss_zxmtrlmode,:lss_mtrlengname FROM u_mtrldef WHERE :ls_Billcode = '0' + rtrim(ltrim(mtrlcode)) OR :ls_Billcode = rtrim(ltrim(mtrlcode)); dw_2.AcceptText() lb_kk = False FOR j = 1 To dw_2.RowCount() IF Pos(ls_Billcode, dw_2.Object.u_mtrldef_mtrlcode[j] ) > 0 THEN lb_kk = True IF cur_thflag = 0 THEN dw_2.Object.u_outwaremx_scanqty[j] = Long(dw_2.Object.u_outwaremx_scanqty[j]) + 1 ELSE dw_2.Object.u_outwaremx_scanqty[j] = Long(dw_2.Object.u_outwaremx_scanqty[j]) - 1 END IF EXIT END IF NEXT IF lb_kk = False THEN lkk_row = dw_2.InsertRow(0) dw_2.Object.u_mtrldef_mtrlcode[lkk_row] = ls_Billcode dw_2.Object.u_mtrldef_mtrlname[lkk_row] = lss_mtrlname dw_2.Object.u_mtrldef_mtrlmode[lkk_row] = lss_mtrlmode dw_2.Object.u_outwaremx_unit[lkk_row] = lss_unit dw_2.Object.u_mtrldef_mtrlsectype[lkk_row] = lss_mtrlsectype dw_2.Object.u_mtrldef_zxmtrlmode[lkk_row] = lss_zxmtrlmode dw_2.Object.u_mtrldef_mtrlengname[lkk_row] = lss_mtrlengname dw_2.Object.u_outwaremx_scanqty[lkk_row] = 1 END IF END IF RETURN 1 END IF end event type cb_1 from uo_imflatbutton within w_outwaremx_p_scanqty integer x = 78 integer y = 1872 integer width = 411 integer height = 96 integer taborder = 30 boolean bringtotop = true string text = "扫描数=出仓数" integer picsize = 16 end type event clicked;call super::clicked;long i for i=1 to dw_1.rowcount() dw_1.object.u_outwaremx_scanqty[i]=dw_1.object.u_outwaremx_uqty[i] next end event type cb_err from uo_imflatbutton within w_outwaremx_p_scanqty integer x = 594 integer y = 1872 integer width = 411 integer height = 96 integer taborder = 40 boolean bringtotop = true string text = "错误列表" integer picsize = 16 end type event clicked;call super::clicked;dw_2.visible=true dw_2.x=10 dw_2.width=dw_1.width - 500 end event type dw_1 from u_dw_rbtnfilter within w_outwaremx_p_scanqty integer x = 18 integer y = 244 integer width = 3584 integer height = 1608 integer taborder = 30 boolean bringtotop = true string dataobject = "dw_outwaremx_p_scanqty" boolean vscrollbar = true boolean livescroll = false boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event clicked;call super::clicked;IF row > 0 THEN dw_1.SelectRow(0,False) dw_1.SelectRow(row,True) END IF end event type dw_2 from u_dw_rbtnfilter within w_outwaremx_p_scanqty integer x = 2235 integer y = 284 integer width = 3584 integer height = 1312 integer taborder = 40 boolean bringtotop = true boolean titlebar = true string title = "错误列表" string dataobject = "dw_outwaremx_p_scanqty" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type