$PBExportHeader$w_email_seach_self_group.srw forward global type w_email_seach_self_group from w_publ_easyq end type type cbx_1 from checkbox within w_email_seach_self_group end type type ddlb_1 from dropdownlistbox within w_email_seach_self_group end type type ddlb_scid from uo_ddlb_scid within w_email_seach_self_group end type type cb_3 from uo_imflatbutton within w_email_seach_self_group end type type cb_4 from uo_imflatbutton within w_email_seach_self_group end type type cb_5 from uo_imflatbutton within w_email_seach_self_group end type type dw_spttype from u_dw_rbtnfilter within w_email_seach_self_group end type end forward global type w_email_seach_self_group from w_publ_easyq integer x = 9 integer y = 12 integer width = 3611 integer height = 2380 string title = "供应商筛选" boolean minbox = false boolean maxbox = false boolean resizable = false windowtype windowtype = response! cbx_1 cbx_1 ddlb_1 ddlb_1 ddlb_scid ddlb_scid cb_3 cb_3 cb_4 cb_4 cb_5 cb_5 dw_spttype dw_spttype end type global w_email_seach_self_group w_email_seach_self_group type variables long cur_scid_arr[] String ls_areaname = '' datetime end_date_jq string ls_u_cust_cusareaname string ls_u_cust_rep_email string ls_cuscode string ls_name string ls_custype string ls_u_cust_grade string ls_u_cust_dscrp string ls_u_cust_rep_repname string ls_u_cust_rep_sex string ls_u_cust_rep_deptname string ls_u_cust_rep_duty boolean b_Focus=false long ins_spttypeid =-1 s_edit_index_tran ss_tran end variables forward prototypes public subroutine wf_combine (ref datawindow arg_dw) public function decimal f_getys (long arg_custid, integer arg_scid, datetime arg_star, datetime arg_end) public function datetime f_month_add (datetime arg_date) public subroutine wf_face () public subroutine wf_filter () end prototypes public subroutine wf_combine (ref datawindow arg_dw);//合并金额 arg_dw.setsort("u_cust_sc_cuscode") arg_dw.sort() long cnt,row cnt=arg_dw.rowcount() if cnt>1 then for row=cnt to 2 step -1 if arg_dw.object.u_cust_sc_cuscode[row - 1]=arg_dw.object.u_cust_sc_cuscode[row] then arg_dw.object.orgn_amt[row - 1]=arg_dw.object.orgn_amt[row - 1]+arg_dw.object.orgn_amt[row] arg_dw.object.v_musttakebalc_incdec_groupbysc_msttakeamt[row - 1]=arg_dw.object.v_musttakebalc_incdec_groupbysc_msttakeamt[row - 1]+arg_dw.object.v_musttakebalc_incdec_groupbysc_msttakeamt[row] arg_dw.object.v_musttakebalc_incdec_groupbysc_takeamt[row - 1]=arg_dw.object.v_musttakebalc_incdec_groupbysc_takeamt[row - 1]+arg_dw.object.v_musttakebalc_incdec_groupbysc_takeamt[row] arg_dw.object.v_musttakebalc_balcamt_groupbysc_balcamt[row - 1]=arg_dw.object.v_musttakebalc_balcamt_groupbysc_balcamt[row - 1]+arg_dw.object.v_musttakebalc_balcamt_groupbysc_balcamt[row] arg_dw.deleterow(row) end if next end if end subroutine public function decimal f_getys (long arg_custid, integer arg_scid, datetime arg_star, datetime arg_end); decimal amt,amt1 SELECT isnull(sum( U_Bmsttake.msttakeamt - U_Bmsttake.takeamt ) ,0)as '应收' into :amt FROM U_Bmsttake left outer join u_accounts on U_Bmsttake.accountsid = u_accounts.accountsid left outer join u_itemdef on U_Bmsttake.itemid = u_itemdef.itemid left outer join cw_banktype on U_Bmsttake.banktypeid = cw_banktype.banktypeid, u_scdef WHERE ( U_Bmsttake.scid = u_scdef.ScID ) and ( U_Bmsttake.cusid = :arg_custid) AND ( U_Bmsttake.takedate >= :arg_star ) AND ( U_Bmsttake.takedate < :arg_end ) and ( U_Bmsttake.scid = :arg_scid) ; ////////////////////////////////////////////////////// SELECT isnull(sum(U_Bmsttake.takeamt ) ,0)as '应收' into :amt1 FROM U_Bmsttake left outer join u_accounts on U_Bmsttake.accountsid = u_accounts.accountsid left outer join u_itemdef on U_Bmsttake.itemid = u_itemdef.itemid left outer join cw_banktype on U_Bmsttake.banktypeid = cw_banktype.banktypeid, u_scdef WHERE ( U_Bmsttake.scid = u_scdef.ScID ) and ( U_Bmsttake.cusid = :arg_custid) AND ( U_Bmsttake.takedate >= :arg_star ) AND ( U_Bmsttake.takedate < :arg_end ) and (( U_Bmsttake.finishdate >= :end_date_jq ) or U_Bmsttake.finishflag=0) AND ( U_Bmsttake.scid = :arg_scid) ; amt=amt + amt1 return amt // and // ( U_Bmsttake.finishflag = 0 ); end function public function datetime f_month_add (datetime arg_date);datetime d_date date e_date e_date=date(arg_date) if long(month(e_date))<>12 then arg_date= DateTime(date(string(year(e_date)) + '-' +string(long(month(e_date)) + 1) + '-01' ) ,00:00:00) else arg_date= DateTime(date(string(long(year(e_date)) + 1) + '-01' + '-01' ) ,00:00:00) end if return arg_date end function public subroutine wf_face ();//String ls_column_name[] //存放列名 //String ls_column_text[] //存放列标题名称 //Integer i, li_column_count //TRY // //得到数据窗口的总列数 // li_column_count = Long(dw_1.Describe("DataWindow.Column.Count")) // // //循环依次读取 // FOR i = 1 To li_column_count // ls_column_name[i] = dw_1.Describe("#"+String(i)+".name") // ls_column_text[i] = dw_1.Describe(ls_column_name[i] + "_t.text") // // NEXT // // String ls_x,ls_x_t,ls_visible,ls_width // FOR i = 1 To li_column_count // ls_x = ls_x + ls_column_name[i] + '_t.x=' + dw_1.Describe(ls_column_name[i] + ".x") + "~t" // //ls_x= ls_x + ls_column_name[i] + '.x=' + dw_1.Describe(ls_column_name[i] + ".x") + "~t" // ls_width = ls_width + ls_column_name[i] + '_t.width=' + dw_1.Describe(ls_column_name[i] + ".width") + "~t" // ls_visible = ls_visible + ls_column_name[i] + '_t.visible=' + dw_1.Describe(ls_column_name[i] + ".visible") + "~t" // NEXT // // // dw_2.Modify(ls_x) // dw_2.Modify(ls_width) // dw_2.Modify(ls_visible) // dw_2.Object.DataWindow.horizontalScrollPosition = dw_1.Object.DataWindow.horizontalScrollPosition //Catch(RunTimeError e) //END TRY // // // // end subroutine public subroutine wf_filter ();String ls_date //dw_2.AcceptText() //ls_u_cust_rep_email= "'%" +string(dw_2.object.u_cust_rep_email_t[1])+ "%'" //ls_cuscode= "'%" +string(dw_2.object.cuscode_t[1])+ "%'" //ls_name= "'%" +string(dw_2.object.name_t[1])+ "%'" //ls_custype= "'%" +string(dw_2.object.custype_t[1])+ "%'" //ls_u_cust_cusareaname= "'%" +string(dw_2.object.u_cust_cusareaname_t[1])+ "%'" //ls_u_cust_grade= "'%" +string(dw_2.object.u_cust_grade_t[1])+ "%'" //ls_u_cust_dscrp= "'%" +string(dw_2.object.u_cust_dscrp_t[1])+ "%'" //ls_u_cust_rep_repname= "'%" +string(dw_2.object.u_cust_rep_repname_t[1])+ "%'" //ls_u_cust_rep_sex= "'%" +string(dw_2.object.u_cust_rep_sex_t[1])+ "%'" //ls_u_cust_rep_deptname= "'%" +string(dw_2.object.u_cust_rep_deptname_t[1])+ "%'" //ls_u_cust_rep_duty= "'%" +string(dw_2.object.u_cust_rep_duty_t[1])+ "%'" // ////ls_date = "(u_cust_rep.email like " + ls_u_cust_rep_email + ") and (cuscode like " + ls_cuscode + ")" + " and (name like " + ls_name + ")" // ////ls_date = "email like + ' %1 ' + " ////dw.setfilter(" name = 'lily' ") ////IF Trim(sle_find.Text) = "" THEN RETURN //ls_date = "'%" + Trim(sle_find.Text) + "%'" ////dw_list.SetFilter("subject like '%" + ls_date + "%' " ) //ls_date = "(subject like " + ls_date + ") or (sendman like " + ls_date + ")" + " or (revman like " + ls_date + ")" // // //dw_1.SetFilter( " u_cust_rep.email = 'lily' ") //dw_1.Filter() //dw_1.SetFilter("") end subroutine on w_email_seach_self_group.create int iCurrent call super::create this.cbx_1=create cbx_1 this.ddlb_1=create ddlb_1 this.ddlb_scid=create ddlb_scid this.cb_3=create cb_3 this.cb_4=create cb_4 this.cb_5=create cb_5 this.dw_spttype=create dw_spttype iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cbx_1 this.Control[iCurrent+2]=this.ddlb_1 this.Control[iCurrent+3]=this.ddlb_scid this.Control[iCurrent+4]=this.cb_3 this.Control[iCurrent+5]=this.cb_4 this.Control[iCurrent+6]=this.cb_5 this.Control[iCurrent+7]=this.dw_spttype end on on w_email_seach_self_group.destroy call super::destroy destroy(this.cbx_1) destroy(this.ddlb_1) destroy(this.ddlb_scid) destroy(this.cb_3) destroy(this.cb_4) destroy(this.cb_5) destroy(this.dw_spttype) end on event open;call super::open;ls_areaname = "%%" dw_spttype.Retrieve() cb_1.triggerevent(clicked!) ss_tran = message.powerobjectparm end event event ue_before_open;call super::ue_before_open;if_ue_retr=true if_ue_filter=true if_ue_sort=true if_ue_sentdataout=true //IF sys_option_takepay_sc = 1 THEN dw_1.DataObject = "dw_email_seach_self_group" ddlb_scid.Enabled = TRUE //ELSE // dw_1.DataObject = "dw_rp_musttake_balc_scid_fenyue" // ddlb_scid.Enabled = FALSE //END IF dw_spttype.settransobject(sqlca) dw_1.settransobject(sqlca) dw_1.ins_INIfile_name = sys_inifilename dw_1.ins_opemp = publ_operator dw_1.cardw_empid = sys_empid dw_1.cur_DataObject = dw_1.DataObject dw_1.uf_read_profile_layout() wf_face() end event event resize;call super::resize;dw_spttype.Height = This.Height - dw_1.Y - 115 end event type cb_func from w_publ_easyq`cb_func within w_email_seach_self_group boolean visible = false end type type cb_exit from w_publ_easyq`cb_exit within w_email_seach_self_group integer x = 160 end type type cb_2 from w_publ_easyq`cb_2 within w_email_seach_self_group boolean visible = false boolean bringtotop = true end type type cb_psetup from w_publ_easyq`cb_psetup within w_email_seach_self_group boolean visible = false boolean bringtotop = true end type type cb_1 from w_publ_easyq`cb_1 within w_email_seach_self_group boolean bringtotop = true end type event cb_1::clicked;call super::clicked; dw_1.Retrieve() end event type st_3 from w_publ_easyq`st_3 within w_email_seach_self_group boolean visible = false integer x = 608 integer width = 315 string text = "发生日期从:" alignment alignment = left! end type type st_4 from w_publ_easyq`st_4 within w_email_seach_self_group boolean visible = false integer x = 1449 end type type em_1 from w_publ_easyq`em_1 within w_email_seach_self_group boolean visible = false integer x = 910 integer width = 430 integer textsize = -10 string mask = "yyyy-mm" end type type em_2 from w_publ_easyq`em_2 within w_email_seach_self_group boolean visible = false integer x = 1550 integer width = 430 integer textsize = -10 string mask = "yyyy-mm" end type type ddlb_yl from w_publ_easyq`ddlb_yl within w_email_seach_self_group boolean visible = false integer x = 1495 integer y = 40 end type type cbx_yl from w_publ_easyq`cbx_yl within w_email_seach_self_group boolean visible = false integer x = 1285 integer y = 44 end type type dw_1 from w_publ_easyq`dw_1 within w_email_seach_self_group event dwnlbuttonup pbm_dwnlbuttonup event mousemove pbm_dwnmousemove integer y = 304 integer width = 3534 integer height = 1792 string dataobject = "dw_email_seach_self_group" boolean hsplitscroll = false boolean livescroll = false end type event dw_1::mousemove;wf_face() end event event dw_1::clicked;IF row > 0 THEN This.SelectRow(0,False) This.SetRow(row) This.SelectRow(row,True) END IF b_Focus = False end event event dw_1::scrollhorizontal;call super::scrollhorizontal;wf_face() end event type sle_mtrl from w_publ_easyq`sle_mtrl within w_email_seach_self_group end type type sle_cust from w_publ_easyq`sle_cust within w_email_seach_self_group end type type st_mtrl from w_publ_easyq`st_mtrl within w_email_seach_self_group end type type st_cust from w_publ_easyq`st_cust within w_email_seach_self_group end type type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_email_seach_self_group end type type pb_em1 from w_publ_easyq`pb_em1 within w_email_seach_self_group boolean visible = false integer x = 1344 integer y = 184 end type type pb_em2 from w_publ_easyq`pb_em2 within w_email_seach_self_group boolean visible = false integer x = 1975 integer y = 188 end type type pb_2 from w_publ_easyq`pb_2 within w_email_seach_self_group boolean visible = false integer x = 2583 integer y = 60 end type type cb_help from w_publ_easyq`cb_help within w_email_seach_self_group boolean visible = false end type type cb_copyself from w_publ_easyq`cb_copyself within w_email_seach_self_group boolean visible = false end type type gb_1 from w_publ_easyq`gb_1 within w_email_seach_self_group end type type ln_bar from w_publ_easyq`ln_bar within w_email_seach_self_group end type type ln_bar2 from w_publ_easyq`ln_bar2 within w_email_seach_self_group end type type r_bar from w_publ_easyq`r_bar within w_email_seach_self_group end type type ln_1 from w_publ_easyq`ln_1 within w_email_seach_self_group end type type ln_2 from w_publ_easyq`ln_2 within w_email_seach_self_group end type type ln_3 from w_publ_easyq`ln_3 within w_email_seach_self_group end type type ln_4 from w_publ_easyq`ln_4 within w_email_seach_self_group end type type cbx_1 from checkbox within w_email_seach_self_group boolean visible = false integer x = 2409 integer y = 204 integer width = 585 integer height = 76 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16711680 long backcolor = 134217739 string text = "不显示无交易的客户" boolean checked = true end type type ddlb_1 from dropdownlistbox within w_email_seach_self_group boolean visible = false integer x = 9 integer y = 200 integer width = 494 integer height = 300 integer taborder = 20 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 string item[] = {"格式一","格式二"} borderstyle borderstyle = stylelowered! end type event selectionchanged; //IF THIS.Text = '格式二' THEN // ddlb_scid.Enabled = FALSE //ELSE // ddlb_scid.Enabled = TRUE //END IF IF THIS.Text = '格式一' THEN // IF sys_option_takepay_sc = 1 THEN dw_1.DataObject = 'dw_rp_musttake_balc_scid' // ELSE // dw_1.DataObject = 'dw_rp_musttake_balc' // END IF dw_1.ins_INIfile_name = sys_inifilename dw_1.ins_opemp = publ_operator dw_1.cardw_empid = sys_empid dw_1.cur_DataObject = dw_1.DataObject dw_1.uf_read_profile_layout() ELSE dw_1.uf_save_profile_layout() // IF sys_option_takepay_sc = 1 THEN dw_1.DataObject = 'dw_rp_musttake_balc_scid_2' // ELSE // dw_1.DataObject = 'dw_rp_musttake_balc_2' // END IF // dw_1.DataObject = 'dw_rp_musttake_balc_2' END IF dw_1.SetTransObject(sqlca) cb_1.triggerevent(clicked!) end event type ddlb_scid from uo_ddlb_scid within w_email_seach_self_group boolean visible = false integer x = 32 integer y = 200 integer width = 562 integer height = 424 integer taborder = 20 boolean bringtotop = true end type event selectionchanged;call super::selectionchanged;cur_scid_arr = THIS.uo_scid_arr cb_1.triggerevent(clicked!) end event event constructor;call super::constructor;cur_scid_arr = THIS.uo_scid_arr end event type cb_3 from uo_imflatbutton within w_email_seach_self_group integer x = 1339 integer width = 494 integer height = 164 integer taborder = 40 boolean bringtotop = true string text = "添加自定组" string normalpicname = "caudit.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;//s_sendmx_parm s_sendmxx s_rep_group_parm ss_rep_group Long i,j dw_1.AcceptText() DO WHILE i < dw_1.RowCount() i++ IF dw_1.Object.isselect[i] = 1 THEN j++ ss_rep_group.s_group[j].reltype =2 ss_rep_group.s_group[j].relid = dw_1.Object.groupid[i] ss_rep_group.s_group[j].repid = 0 END IF LOOP CloseWithReturn(Parent, ss_rep_group) end event type cb_4 from uo_imflatbutton within w_email_seach_self_group integer x = 855 integer width = 233 integer height = 164 integer taborder = 50 boolean bringtotop = true string text = "全选" string normalpicname = "ok.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;Integer i TRY FOR i = 1 To dw_1.RowCount() dw_1.Object.isselect[i] = 1 NEXT Catch(RunTimeError e) END TRY end event type cb_5 from uo_imflatbutton within w_email_seach_self_group integer x = 1097 integer width = 233 integer height = 164 integer taborder = 60 boolean bringtotop = true string text = "全不选" string normalpicname = "ok.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;Integer i TRY FOR i = 1 To dw_1.RowCount() dw_1.Object.isselect[i] = 0 NEXT Catch(RunTimeError e) END TRY end event type dw_spttype from u_dw_rbtnfilter within w_email_seach_self_group boolean visible = false integer x = 9 integer y = 304 integer width = 841 integer height = 1656 integer taborder = 110 boolean bringtotop = true string dataobject = "dw_spttype_index" end type event rowfocuschanged;call super::rowfocuschanged;IF currentrow <=0 THEN RETURN this.selectrow(0,false) this.selectrow(currentrow,true) IF dw_spttype.GetRow() <= 0 THEN ins_spttypeid = 0 ELSE ins_spttypeid = dw_spttype.Object.spttypeid[dw_spttype.GetRow()] END IF cb_1.triggerevent(clicked!) end event