$PBExportHeader$w_outware_pos.srw forward global type w_outware_pos from w_publ_base end type type dw_child from u_dw_rbtnfilter within w_outware_pos end type type st_3 from statictext within w_outware_pos end type type sle_barcode from singlelineedit within w_outware_pos end type type st_4 from statictext within w_outware_pos end type type em_qty from editmask within w_outware_pos end type type st_5 from statictext within w_outware_pos end type type em_amt from editmask within w_outware_pos end type type cb_1 from uo_imflatbutton within w_outware_pos end type type cb_js from uo_imflatbutton within w_outware_pos end type type dw_last from u_dw_rbtnfilter within w_outware_pos end type type cb_print from uo_imflatbutton within w_outware_pos end type type cbx_1 from checkbox within w_outware_pos end type type cbx_2 from checkbox within w_outware_pos end type type ln_1 from line within w_outware_pos end type type st_1 from statictext within w_outware_pos end type type st_user from statictext within w_outware_pos end type type st_6 from statictext within w_outware_pos end type type st_time from statictext within w_outware_pos end type type st_7 from statictext within w_outware_pos end type type st_billcode from statictext within w_outware_pos end type type cb_new from uo_imflatbutton within w_outware_pos end type type st_8 from statictext within w_outware_pos end type type sle_cust from singlelineedit within w_outware_pos end type type cb_2 from uo_imflatbutton within w_outware_pos end type type cbx_th from checkbox within w_outware_pos end type type dw_help from u_dw_rbtnfilter within w_outware_pos end type type ddlb_scid from uo_ddlb_scid within w_outware_pos end type type st_2 from statictext within w_outware_pos end type type ln_bar from line within w_outware_pos end type type ln_bar2 from line within w_outware_pos end type type r_bar from rectangle within w_outware_pos end type type ln_2 from line within w_outware_pos end type type ln_3 from line within w_outware_pos end type end forward global type w_outware_pos from w_publ_base integer width = 3611 integer height = 2380 string title = "零售单" boolean maxbox = true windowstate windowstate = maximized! event ue_new ( ) event insert_childrow ( ) event ue_cal ( ) event user_key ( ) event keydown pbm_keydown event ue_upone ( ) event ue_downone ( ) event ue_delone ( ) event ue_changeqty ( ) event ue_changeprice ( ) event ue_changerebate ( ) event ue_clearinput ( ) event ue_changemxdscrp ( ) event retrieve_last ( ) event ue_f8 ( ) event ue_hisbill ( ) event ue_f5 ( ) event ue_f1 ( ) event ue_f9 ( ) event ue_f6 ( ) event ue_js ( ) event ue_resize ( ) event ue_viewprint ( ) event ue_print ( ) dw_child dw_child st_3 st_3 sle_barcode sle_barcode st_4 st_4 em_qty em_qty st_5 st_5 em_amt em_amt cb_1 cb_1 cb_js cb_js dw_last dw_last cb_print cb_print cbx_1 cbx_1 cbx_2 cbx_2 ln_1 ln_1 st_1 st_1 st_user st_user st_6 st_6 st_time st_time st_7 st_7 st_billcode st_billcode cb_new cb_new st_8 st_8 sle_cust sle_cust cb_2 cb_2 cbx_th cbx_th dw_help dw_help ddlb_scid ddlb_scid st_2 st_2 ln_bar ln_bar ln_bar2 ln_bar2 r_bar r_bar ln_2 ln_2 ln_3 ln_3 end type global w_outware_pos w_outware_pos type variables uo_outware_sale uo_ware Long ins_cusid = 0 String ins_cusname = '' Boolean useuserkey = FALSE Long ins_def_storageid String ins_new_billtext = '正在建立...' //新建单时单据号码显示 long cur_scid //分店ID long cur_scid_arr[] s_custom s_cust,s_isnull_cust int cur_help = 1 end variables forward prototypes public function integer wf_add_score (long arg_cusid, decimal arg_totalamt, ref string arg_msg) public function integer wf_find_dftstorage (long arg_scid, ref long arg_storageid) end prototypes event ue_new(); String arg_msg Long ls_i IF uo_ware.newbegin(cur_scid,1,arg_msg) = 0 THEN MessageBox('提示',arg_msg,information!,ok!) RETURN END IF dw_edit_mode = NOT dw_edit_mode dw_child.Reset() sle_barcode.SetFocus() st_billcode.Text = ins_new_billtext st_2.Text = '' sle_cust.text = '' s_cust = s_isnull_cust THIS.TriggerEvent('retrieve_last') end event event insert_childrow();Long li_row li_row = dw_child.InsertRow(0) dw_child.ScrollToRow(li_row) end event event ue_cal();IF dw_child.RowCount() = 0 THEN em_qty.Text = '0' em_amt.Text = '0' ELSE em_qty.Text = String(dw_child.Object.compute_qty[1],'#,##0.00##') em_amt.Text = String(dw_child.Object.compute_amt[1],'#,##0.00##') END IF end event event user_key();IF wf_find_dftstorage(cur_scid,ins_def_storageid) = 0 THEN MessageBox('提示','查询分部的默认零售仓库失败!',information!,ok!) return END IF IF KeyDown(KeyInsert!) THEN THIS.PostEvent('ue_new') RETURN ELSEIF KeyDown(KeyUpArrow!) THEN THIS.PostEvent('ue_upone') RETURN ELSEIF KeyDown(KeyDownArrow!) THEN THIS.PostEvent('ue_downone') RETURN ELSEIF KeyDown(KeyDelete!) THEN THIS.PostEvent('ue_delone') RETURN ELSEIF KeyDown(KeyRightArrow!) THEN THIS.PostEvent('ue_changeqty') RETURN ELSEIF KeyDown(KeyLeftArrow!) THEN THIS.PostEvent('ue_changeprice') RETURN ELSEIF KeyDown(KeySlash!) OR KeyDown(KeyDivide!) THEN THIS.PostEvent('ue_changerebate') RETURN ELSEIF KeyDown(KeyControl!) AND KeyDown(KeyM!) THEN THIS.PostEvent('ue_changemxdscrp') RETURN ELSEIF KeyDown(KeyEnd!) THEN cb_js.TriggerEvent(Clicked!) RETURN ELSEIF KeyDown(KeyF8!) THEN THIS.TriggerEvent('ue_f8') RETURN ELSEIF KeyDown(KeyF9!) THEN THIS.TriggerEvent('ue_f9') RETURN ELSEIF KeyDown(KeyF6!) THEN THIS.TriggerEvent('ue_f6') RETURN ELSEIF KeyDown(KeyF5!) THEN THIS.TriggerEvent('ue_f5') RETURN ELSEIF KeyDown(KeyF4!) THEN THIS.TriggerEvent('ue_viewprint') RETURN ELSEIF KeyDown(KeyF1!) THEN THIS.TriggerEvent('ue_f1') RETURN ELSEIF KeyDown(KeyPageUp!) THEN THIS.TriggerEvent('ue_hisbill') RETURN ELSEIF KeyDown(KeyEscape!) THEN IF MessageBox('询问','是否要关闭当前窗口?',question!,yesno!) <> 1 THEN RETURN Close(THIS) RETURN END IF end event event keydown;this.triggerevent('user_key') end event event ue_upone();if dw_child.rowcount() = 0 then return end if if dw_child.getrow() = 0 then dw_child.scrolltorow(1) return else long child_row child_row = dw_child.getrow() if child_row <> 1 then child_row = child_row - 1 dw_child.scrolltorow(child_row) dw_child.selectrow( 0, false) dw_child.selectrow( child_row, true) return end if end if end event event ue_downone();IF dw_child.RowCount() = 0 THEN RETURN END IF IF dw_child.GetRow() = 0 THEN dw_child.ScrollToRow(1) RETURN ELSE Long child_row child_row = dw_child.GetRow() IF child_row <> dw_child.RowCount() THEN child_row = child_row + 1 dw_child.ScrollToRow(child_row) dw_child.SelectRow( 0, FALSE) dw_child.SelectRow( dw_child.GetRow(), TRUE) RETURN END IF END IF end event event ue_delone();IF dw_child.RowCount() = 0 THEN OpenWithParm(w_pos_msg,'无数据可删除!') RETURN END IF Long child_row child_row = dw_child.GetRow() IF child_row <= 0 THEN OpenWithParm(w_pos_msg,'请选择要删除的行!') RETURN END IF IF MessageBox('询问','是否要删除第'+String(child_row)+'行?',question!,yesno!) = 2 THEN RETURN dw_child.DeleteRow(child_row) IF dw_child.RowCount() > 0 THEN child_row = child_row - 1 IF child_row = 0 THEN child_row = 1 dw_child.ScrollToRow(child_row) dw_child.SelectRow( 0, FALSE) dw_child.SelectRow( child_row, TRUE) END IF THIS.TriggerEvent('ue_cal') end event event ue_changeqty();//修改数量 Long child_row child_row = dw_child.GetRow() IF child_row = 0 THEN RETURN dw_child.AcceptText() Long ls_printid String ls_mtrlname Dec ls_qty ls_printid = dw_child.Object.print_id[child_row] ls_mtrlname = dw_child.Object.u_mtrldef_mtrlname[child_row] ls_qty = dw_child.Object.u_outwaremx_qty[child_row] s_pos_qty_tran s_qty_tran s_qty_tran.mtrlname = ls_mtrlname s_qty_tran.pid = ls_printid s_qty_tran.preqty = ls_qty OpenWithParm(w_outware_pos_qty,s_qty_tran) s_qty_tran = Message.PowerObjectParm IF s_qty_tran.if_ok = 0 THEN RETURN dw_child.Object.u_outwaremx_qty[child_row] = s_qty_tran.newqty end event event ue_changeprice();//修改数量 Long child_row child_row = dw_child.GetRow() IF child_row = 0 THEN RETURN dw_child.AcceptText() Long ls_printid String ls_mtrlname Dec ls_price ls_printid = dw_child.Object.print_id[child_row] ls_mtrlname = dw_child.Object.u_mtrldef_mtrlname[child_row] ls_price = dw_child.Object.u_outwaremx_fprice[child_row] s_pos_price_tran s_price_tran s_price_tran.mtrlname = ls_mtrlname s_price_tran.pid = ls_printid s_price_tran.preprice = ls_price OpenWithParm(w_outware_pos_price,s_price_tran) s_price_tran = Message.PowerObjectParm IF s_price_tran.if_ok = 0 THEN RETURN dw_child.Object.u_outwaremx_fprice[child_row] = s_price_tran.newprice end event event ue_changerebate();//修改数量 Long child_row child_row = dw_child.GetRow() IF child_row = 0 THEN RETURN dw_child.AcceptText() Long ls_printid String ls_mtrlname Dec ls_rebate ls_printid = dw_child.Object.print_id[child_row] ls_mtrlname = dw_child.Object.u_mtrldef_mtrlname[child_row] ls_rebate = dw_child.Object.u_outwaremx_rebate[child_row] s_pos_rebate_tran s_rebate_tran s_rebate_tran.mtrlname = ls_mtrlname s_rebate_tran.pid = ls_printid s_rebate_tran.prerebate = ls_rebate IF f_power_ind(1293) THEN MessageBox('提示','你没有使用权限!', Information!, OK! ) RETURN END IF OpenWithParm(w_outware_pos_rebate,s_rebate_tran) s_rebate_tran = Message.PowerObjectParm IF Pos(sle_barcode.Text,'/') > 0 THEN sle_barcode.Text = '' END IF IF s_rebate_tran.if_ok = 0 THEN RETURN dw_child.Object.u_outwaremx_rebate[child_row] = s_rebate_tran.newrebate end event event ue_clearinput();IF Pos(sle_barcode.Text,'/') > 0 THEN sle_barcode.Text = '' END IF end event event ue_changemxdscrp();//修改数量 Long child_row child_row = dw_child.GetRow() IF child_row = 0 THEN RETURN dw_child.AcceptText() Long ls_printid String ls_mtrlname String ls_mxdscrp ls_printid = dw_child.Object.print_id[child_row] ls_mtrlname = dw_child.Object.u_mtrldef_mtrlname[child_row] ls_mxdscrp = dw_child.Object.u_outwaremx_mxdscrp[child_row] s_pos_mxdscrp_tran s_dscrp_tran s_dscrp_tran.mtrlname = ls_mtrlname s_dscrp_tran.pid = ls_printid s_dscrp_tran.predscrp = ls_mxdscrp OpenWithParm(w_outware_pos_mxdscrp,s_dscrp_tran) s_dscrp_tran = Message.PowerObjectParm IF Upper(Left(sle_barcode.Text,1)) = 'M' THEN sle_barcode.Text = '' END IF IF s_dscrp_tran.if_ok = 0 THEN RETURN dw_child.Object.u_outwaremx_mxdscrp[child_row] = s_dscrp_tran.newdscrp end event event retrieve_last();dw_last.Retrieve(publ_operator) IF dw_last.RowCount() = 0 THEN dw_last.InsertRow(0) END IF end event event ue_f8();Openwithparm(w_outware_pos_findmtrl,ins_def_storageid) s_pos_mtrl s_rt s_rt = Message.PowerObjectParm IF isnull(s_rt.if_ok) or s_rt.if_ok = 0 THEN RETURN sle_barcode.Text = s_rt.mtrlcode cb_1.TriggerEvent(Clicked!) end event event ue_hisbill();//取单据 openwithparm(w_outware_pos_hisbill,cur_scid) s_pos_hisbill s_rt s_rt = message.powerobjectparm if s_rt.if_ok = 0 then return long ls_scid,ls_outwareid ls_scid = s_rt.scid ls_outwareid = s_rt.outwareid if dw_child.rowcount() > 0 then if messagebox('询问','发现已存在明细数据,是否要清除当前并打开单据?',question!,yesno!)=2 then return end if sle_barcode.text = '' string arg_msg IF uo_ware.getinfo(ls_scid,ls_outwareid,arg_msg) = 0 THEN openwithparm(w_pos_msg,arg_msg) RETURN END IF st_billcode.text = uo_ware.outwarecode long ls_i dw_child.retrieve(ls_scid,ls_outwareid) this.triggerevent('ue_cal') end event event ue_f5();if st_billcode.text = ins_new_billtext then messagebox('提示','正在建立单据不能打印!',information!,ok!) return end if cb_print.triggerevent(clicked!) end event event ue_f1();cur_help = 1 - cur_help IF cur_help = 1 THEN dw_help.Visible = TRUE dw_child.X = dw_help.Width + 5 dw_child.Width = THIS.WorkSpaceWidth() - dw_help.Width - 5 ELSE dw_child.X = 0 dw_child.Width = THIS.WorkSpaceWidth() dw_help.Visible = FALSE END IF end event event ue_f9();//高级商品查询 Long child_row Long ls_sptid Long ll_storageid Decimal ls_price,ls_rebate IF NOT IsValid(W_mtrldef_edit) THEN s_edit_index_tran s_tranf8 //传递参数使用 s_tranf8.if_retrieve_all = FALSE //是否一次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 //选采购 s_tranf8.c_long = ll_storageid Long chc = 1,ls_j IF dw_child.GetRow() > 0 THEN s_tranf8.arg_string_code = Trim(dw_child.Object.u_mtrldef_mtrlcode[dw_child.GetRow()]) OpenWithParm(W_mtrldef_edit,s_tranf8) //调用 s_mtrldef_array S_INSCUST S_INSCUST = Message.PowerObjectParm //接受返回结构 FOR ls_j = 1 TO UpperBound(S_INSCUST.mtrlid) IF S_INSCUST.mtrlid[ls_j] > 0 THEN //正常返回值则可以取以下值 sle_barcode.text = S_INSCUST.mtrlcode[ls_j] cb_1.triggerevent(clicked!) END IF NEXT END IF end event event ue_f6(); IF NOT IsValid(W_cust_edit) THEN s_edit_index_tran s_ch_tran //传递参数使用 s_ch_tran.if_retrieve_all = FALSE //是否一次RETRIEVE所有行 s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式 s_ch_tran.arg_pkid = 0 //目标定位PKID (备用) //查询列(物料编码)部分内容,用于初步筛选 s_ch_tran.arg_string_code = Upper(Trim(sle_cust.Text)) OpenWithParm(W_cust_edit,s_ch_tran) //调用 s_custom S_INSCUST S_INSCUST = Message.PowerObjectParm //接受返回结构 IF S_INSCUST.cusid > 0 THEN //正常返回值则可以取以下值 s_cust = S_INSCUST sle_cust.Text = s_cust.cuscode st_2.text = s_cust.name END IF END IF sle_barcode.SetFocus() end event event ue_js();IF dw_child.RowCount() = 0 THEN sle_barcode.Text = '' OpenWithParm(w_pos_msg,'请先输入明细内容!') RETURN END IF Long ll_printid,i,j String arg_msg Boolean ls_mod_flag = FALSE THIS.TriggerEvent('ue_cal') Decimal ls_totalamt ls_totalamt = dw_child.Object.compute_amt[1] OpenWithParm(w_outware_pos_js,ls_totalamt) s_pos_bank s_rt s_rt = Message.PowerObjectParm IF s_rt.if_ok = 0 THEN RETURN //如果是修改单顺序财撤->仓撤->修改 IF uo_ware.outwareid > 0 THEN IF uo_ware.getinfo(cur_scid,uo_ware.outwareid,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) sle_barcode.Text = '' sle_barcode.SetFocus() RETURN END IF IF uo_ware.secflag = 1 THEN IF uo_ware.c_secauditing(FALSE,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF END IF IF uo_ware.flag = 1 THEN IF uo_ware.c_auditing(FALSE,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF END IF IF uo_ware.updatebegin(cur_scid,uo_ware.outwareid,1,arg_msg) = 0 THEN ROLLBACK; MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF ELSE IF uo_ware.newbegin(cur_scid,1,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF uo_ware.outdate = DateTime(Today(),Now()) uo_ware.outrep = st_user.Text uo_ware.part = '' uo_ware.dscrp = '' IF s_cust.cusid = 0 THEN uo_ware.cusid = ins_cusid ELSE uo_ware.cusid = s_cust.cusid END IF IF cbx_th.Checked THEN uo_ware.thflag = 1 ELSE uo_ware.thflag = 0 END IF END IF s_outwaremx s_mx Long ll_banktypeid SELECT top 1 banktypeid INTO :ll_banktypeid FROM cw_banktype Where banktype = 0 AND btype = 1 AND inuse = 1; IF sqlca.SQLCode <> 0 THEN MessageBox('错误','查询结算方式失败',stopsign!,ok!) RETURN END IF Long ll_moneyid SELECT moneyid INTO :ll_moneyid FROM cw_currency Where native = 1; IF sqlca.SQLCode <> 0 THEN MessageBox('错误','查询本位币失败',stopsign!,ok!) RETURN END IF uo_ware.storageid = ins_def_storageid uo_ware.totalamt = ls_totalamt uo_ware.getamt = s_rt.getamt uo_ware.lsflag = 1 uo_ware.mrate = 1 uo_ware.relint_1 = ll_banktypeid uo_ware.relint_2 = ll_moneyid dw_child.AcceptText() FOR i = 1 TO dw_child.RowCount() IF dw_child.Object.u_outwaremx_mtrlwareid[i] > 0 THEN ll_printid = dw_child.Object.print_id[i] s_mx.mtrlwareid = dw_child.Object.u_outwaremx_mtrlwareid[i] s_mx.qty = dw_child.Object.u_outwaremx_qty[i] s_mx.addqty = 0 s_mx.fprice = dw_child.Object.u_outwaremx_fprice[i] s_mx.rebate = dw_child.Object.u_outwaremx_rebate[i] s_mx.mxdscrp = dw_child.Object.u_outwaremx_mxdscrp[i] s_mx.printid = ll_printid s_mx.ifrel = 0 s_mx.relid = 0 s_mx.relprintid = 0 s_mx.relid2 = 0 s_mx.olmtrlid = 0 s_mx.packqty = 0 s_mx.outtype = 0 s_mx.unit = dw_child.Object.u_mtrldef_unit[i] s_mx.rate = 1 s_mx.mtrlcuscode = '' s_mx.formula = '' s_mx.mxdscrp2 = '' IF uo_ware.acceptmx(s_mx, arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) sle_barcode.Text = '' sle_barcode.SetFocus() RETURN END IF // IF uo_ware.acceptmx(dw_child.Object.u_outwaremx_mtrlwareid[i],& // dw_child.Object.u_outwaremx_qty[i],0,& // dw_child.Object.u_outwaremx_fprice[i],& // dw_child.Object.u_outwaremx_rebate[i],& // dw_child.Object.u_outwaremx_mxdscrp[i],& // ll_printid,& // arg_msg,0,0,0,0,0,& // dw_child.Object.u_mtrldef_unit[i],& // 1,& // '','') = 0 THEN // MessageBox('错误',arg_msg,stopsign!,ok!) // sle_barcode.Text = '' // sle_barcode.SetFocus() // RETURN // END IF END IF NEXT IF uo_ware.Save(FALSE,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) sle_barcode.Text = '' sle_barcode.SetFocus() RETURN END IF IF uo_ware.getinfo(cur_scid,uo_ware.outwareid,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) sle_barcode.Text = '' sle_barcode.SetFocus() RETURN END IF IF uo_ware.auditing(TRUE,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) sle_barcode.Text = '' sle_barcode.SetFocus() RETURN END IF IF uo_ware.getinfo(cur_scid,uo_ware.outwareid,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) sle_barcode.Text = '' sle_barcode.SetFocus() RETURN END IF IF uo_ware.secauditing(TRUE,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) sle_barcode.Text = '' sle_barcode.SetFocus() RETURN END IF ///加积分 IF s_cust.cusid > 0 AND uo_ware.thflag = 0 THEN IF wf_add_score(s_cust.cusid,ls_totalamt,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF END IF st_billcode.Text = uo_ware.outwarecode OpenWithParm(w_pos_zl,'找回:'+String(s_rt.backamt,'#,##0.00')) dw_edit_mode = NOT dw_edit_mode end event event ue_viewprint();String ls_dft_old_dwname, ls_dft_new_dwname,ls_chnname,ls_dwtype Long ls_dwprintid String ls_windowname Int ls_i Long ll_billid Int li_ifuse Long ll_row String Name,ll_rpname Long ll_RpID,ll_flag,ll_ifuse w_curwin = this ls_windowname = this.ClassName ( ) IF NOT f_power_ind(851) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF s_print_msg ls_prmsg IF dw_child.RowCount() = 0 THEN MessageBox('提示','没有可打印的单据!',information!,ok!) RETURN END IF SELECT top 1 dwprintid, dft_old_dwname, dft_new_dwname, chnname, dwtype INTO :ls_dwprintid, :ls_dft_old_dwname, :ls_dft_new_dwname, :ls_chnname, :ls_dwtype FROM sys_dft_dwprint_dynamic WHERE dwtype = :ls_windowname AND ptype = 1 AND ifuse = 1; IF sqlca.SQLCode <> 0 THEN LS_PRMSG.obj_dwNAME = 'dw_rp_outware_sale_edit_ls' ELSE datastore temp_dw temp_dw = CREATE datastore temp_dw.SetTransObject (sqlca) temp_dw.DataObject = ls_dft_new_dwname //判断DW是否存在 IF temp_dw.Describe("DataWindow.Objects") = "" THEN LS_PRMSG.obj_dwNAME = 'dw_rp_outware_sale_edit_ls' ELSE LS_PRMSG.obj_dwNAME = ls_dft_new_dwname END IF END IF ls_prmsg.retr_pram_falg = 15 ls_prmsg.tag_text = '小票' ls_prmsg.filter_string = '' ls_prmsg.pagech_flag = 0 ls_prmsg.retr_scid = cur_scid ls_prmsg.retr_pramnmb = uo_ware.outwareid ls_prmsg.rowcnt = dw_child.RowCount() OpenWithParm(w_publ_preview,ls_prmsg) //**更新打印次料 String arg_msg printnum = Message.DoubleParm //f_update_printnum('u_outware',printnum,uo_ware.outwareid,arg_msg,TRUE) f_update_printnum('u_outware',1,cur_scid,uo_ware.outwareid,'','',arg_msg,TRUE) end event event ue_print();String ls_dft_old_dwname, ls_dft_new_dwname,ls_chnname,ls_dwtype Long ls_dwprintid String ls_windowname Int ls_i Long ll_billid Int li_ifuse Long ll_row String Name,ll_rpname Long ll_RpID,ll_flag,ll_ifuse w_curwin = this ls_windowname = this.ClassName ( ) //--直接打印 IF NOT f_power_ind(851) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF uo_print_preview uo_print S_print_MSG LS_PRMSG IF dw_child.RowCount() = 0 THEN MessageBox('提示','没有可打印的单据!',information!,ok!) RETURN END IF SELECT top 1 dwprintid, dft_old_dwname, dft_new_dwname, chnname, dwtype INTO :ls_dwprintid, :ls_dft_old_dwname, :ls_dft_new_dwname, :ls_chnname, :ls_dwtype FROM sys_dft_dwprint_dynamic WHERE dwtype = :ls_windowname AND ptype = 1 AND ifuse = 1; IF sqlca.SQLCode <> 0 THEN LS_PRMSG.obj_dwNAME = 'dw_rp_outware_sale_edit_ls' ELSE datastore temp_dw temp_dw = CREATE datastore temp_dw.SetTransObject (sqlca) temp_dw.DataObject = ls_dft_new_dwname //判断DW是否存在 IF temp_dw.Describe("DataWindow.Objects") = "" THEN LS_PRMSG.obj_dwNAME = 'dw_rp_outware_sale_edit_ls' ELSE LS_PRMSG.obj_dwNAME = ls_dft_new_dwname END IF END IF if uo_ware.outwareid = 0 then return LS_PRMSG.retr_pram_falg = 15 LS_PRMSG.TAG_TEXT = '小票' LS_PRMSG.FILTER_STRING = '' LS_PRMSG.PAGECH_FLAG = 0 LS_PRMSG.retr_scid = cur_scid LS_PRMSG.retr_pramnmb = uo_ware.outwareid LS_PRMSG.rowcnt = dw_child.RowCount() uo_print.FACT_PRINT_MSG = LS_PRMSG String arg_msg IF uo_print.uof_print_begin(arg_msg) = 0 THEN MessageBox("提示",arg_msg,information!,ok!) RETURN END IF uo_print.ds_print() //**更新打印次料 f_update_printnum('u_outware',1,cur_scid,uo_ware.outwareid,'','',arg_msg,TRUE) end event public function integer wf_add_score (long arg_cusid, decimal arg_totalamt, ref string arg_msg);Int rslt = 1 Decimal ld_score ld_score = 0 SELECT u_cust_member.scoretype * :arg_totalamt INTO :ld_score FROM u_cust_member,u_cust WHERE u_cust_member.memberid = u_cust.memberid AND u_cust.cusid = :arg_cusid AND u_cust.lsflag = 0 ; IF sqlca.SQLCode <> 0 THEN arg_msg = '更新客户积分失败' rslt = 0 GOTO ext END IF uo_custdef uo_cust uo_cust = CREATE uo_custdef uo_cust.commit_transaction = sqlca IF uo_cust.uof_cust_score(arg_cusid,ld_score,arg_msg,TRUE) = 0 THEN rslt = 0 GOTO ext END IF ext: RETURN rslt end function public function integer wf_find_dftstorage (long arg_scid, ref long arg_storageid);Int rslt = 1 Int ls_storageid SELECT top 1 u_storage.storageid INTO :arg_storageid FROM u_storage Where u_storage.lsflag = 1 and u_storage.scid = :arg_scid; IF sqlca.SQLCode <> 0 THEN rslt = 0 GOTO ext ELSEIF sqlca.SQLNRows = 0 THEN rslt = 0 GOTO ext END IF ext: RETURN rslt end function on w_outware_pos.create int iCurrent call super::create this.dw_child=create dw_child this.st_3=create st_3 this.sle_barcode=create sle_barcode this.st_4=create st_4 this.em_qty=create em_qty this.st_5=create st_5 this.em_amt=create em_amt this.cb_1=create cb_1 this.cb_js=create cb_js this.dw_last=create dw_last this.cb_print=create cb_print this.cbx_1=create cbx_1 this.cbx_2=create cbx_2 this.ln_1=create ln_1 this.st_1=create st_1 this.st_user=create st_user this.st_6=create st_6 this.st_time=create st_time this.st_7=create st_7 this.st_billcode=create st_billcode this.cb_new=create cb_new this.st_8=create st_8 this.sle_cust=create sle_cust this.cb_2=create cb_2 this.cbx_th=create cbx_th this.dw_help=create dw_help this.ddlb_scid=create ddlb_scid this.st_2=create st_2 this.ln_bar=create ln_bar this.ln_bar2=create ln_bar2 this.r_bar=create r_bar this.ln_2=create ln_2 this.ln_3=create ln_3 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.dw_child this.Control[iCurrent+2]=this.st_3 this.Control[iCurrent+3]=this.sle_barcode this.Control[iCurrent+4]=this.st_4 this.Control[iCurrent+5]=this.em_qty this.Control[iCurrent+6]=this.st_5 this.Control[iCurrent+7]=this.em_amt this.Control[iCurrent+8]=this.cb_1 this.Control[iCurrent+9]=this.cb_js this.Control[iCurrent+10]=this.dw_last this.Control[iCurrent+11]=this.cb_print this.Control[iCurrent+12]=this.cbx_1 this.Control[iCurrent+13]=this.cbx_2 this.Control[iCurrent+14]=this.ln_1 this.Control[iCurrent+15]=this.st_1 this.Control[iCurrent+16]=this.st_user this.Control[iCurrent+17]=this.st_6 this.Control[iCurrent+18]=this.st_time this.Control[iCurrent+19]=this.st_7 this.Control[iCurrent+20]=this.st_billcode this.Control[iCurrent+21]=this.cb_new this.Control[iCurrent+22]=this.st_8 this.Control[iCurrent+23]=this.sle_cust this.Control[iCurrent+24]=this.cb_2 this.Control[iCurrent+25]=this.cbx_th this.Control[iCurrent+26]=this.dw_help this.Control[iCurrent+27]=this.ddlb_scid this.Control[iCurrent+28]=this.st_2 this.Control[iCurrent+29]=this.ln_bar this.Control[iCurrent+30]=this.ln_bar2 this.Control[iCurrent+31]=this.r_bar this.Control[iCurrent+32]=this.ln_2 this.Control[iCurrent+33]=this.ln_3 end on on w_outware_pos.destroy call super::destroy destroy(this.dw_child) destroy(this.st_3) destroy(this.sle_barcode) destroy(this.st_4) destroy(this.em_qty) destroy(this.st_5) destroy(this.em_amt) destroy(this.cb_1) destroy(this.cb_js) destroy(this.dw_last) destroy(this.cb_print) destroy(this.cbx_1) destroy(this.cbx_2) destroy(this.ln_1) destroy(this.st_1) destroy(this.st_user) destroy(this.st_6) destroy(this.st_time) destroy(this.st_7) destroy(this.st_billcode) destroy(this.cb_new) destroy(this.st_8) destroy(this.sle_cust) destroy(this.cb_2) destroy(this.cbx_th) destroy(this.dw_help) destroy(this.ddlb_scid) destroy(this.st_2) destroy(this.ln_bar) destroy(this.ln_bar2) destroy(this.r_bar) destroy(this.ln_2) destroy(this.ln_3) end on event resize;call super::resize;ln_bar.EndX = THIS.Width ln_bar2.EndX = THIS.Width ln_1.EndX = THIS.Width ln_2.EndX = THIS.Width r_bar.Width = THIS.Width ln_3.EndX = THIS.Width Long w_width,w_height w_width = 3602 w_height = 2300 IF newwidth < w_width THEN THIS.Width = w_width IF newheight < w_height THEN THIS.Height = w_height dw_child.x = 0 dw_child.Width = THIS.WorkSpaceWidth() dw_child.Height = THIS.WorkSpaceHeight() - 570 dw_help.Height = THIS.WorkSpaceHeight() - 570 dw_help.visible = false st_4.Y = THIS.WorkSpaceHeight() - st_4.Height - 50 em_qty.Y = st_4.Y st_5.Y = st_4.Y em_amt.Y = st_4.Y ln_1.BeginY = st_4.Y - 5 ln_1.EndY = st_4.Y - 5 IF cur_help = 1 THEN dw_help.Visible = TRUE dw_child.X = dw_help.Width + 5 dw_child.Width = THIS.WorkSpaceWidth() - dw_help.Width - 5 ELSE dw_child.X = 0 dw_child.Width = THIS.WorkSpaceWidth() dw_help.Visible = FALSE END IF end event event open;call super::open;cur_help = long(f_ProfileString (sys_empid, "outware_pos", "help", "1")) st_user.Text = publ_operator dw_child.SetTransObject(sqlca) dw_last.SetTransObject(sqlca) uo_ware = CREATE uo_outware_sale uo_ware.commit_transaction = sqlca sle_barcode.SetFocus() SELECT cusid,name INTO :ins_cusid,:ins_cusname FROM u_cust Where u_cust.lsflag = 1; IF sqlca.SQLCode <> 0 THEN MessageBox('错误','查询零售客户信息失败',stopsign!,ok!) END IF THIS.TriggerEvent('ue_new') st_time.Text = String(DateTime(Today(),Now())) Timer(1) end event event timer;call super::timer;st_time.text = string(datetime(today(),now())) end event event close;call super::close;f_SetProfileString (sys_empid, "outware_pos", "help", string(cur_help)) end event type cb_func from w_publ_base`cb_func within w_outware_pos boolean visible = false integer x = 3186 end type type cb_exit from w_publ_base`cb_exit within w_outware_pos integer x = 686 integer width = 165 integer height = 164 integer taborder = 70 boolean cancel = false integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type dw_child from u_dw_rbtnfilter within w_outware_pos integer x = 617 integer y = 436 integer width = 2862 integer height = 1412 integer taborder = 0 boolean bringtotop = true string dataobject = "dw_outwaremx_pos_edit" boolean hscrollbar = true boolean vscrollbar = true end type event clicked;call super::clicked;IF row > 0 THEN THIS.ScrollToRow(row) THIS.SelectRow(0, FALSE) THIS.SelectRow(row, TRUE) END IF end event event dwnkey;call super::dwnkey;PARENT.TriggerEvent('user_key') end event event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN THIS.ScrollToRow(currentrow) THIS.SelectRow(0, FALSE) THIS.SelectRow(currentrow, TRUE) END IF end event type st_3 from statictext within w_outware_pos integer x = 9 integer y = 224 integer width = 288 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 sle_barcode from singlelineedit within w_outware_pos event keydown pbm_keydown event keyup pbm_keyup integer x = 265 integer y = 204 integer width = 713 integer height = 84 integer taborder = 10 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type event keydown;//if keydown(KeySlash!) or keydown(KeyDivide!) then parent.postevent('ue_clearinput') //end if end event event keyup;parent.triggerevent('user_key') end event event modified;dw_child.selectrow( 0, false) cb_1.triggerevent(clicked!) end event type st_4 from statictext within w_outware_pos integer y = 1900 integer width = 421 integer height = 76 boolean bringtotop = true integer textsize = -12 integer weight = 700 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16776960 string text = "总数量:" boolean focusrectangle = false end type type em_qty from editmask within w_outware_pos integer x = 439 integer y = 1900 integer width = 667 integer height = 76 boolean bringtotop = true integer textsize = -12 integer weight = 700 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16776960 string text = "none" boolean border = false borderstyle borderstyle = stylelowered! string mask = "#,##0.00##" end type type st_5 from statictext within w_outware_pos integer x = 1458 integer y = 1900 integer width = 457 integer height = 76 boolean bringtotop = true integer textsize = -12 integer weight = 700 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16776960 string text = "总金额:" boolean focusrectangle = false end type type em_amt from editmask within w_outware_pos integer x = 1929 integer y = 1900 integer width = 667 integer height = 76 boolean bringtotop = true integer textsize = -12 integer weight = 700 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16776960 string text = "0.00" boolean border = false borderstyle borderstyle = stylelowered! string mask = "#,##0.00##" end type type cb_1 from uo_imflatbutton within w_outware_pos integer x = 997 integer y = 204 integer width = 306 integer height = 84 boolean bringtotop = true string text = "确定ENT" string normalpicname = "ok.bmp" integer picsize = 16 end type event clicked;call super::clicked;IF KeyDown(KeySlash!) OR KeyDown(KeyDivide!) THEN sle_barcode.Text = '' END IF IF sle_barcode.Text = '' THEN RETURN IF sys_option_pos_jsbarcode <> '' THEN IF Trim(sle_barcode.Text) = sys_option_pos_jsbarcode THEN cb_js.TriggerEvent(Clicked!) RETURN END IF END IF String ls_barcode String ls_mtrlcode,ls_mtrlname,ls_unit,ls_mtrlmode String ls_prdpackcode Long ls_mtrlwareid,ls_mtrlid,ls_storageid Decimal ls_noallocqty,ls_packqty Decimal ls_price,ls_rebate s_mtrlware_noalloc_array arg_s_mtrlware s_mtrldef_array arg_s_mtrldef ls_barcode = Trim(sle_barcode.Text) ls_storageid = ins_def_storageid IF ls_storageid <= 0 THEN OpenWithParm(w_pos_msg,'请先选择仓库!') RETURN END IF IF f_find_mtrl(ls_barcode,-1,arg_s_mtrldef) = 0 THEN sle_barcode.Text = '' OpenWithParm(w_pos_msg,'查无此商品记录!') sle_barcode.SetFocus() RETURN ELSE ls_barcode = arg_s_mtrldef.mtrlcode[1] END IF IF f_find_mtrlware_ls(ls_barcode,ls_storageid,-1,arg_s_mtrlware) = 0 THEN OpenWithParm(w_pos_msg,'查询库存失败!') sle_barcode.Text = '' sle_barcode.SetFocus() RETURN ELSE ls_mtrlwareid = arg_s_mtrlware.mtrlwareid[1] ls_mtrlid = arg_s_mtrlware.mtrlid[1] ls_mtrlcode = arg_s_mtrlware.u_mtrldef_mtrlcode[1] ls_mtrlname = arg_s_mtrlware.u_mtrldef_mtrlname[1] ls_unit = arg_s_mtrlware.u_mtrldef_unit[1] ls_mtrlmode = arg_s_mtrlware.u_mtrldef_mtrlmode[1] ls_noallocqty = arg_s_mtrlware.noallocqty[1] //是否会员销售自动带出会员对应价格表价,否则带出零售价(默认标准价格表价) //ls_price = arg_s_mtrlware.lmsaleprice[1] Dec arg_price,arg_rebate arg_price = 0 IF f_find_cust_dftprice(s_cust.pricelistid,ls_mtrlid,arg_price,arg_rebate) = 0 THEN IF f_find_mtrl_dftprice(ls_mtrlid,arg_price,arg_rebate) = 0 THEN OpenWithParm(w_pos_msg,'查询默认标准价格表价失败!') RETURN END IF END IF ls_price = arg_price ls_rebate = arg_rebate ls_packqty = arg_s_mtrlware.u_mtrldef_packqty[1] ls_prdpackcode = arg_s_mtrlware.u_mtrldef_prdpackcode[1] END IF IF not cbx_th.checked and ls_noallocqty = 0 THEN OpenWithParm(w_pos_msg,'库存不足!') sle_barcode.Text = '' sle_barcode.SetFocus() RETURN END IF Long child_row child_row = dw_child.InsertRow(0) dw_child.ScrollToRow(child_row) dw_child.Object.u_outwaremx_mtrlwareid[child_row] = ls_mtrlwareid dw_child.Object.u_outwaremx_mtrlid[child_row] = ls_mtrlid dw_child.Object.u_mtrldef_mtrlname[child_row] = ls_mtrlname dw_child.Object.u_mtrldef_mtrlmode[child_row] = ls_mtrlmode dw_child.Object.u_mtrldef_unit[child_row] = ls_unit IF cbx_th.Checked THEN dw_child.Object.u_outwaremx_qty[child_row] = - 1 ELSE dw_child.Object.u_outwaremx_qty[child_row] = 1 END IF dw_child.Object.u_outwaremx_fprice[child_row] = ls_price dw_child.Object.u_outwaremx_rebate[child_row] = ls_rebate dw_child.Object.u_mtrldef_mtrlcode[child_row] = ls_mtrlcode dw_child.Object.u_mtrldef_packqty[child_row] = ls_packqty dw_child.Object.u_mtrldef_prdpackcode[child_row] = ls_prdpackcode dw_child.Object.u_mtrldef_barcode[child_row] = ls_barcode PARENT.TriggerEvent('ue_cal') sle_barcode.Text = '' sle_barcode.SetFocus() end event event ue_keydown;call super::ue_keydown;parent.triggerevent('user_key') end event type cb_js from uo_imflatbutton within w_outware_pos integer x = 247 integer width = 247 integer height = 164 integer taborder = 40 boolean bringtotop = true string text = "结算End" string normalpicname = "SAVE.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked; PARENT.TriggerEvent('ue_js') IF cbx_2.Checked = TRUE THEN parent.TriggerEvent('ue_print') ELSE IF MessageBox('询问','是否要打印当前单据?',question!,yesno!) = 2 THEN RETURN PARENT.TriggerEvent('ue_new') END IF IF cbx_1.Checked = TRUE THEN PARENT.TriggerEvent('ue_new') END IF end event event ue_keydown;call super::ue_keydown;parent.triggerevent('user_key') end event type dw_last from u_dw_rbtnfilter within w_outware_pos integer y = 312 integer width = 2743 integer height = 124 integer taborder = 0 boolean bringtotop = true string dataobject = "dw_outware_pos_lastbill" boolean border = false boolean setcolumn_visible_use = false boolean autosave_filter_use = false boolean autosave_sort_use = false boolean autosave_setlayout_use = false boolean autosave_columnvisible_use = false end type type cb_print from uo_imflatbutton within w_outware_pos integer x = 494 integer width = 192 integer height = 164 integer taborder = 60 boolean bringtotop = true string text = "打印&P" string normalpicname = "print.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event ue_keydown;call super::ue_keydown;parent.triggerevent('user_key') end event event clicked;call super::clicked;parent.PostEvent('ue_print') end event type cbx_1 from checkbox within w_outware_pos integer x = 933 integer y = 16 integer width = 343 integer height = 48 integer taborder = 80 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;string ls_flag if this.checked=true then ls_flag = '1' else ls_flag = '0' end if f_SetProfileString (sys_empid,'pos','autonew',ls_flag) end event event constructor;String ls_flag ls_flag = f_ProfileString (sys_empid,'pos','autonew','1') IF ls_flag = '1' THEN THIS.Checked = TRUE ELSE THIS.Checked = FALSE END IF THIS.BackColor = 14215660 end event type cbx_2 from checkbox within w_outware_pos integer x = 933 integer y = 108 integer width = 343 integer height = 48 integer taborder = 90 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;string ls_flag if this.checked=true then ls_flag = '1' else ls_flag = '0' end if f_SetProfileString (sys_empid,'pos','autoprint',ls_flag) end event event constructor;String ls_flag ls_flag = f_ProfileString (sys_empid,'pos','autoprint','1') IF ls_flag = '1' THEN THIS.Checked = TRUE ELSE THIS.Checked = FALSE END IF THIS.BackColor = 14215660 end event type ln_1 from line within w_outware_pos long linecolor = 33554432 integer linethickness = 4 integer beginy = 1876 integer endx = 3333 integer endy = 1876 end type type st_1 from statictext within w_outware_pos integer x = 2331 integer y = 28 integer width = 279 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 event constructor;THIS.BackColor = 14215660 end event type st_user from statictext within w_outware_pos integer x = 2610 integer y = 28 integer width = 453 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 boolean focusrectangle = false end type event constructor;THIS.BackColor = 14215660 end event type st_6 from statictext within w_outware_pos integer x = 2363 integer y = 116 integer width = 247 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 event constructor;THIS.BackColor = 14215660 end event type st_time from statictext within w_outware_pos integer x = 2610 integer y = 116 integer width = 571 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 boolean focusrectangle = false end type event constructor;THIS.BackColor = 14215660 end event type st_7 from statictext within w_outware_pos integer x = 1312 integer y = 108 integer width = 315 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 event constructor;THIS.BackColor = 14215660 end event type st_billcode from statictext within w_outware_pos integer x = 1627 integer y = 108 integer width = 672 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 boolean focusrectangle = false end type event constructor;THIS.BackColor = 14215660 end event type cb_new from uo_imflatbutton within w_outware_pos integer width = 247 integer height = 164 integer taborder = 50 boolean bringtotop = true string text = "新建Ins" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF dw_child.RowCount() = 0 THEN RETURN IF dw_edit_mode THEN IF MessageBox('询问','是否要结算当前单据?',question!,yesno!) = 2 THEN GOTO ext END IF PARENT.TriggerEvent('ue_js') END IF ext: PARENT.TriggerEvent('ue_new') end event event ue_keydown;call super::ue_keydown;parent.triggerevent('user_key') end event type st_8 from statictext within w_outware_pos integer x = 1362 integer y = 224 integer width = 288 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 sle_cust from singlelineedit within w_outware_pos event keydown pbm_keydown event keyup pbm_keyup integer x = 1664 integer y = 204 integer width = 773 integer height = 84 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type event keydown;//if keydown(KeySlash!) or keydown(KeyDivide!) then parent.postevent('ue_clearinput') //end if end event event keyup;parent.triggerevent('user_key') end event event modified; cb_2.triggerevent(clicked!) end event type cb_2 from uo_imflatbutton within w_outware_pos integer x = 2455 integer y = 204 integer width = 306 integer height = 84 boolean bringtotop = true string text = "查询ENT" string normalpicname = "ok.bmp" integer picsize = 16 end type event clicked;call super::clicked;IF sle_cust.Text = '' THEN RETURN String ls_custcode ls_custcode = Trim(sle_cust.Text) if f_find_cust(ls_custcode,s_cust) = 1 THEN sle_cust.Text = s_cust.cuscode st_2.text = s_cust.name sle_barcode.SetFocus() RETURN ELSE parent.TriggerEvent('ue_f6') end if end event event ue_keydown;call super::ue_keydown;parent.triggerevent('user_key') end event type cbx_th from checkbox within w_outware_pos integer x = 1353 integer y = 12 integer width = 325 integer height = 60 integer taborder = 100 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 constructor;THIS.BackColor = 14215660 end event type dw_help from u_dw_rbtnfilter within w_outware_pos integer y = 436 integer width = 613 integer height = 1412 integer taborder = 0 boolean bringtotop = true string dataobject = "ds_help" end type type ddlb_scid from uo_ddlb_scid within w_outware_pos integer x = 1733 integer y = 4 integer width = 549 integer height = 620 integer taborder = 110 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 IF UpperBound(sys_user_scid) = 1 THEN ddlb_scid.Visible = FALSE 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)+']' cur_scid = THIS.uo_scid IF wf_find_dftstorage(cur_scid,ins_def_storageid) = 0 THEN MessageBox('错误','查询分部的默认零售仓库失败!',stopsign!,ok!) END IF end event event selectionchanged;call super::selectionchanged;cur_scid = THIS.uo_scid IF wf_find_dftstorage(cur_scid,ins_def_storageid) = 0 THEN MessageBox('错误','查询分部的默认零售仓库失败!',stopsign!,ok!) END IF end event type st_2 from statictext within w_outware_pos integer x = 2784 integer y = 204 integer width = 786 integer height = 84 boolean bringtotop = true integer textsize = -12 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 boolean focusrectangle = false end type type ln_bar from line within w_outware_pos long linecolor = 268435456 integer linethickness = 4 integer beginy = 176 integer endx = 3323 integer endy = 176 end type type ln_bar2 from line within w_outware_pos long linecolor = 16777215 integer linethickness = 4 integer beginy = 180 integer endx = 3323 integer endy = 180 end type type r_bar from rectangle within w_outware_pos long linecolor = 16777215 long fillcolor = 1073741824 integer x = 3319 integer width = 73 integer height = 172 end type event constructor;this.fillcolor = 14215660 this.linecolor = 14215660 this.x = -1 this.y = -1 this.height = ln_bar2.beginy - 5 end event type ln_2 from line within w_outware_pos long linecolor = 268435456 integer linethickness = 4 integer beginy = 300 integer endx = 3323 integer endy = 300 end type type ln_3 from line within w_outware_pos long linecolor = 16777215 integer linethickness = 4 integer beginy = 304 integer endx = 3323 integer endy = 304 end type