; ; dtEnd.Checked = dtStart.Checked; dtEnd.CValue = dtStart.CValue; @temp=ShowSearchBox("BillSearch","HAVEDEPOT", "tbSaleBillNo1",tbSaleBillNo1.CValue); if(@temp=="") return; tbSaleBillNo1.CValue=@temp; tbSaleBillNo2.CValue = tbSaleBillNo1.CValue; @temp=ShowSearchBox("BillSearch","HAVEDEPOT", "tbSaleBillNo2",tbSaleBillNo2.CValue); if(@temp=="") return; tbSaleBillNo2.CValue=@temp; @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo1.CValue); if( @temp == "" ) return; tbCustomerNo1.CValue = @temp; tbCustomerNo2.CValue = tbCustomerNo1.CValue; @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo2.CValue); if( @temp == "" ) return; tbCustomerNo2.CValue = @temp; UpdateForm(false, "cbPrincipal1"); Search("SearchPrincipal"); UpdateForm(true, "cbPrincipal1"); cbPrincipal2.SelectedName = cbPrincipal1.SelectedName; cbPrincipal2.SelectedNo=cbPrincipal1.SelectedNo; UpdateForm(false, "cbPrincipal2"); Search("SearchPrincipal"); UpdateForm(true, "cbPrincipal2"); UpdateForm(false, "cbLocation1"); Search("SearchLocation"); UpdateForm(true, "cbLocation1"); cbLocation2.SelectedName = cbLocation1.SelectedName; cbLocation2.SelectedNo = cbLocation1.SelectedNo; UpdateForm(false, "cbLocation2"); Search("SearchLocation"); UpdateForm(true, "cbLocation2"); if(ikRadioButton1.Checked==false && ikRadioButton2.Checked==false) { MessageBox("请选择格式!",@Title); return; } UpdateForm(false,""); #UI.Name_Creator = GetCurrentUser(); #UI.CreateDate = GetCurrentTime(); @StartDate_SaleBill=DBNull(); @EndDate_SaleBill=DBNull(); @StartNo_SaleBill = DBNull(); @EndNo_SaleBill = DBNull(); @StartNo_Customer = DBNull(); @EndNo_Customer = DBNull(); @StartNo_Principal= DBNull(); @EndNo_Principal = DBNull(); @StartNo_Location = DBNull(); @EndNo_Location = DBNull(); if(dtStart.Checked) @StartDate_SaleBill=dtStart.Value; else #UI.StartDate_SaleBill=DBNull(); if(dtEnd.Checked) @EndDate_SaleBill=dtEnd.Value; else #UI.EndDate_SaleBill=DBNull(); if(tbSaleBillNo1.CValue != "") @StartNo_SaleBill = tbSaleBillNo1.CValue; if(tbSaleBillNo2.CValue != "") @EndNo_SaleBill = tbSaleBillNo2.CValue; if(tbCustomerNo1.CValue != "") @StartNo_Customer = tbCustomerNo1.CValue; if(tbCustomerNo2.CValue != "") @EndNo_Customer = tbCustomerNo2.CValue; if(cbPrincipal1.Text!="") { if(!cbPrincipal1.CheckSelectedItem()) { MessageBox("请选择有效的业务负责人!",@Title); cbPrincipal1.Focus(); return; } else { @StartNo_Principal = cbPrincipal1.SelectedNo; } } if(cbPrincipal2.Text!="") { if(!cbPrincipal2.CheckSelectedItem()) { MessageBox("请选择有效的业务负责人!",@Title); cbPrincipal2.Focus(); return; } else { @EndNo_Principal = cbPrincipal2.SelectedNo; } } if(cbLocation1.Text!="") { if(!cbLocation1.CheckSelectedItem()) { MessageBox("请选择有效的仓库!",@Title); cbLocation1.Focus(); return; } else { @StartNo_Location = cbLocation1.SelectedNo; } } if(cbLocation2.Text!="") { if(!cbLocation2.CheckSelectedItem()) { MessageBox("请选择有效的仓库!",@Title); cbLocation2.Focus(); return; } else { @EndNo_Location = cbLocation2.SelectedNo; } } if(ikRadioButton1.Checked) { Search("SearchSalesMonthByPrincipal",@StartDate_SaleBill,@EndDate_SaleBill,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight("销货单","特价单","查看")); if(RowCount("#FrmSalesMonthByPrincipal")==0) { MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title); } else { PrintReport("UIFrmSalesMonthByPrincipal","UI","FrmSalesMonthByPrincipal"); } } else { Search("SearchSalesMonthByProduct",@StartDate_SaleBill,@EndDate_SaleBill,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight("销货单","特价单","查看")); if(RowCount("#FrmSalesMonthByProduct")==0) { MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title); } else { PrintReport("UIFrmSalesMonthByProduct","UI","FrmSalesMonthByProduct"); } } if(ikRadioButton1.Checked==false && ikRadioButton2.Checked==false) { MessageBox("请选择格式!",@Title); return; } UpdateForm(false,""); #UI.Name_Creator = GetCurrentUser(); #UI.CreateDate = GetCurrentTime(); @StartDate_SaleBill=DBNull(); @EndDate_SaleBill=DBNull(); @StartNo_SaleBill = DBNull(); @EndNo_SaleBill = DBNull(); @StartNo_Customer = DBNull(); @EndNo_Customer = DBNull(); @StartNo_Principal= DBNull(); @EndNo_Principal = DBNull(); @StartNo_Location = DBNull(); @EndNo_Location = DBNull(); if(dtStart.Checked) @StartDate_SaleBill=dtStart.Value; else #UI.StartDate_SaleBill=DBNull(); if(dtEnd.Checked) @EndDate_SaleBill=dtEnd.Value; else #UI.EndDate_SaleBill=DBNull(); if(tbSaleBillNo1.CValue != "") @StartNo_SaleBill = tbSaleBillNo1.CValue; if(tbSaleBillNo2.CValue != "") @EndNo_SaleBill = tbSaleBillNo2.CValue; if(tbCustomerNo1.CValue != "") @StartNo_Customer = tbCustomerNo1.CValue; if(tbCustomerNo2.CValue != "") @EndNo_Customer = tbCustomerNo2.CValue; if(cbPrincipal1.Text!="") { if(!cbPrincipal1.CheckSelectedItem()) { MessageBox("请选择有效的业务负责人!",@Title); cbPrincipal1.Focus(); return; } else { @StartNo_Principal = cbPrincipal1.SelectedNo; } } if(cbPrincipal2.Text!="") { if(!cbPrincipal2.CheckSelectedItem()) { MessageBox("请选择有效的业务负责人!",@Title); cbPrincipal2.Focus(); return; } else { @EndNo_Principal = cbPrincipal2.SelectedNo; } } if(cbLocation1.Text!="") { if(!cbLocation1.CheckSelectedItem()) { MessageBox("请选择有效的仓库!",@Title); cbLocation1.Focus(); return; } else { @StartNo_Location = cbLocation1.SelectedNo; } } if(cbLocation2.Text!="") { if(!cbLocation2.CheckSelectedItem()) { MessageBox("请选择有效的仓库!",@Title); cbLocation2.Focus(); return; } else { @EndNo_Location = cbLocation2.SelectedNo; } } if(ikRadioButton1.Checked) { Search("SearchSalesMonthByPrincipal",@StartDate_SaleBill,@EndDate_SaleBill,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight("销货单","特价单","查看")); if(RowCount("#FrmSalesMonthByPrincipal")==0) { MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title); } else { ExportReport("Excel","UIFrmSalesMonthByPrincipal","UI","FrmSalesMonthByPrincipal"); } } else { Search("SearchSalesMonthByProduct",@StartDate_SaleBill,@EndDate_SaleBill,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight("销货单","特价单","查看")); if(RowCount("#FrmSalesMonthByProduct")==0) { MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title); } else { ExportReport("Excel","UIFrmSalesMonthByProduct","UI","FrmSalesMonthByProduct"); } } if(ikRadioButton1.Checked==false && ikRadioButton2.Checked==false) { MessageBox("请选择格式!",@Title); return; } UpdateForm(false,""); #UI.Name_Creator = GetCurrentUser(); #UI.CreateDate = GetCurrentTime(); @StartDate_SaleBill=DBNull(); @EndDate_SaleBill=DBNull(); @StartNo_SaleBill = DBNull(); @EndNo_SaleBill = DBNull(); @StartNo_Customer = DBNull(); @EndNo_Customer = DBNull(); @StartNo_Principal= DBNull(); @EndNo_Principal = DBNull(); @StartNo_Location = DBNull(); @EndNo_Location = DBNull(); if(dtStart.Checked) @StartDate_SaleBill=dtStart.Value; else #UI.StartDate_SaleBill=DBNull(); if(dtEnd.Checked) @EndDate_SaleBill=dtEnd.Value; else #UI.EndDate_SaleBill=DBNull(); if(tbSaleBillNo1.CValue != "") @StartNo_SaleBill = tbSaleBillNo1.CValue; if(tbSaleBillNo2.CValue != "") @EndNo_SaleBill = tbSaleBillNo2.CValue; if(tbCustomerNo1.CValue != "") @StartNo_Customer = tbCustomerNo1.CValue; if(tbCustomerNo2.CValue != "") @EndNo_Customer = tbCustomerNo2.CValue; if(cbPrincipal1.Text!="") { if(!cbPrincipal1.CheckSelectedItem()) { MessageBox("请选择有效的业务负责人!",@Title); cbPrincipal1.Focus(); return; } else { @StartNo_Principal = cbPrincipal1.SelectedNo; } } if(cbPrincipal2.Text!="") { if(!cbPrincipal2.CheckSelectedItem()) { MessageBox("请选择有效的业务负责人!",@Title); cbPrincipal2.Focus(); return; } else { @EndNo_Principal = cbPrincipal2.SelectedNo; } } if(cbLocation1.Text!="") { if(!cbLocation1.CheckSelectedItem()) { MessageBox("请选择有效的仓库!",@Title); cbLocation1.Focus(); return; } else { @StartNo_Location = cbLocation1.SelectedNo; } } if(cbLocation2.Text!="") { if(!cbLocation2.CheckSelectedItem()) { MessageBox("请选择有效的仓库!",@Title); cbLocation2.Focus(); return; } else { @EndNo_Location = cbLocation2.SelectedNo; } } if(ikRadioButton1.Checked) { Search("SearchSalesMonthByPrincipal",@StartDate_SaleBill,@EndDate_SaleBill,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight("销货单","特价单","查看")); if(RowCount("#FrmSalesMonthByPrincipal")==0) { MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title); } else { ExportReport("Word","UIFrmSalesMonthByPrincipal","UI","FrmSalesMonthByPrincipal"); } } else { Search("SearchSalesMonthByProduct",@StartDate_SaleBill,@EndDate_SaleBill,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight("销货单","特价单","查看")); if(RowCount("#FrmSalesMonthByProduct")==0) { MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title); } else { ExportReport("Word","UIFrmSalesMonthByProduct","UI","FrmSalesMonthByProduct"); } } if(ikRadioButton1.Checked==false && ikRadioButton2.Checked==false) { MessageBox("请选择格式!",@Title); return; } UpdateForm(false,""); #UI.Name_Creator = GetCurrentUser(); #UI.CreateDate = GetCurrentTime(); @StartDate_SaleBill=DBNull(); @EndDate_SaleBill=DBNull(); @StartNo_SaleBill = DBNull(); @EndNo_SaleBill = DBNull(); @StartNo_Customer = DBNull(); @EndNo_Customer = DBNull(); @StartNo_Principal= DBNull(); @EndNo_Principal = DBNull(); @StartNo_Location = DBNull(); @EndNo_Location = DBNull(); if(dtStart.Checked) @StartDate_SaleBill=dtStart.Value; else #UI.StartDate_SaleBill=DBNull(); if(dtEnd.Checked) @EndDate_SaleBill=dtEnd.Value; else #UI.EndDate_SaleBill=DBNull(); if(tbSaleBillNo1.CValue != "") @StartNo_SaleBill = tbSaleBillNo1.CValue; if(tbSaleBillNo2.CValue != "") @EndNo_SaleBill = tbSaleBillNo2.CValue; if(tbCustomerNo1.CValue != "") @StartNo_Customer = tbCustomerNo1.CValue; if(tbCustomerNo2.CValue != "") @EndNo_Customer = tbCustomerNo2.CValue; if(cbPrincipal1.Text!="") { if(!cbPrincipal1.CheckSelectedItem()) { MessageBox("请选择有效的业务负责人!",@Title); cbPrincipal1.Focus(); return; } else { @StartNo_Principal = cbPrincipal1.SelectedNo; } } if(cbPrincipal2.Text!="") { if(!cbPrincipal2.CheckSelectedItem()) { MessageBox("请选择有效的业务负责人!",@Title); cbPrincipal2.Focus(); return; } else { @EndNo_Principal = cbPrincipal2.SelectedNo; } } if(cbLocation1.Text!="") { if(!cbLocation1.CheckSelectedItem()) { MessageBox("请选择有效的仓库!",@Title); cbLocation1.Focus(); return; } else { @StartNo_Location = cbLocation1.SelectedNo; } } if(cbLocation2.Text!="") { if(!cbLocation2.CheckSelectedItem()) { MessageBox("请选择有效的仓库!",@Title); cbLocation2.Focus(); return; } else { @EndNo_Location = cbLocation2.SelectedNo; } } if(ikRadioButton1.Checked) { Search("SearchSalesMonthByPrincipal",@StartDate_SaleBill,@EndDate_SaleBill,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight("销货单","特价单","查看")); if(RowCount("#FrmSalesMonthByPrincipal")==0) { MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title); } else { ExportReport("PrintToPrinter","UIFrmSalesMonthByPrincipal","UI","FrmSalesMonthByPrincipal"); } } else { Search("SearchSalesMonthByProduct",@StartDate_SaleBill,@EndDate_SaleBill,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight("销货单","特价单","查看")); if(RowCount("#FrmSalesMonthByProduct")==0) { MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title); } else { ExportReport("PrintToPrinter","UIFrmSalesMonthByProduct","UI","FrmSalesMonthByProduct"); } } if(GetRight("客户基本资料","全权查看")) { FormatString(""); } else { FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID()); } if(GetRight("客户基本资料","全权查看")) { FormatString(""); } else { FormatString(" Disable_SaleBill=0 and Customer.ID_Creator='{0}' ",GetLoginUserID()); }