ChangeMode("Search"); ; ; ShowSearchBox("BillSearch","HAVEDEPOT", "tbNo",tbNo.CValue); UpdateForm(false, "cbLocation"); Search("SearchLocation"); UpdateForm(true, "cbLocation"); if(Search("SearchSaleRtn",#SaleOutDepotBill.ID_SaleOutDepotBill)) { if(#SaleRtn.RtnQuantity_SaleOutDepotBillProduct > 0 || #SaleRtnFromSaleBill.Num > 0) { MessageBox("该单据已有相应的销售退货记录,作废失败!",@Title); return; } } BeginUnAudit(); #SaleOutDepotBill.ID_Assessor = DBNull(); #SaleOutDepotBill.Name_UserAuti = ""; #SaleOutDepotBill.Disable_SaleOutDepotBill =true; UnAudit(); ChangeMode("View"); EndUnAudit(); Search("SearchBillType"); SetDataGridColumnDataSource(1,"dgProduct"); @SetFlag=1; ShowSearchBox("ProductSearch","INFOMATION",#SaleOutDepotBillProduct.No_Product); @SetFlag=0; @SetFlag1=1; @LocationNo = ShowSearchBox("LocationSearch","INFOMATION",#SaleOutDepotBillProduct.No_Location); if(@LocationNo != "") #SaleOutDepotBillProduct.No_Location = @LocationNo; @SetFlag1=0; if(Search("SearchSaleOutDepotBillFirst", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchSaleOutDepotBillPrevious", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchSaleOutDepotBillNext", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchSaleOutDepotBillLast", tbNo.CValue)) { ChangeMode("View"); } @NewNumber=GetNextAutoNumber(true); if(@NewNumber != "") { ChangeMode("New"); tbNo.CValue=@NewNumber; } ChangeMode("Search"); ChangeMode("Modify"); Delete(); ChangeMode("Search"); ShowPrintBox("BillSearch",#SaleOutDepotBill.No_SaleOutDepotBill,#SaleOutDepotBill.No_SaleOutDepotBill,GetFieldRight(@Title,"成本","查看")); PrintBarCode("BillSearch",#SaleOutDepotBill.No_SaleOutDepotBill,#SaleOutDepotBill.No_SaleOutDepotBill); ; ; ; ; if(toolBar.MenuItemText=="销售退货单") { if(Search("SearchContr")) { ExportBillProductStart("#SaleRtnBillProduct.Type_FromBill",2,"#SaleRtnBillProduct.FromBill_SaleRtnBillProduct","销货出库单","#SaleRtnBillProduct.No_FromBill",#SaleOutDepotBill.No_SaleOutDepotBill,"#SaleRtnBill.No_Customer",#SaleOutDepotBill.No_Customer,"#SaleRtnBill.Name_Location",#SaleOutDepotBill.Name_Location); ExportBillProduct("dgProduct","#SaleOutDepotBillProduct","#SaleRtnBillProduct.No_FromBillProduct","#SaleOutDepotBillProduct.No_SaleOutDepotBillProduct"); } else { ExportBillProductStart("#SaleRtnBill.No_Customer",#SaleOutDepotBill.No_Customer,"#SaleRtnBillProduct.Comment_SaleRtnBillProduct","销货出库单:"+#SaleOutDepotBill.No_SaleOutDepotBill,"#SaleRtnBill.Name_Location",#SaleOutDepotBill.Name_Location); ExportBillProduct("dgProduct","#SaleOutDepotBillProduct","#SaleRtnBillProduct.ProductNo_SaleRtnBillProduct","#SaleOutDepotBillProduct.No_Product"); } } @DialogResult=MessageBox("是否进行分校验?(选否进行总校验)",@Title,MB_YESNO); if(@DialogResult == DialogResult("YES")) { ShowFrmSaleOutProductCheck(#SaleOutDepotBill.No_SaleOutDepotBill); } else { if(Read("BarCode.txt",0)=="") MessageBox("条码信息所在文件不存在或信息为空!",@Title); else { ChangeMode("Search"); if(Search("SearchSaleOutDepotBillWithNo", Read("BarCode.txt",0))) { Search("SearchStatusWithNo",Read("BarCode.txt",0)); if(#Status.Check_SaleOutDepotBill == 0) { ChangeMode("View"); } else { ChangeMode("Search"); MessageBox("该单据已校验!",@Title); return; } } else { @a = ShowSearchNo(); if(Search("SearchSaleOutDepotBillWithNo", @a)) { Search("SearchStatusWithNo",@a); if(#Status.Check_SaleOutDepotBill == 0) { ChangeMode("View"); ShowFrmBarProduct(Read("BarCode.txt",1),@a); return; } else { ChangeMode("Search"); MessageBox("该单据已校验!",@Title); return; } } else { MessageBox("该出库单不存在!",@Title); return; } } ShowFrmBarProduct(Read("BarCode.txt",1),""); } } if(@SetFlag1==0) { return; } if(#SaleOutDepotBillProduct.No_Location != StringEmpty()) { if(!Search("SearchLocationByNo",#SaleOutDepotBillProduct.No_Location)) { MessageBox("不存在此库位编号",@Title); #SaleOutDepotBillProduct.ID_Location=GuidEmpty(); #SaleOutDepotBillProduct.Name_Location=StringEmpty(); } else { #SaleOutDepotBillProduct.ID_Location=#Location.ID_Location; #SaleOutDepotBillProduct.Name_Location=#Location.Name_Location; } }
UpdateForm(true, "tbCustomerNo"); Search("SearchLocation"); cbLocation.Text = #SaleOutDepotBill.Name_Location; tbCustomerNo.Focus(); ActiveControlEvent("tbCustomerNo", "Enter");
>
Empty(); NewInstance(); @ImportClicked = 0; timeMake.Enabled =false; tbNo.ReadOnly =false; cbLocation.Enabled =false; dgProduct.ReadOnly =true; dgRemark.ReadOnly =true; dgReportComment.ReadOnly =true; tbCustomerNo.ReadOnly =true; toolBar.EnableSubmit =false; toolBar.EnableModify =false; toolBar.EnableDelete =false; toolBar.EnableAudit =false; toolBar.EnableUnAudit =false; toolBar.EnableNew =GetRight(@Title,"新增"); toolBar.EnablePrint =false; toolBar.EnablePrintBarCode =false; toolBar.EnableExport = false; toolBar.EnableImport = false; toolBar.EnableCheck =true; #SaleOutDepotBill.AssessDate_SaleOutDepotBill =DBNull(); #SaleOutDepotBill.ID_Assessor =DBNull(); #SaleOutDepotBill.ID_Creator =DBNull(); #SaleOutDepotBill.LastModUser_SaleOutDepotBill =DBNull(); #SaleOutDepotBill.LastModDate_SaleOutDepotBill =DBNull(); ikNumericTextBox1.CValue = 0; UpdateForm(true,""); tbNo.Focus(); @Status=0; btnDelete.Enabled = false; Empty(); NewInstance(); @ImportClicked = 0; timeMake.Enabled =true; tbCustomerNo.ReadOnly = false; tbNo.ReadOnly =true; cbLocation.Enabled =true; dgProduct.ReadOnly =false; dgRemark.ReadOnly =false; dgReportComment.ReadOnly =false; toolBar.EnableSubmit =GetRight(@Title,"新增"); toolBar.EnableModify =false; toolBar.EnableDelete =false; toolBar.EnableAudit =false; toolBar.EnableUnAudit =false; toolBar.EnableNew =false; toolBar.EnablePrint =false; toolBar.EnablePrintBarCode =false; toolBar.EnableExport = false; toolBar.EnableImport = true; toolBar.EnableCheck = false; #SaleOutDepotBill.ID_SaleOutDepotBill =NewGuid(); #SaleOutDepotBill.ID_Creator =GetLoginUserID(); #SaleOutDepotBill.Name_User =GetCurrentUser(); #SaleOutDepotBill.AssessDate_SaleOutDepotBill =DBNull(); #SaleOutDepotBill.ID_Assessor =DBNull(); #SaleOutDepotBill.LastModUser_SaleOutDepotBill =DBNull(); #SaleOutDepotBill.Name_LastModUser =DBNull(); #SaleOutDepotBill.LastModDate_SaleOutDepotBill =DBNull(); #SaleOutDepotBill.ID_Location =GetCurrentDepotID(); #SaleOutDepotBill.Name_Location =GetCurrentDepot(); #SaleOutDepotBill.No_Location =GetCurrentDepotNo(); #SaleOutDepotBill.Date_SaleOutDepotBill =GetCurrentTime(); ikNumericTextBox1.CValue = 0; dgProduct.SetColumnReadOnly(1, false); dgProduct.SetColumnReadOnly(2, false); dgProduct.SetColumnReadOnly(3, false); dgProduct.SetColumnReadOnly(4, false); dgProduct.RowHeaderCheck=true; dgProduct.AllowNew(true); dgProduct.AllowDelete(true); UpdateForm(true,""); timeMake.Focus(); @Status=1; btnDelete.Enabled = false; @ImportClicked = 0; timeMake.Enabled =false; tbCustomerNo.ReadOnly =true; tbNo.ReadOnly =false; cbLocation.Enabled =false; dgProduct.ReadOnly =true; dgRemark.ReadOnly =true; dgReportComment.ReadOnly =true; toolBar.EnableSubmit =false; toolBar.EnableNew =GetRight(@Title,"新增"); if(Search("SearchStockSettle",#SaleOutDepotBill.Date_SaleOutDepotBill)) { if(Equals(#SaleOutDepotBill.ID_Assessor, DBNull())) { if(#SaleOutDepotBill.Disable_SaleOutDepotBill==false) { toolBar.EnableAudit=GetRight(@Title,"审核"); toolBar.EnableModify=GetRight(@Title,"修改"); toolBar.EnableDelete=GetRight(@Title,"删除"); } else { toolBar.EnableAudit = false; toolBar.EnableModify = false; toolBar.EnableDelete = false; } toolBar.EnableUnAudit = false; btnDelete.Enabled = false; toolBar.EnablePrintBarCode=false; } else { toolBar.EnableAudit=false; toolBar.EnableUnAudit=GetRight(@Title,"取消审核"); toolBar.EnableModify=false; toolBar.EnableDelete=false; btnDelete.Enabled = GetRight(@Title,"取消审核")&&GetRight(@Title,"删除"); toolBar.EnablePrintBarCode=GetRight(@Title,"打印"); } toolBar.EnablePrint =GetRight(@Title,"打印"); } else { toolBar.EnablePrintBarCode=false; toolBar.EnableAudit=false; toolBar.EnableUnAudit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; btnDelete.Enabled = false; } toolBar.EnablePrint = GetRight(@Title,"打印"); toolBar.EnableExport = true; toolBar.EnableImport = false; if(Search("SearchCreateDate",#SaleOutDepotBill.No_SaleOutDepotBill,GetCurrentTime())) { if(!Equals(#searchcreatedate.CreateDate_SaleOutDepotBill,#searchcreatedate.CurrentDate)) toolBar.EnableCheck = false; else toolBar.EnableCheck = true; } UpdateForm(true, ""); @Status=2; @ImportClicked = 0; timeMake.Enabled =false; tbNo.ReadOnly =true; tbCustomerNo.ReadOnly =false; cbLocation.Enabled =true; dgProduct.ReadOnly =false; dgRemark.ReadOnly =false; dgReportComment.ReadOnly =false; toolBar.EnableSubmit =GetRight(@Title,"修改"); toolBar.EnableModify =false; toolBar.EnableDelete =false; toolBar.EnableAudit =false; toolBar.EnableUnAudit =false; toolBar.EnableNew =false; toolBar.EnablePrint =false; toolBar.EnablePrintBarCode =false; toolBar.EnableExport = false; toolBar.EnableImport = false; toolBar.EnableCheck = false; #SaleOutDepotBill.LastModUser_SaleOutDepotBill =GetLoginUserID(); #SaleOutDepotBill.Name_LastModUser =GetCurrentUser(); #SaleOutDepotBill.LastModDate_SaleOutDepotBill =DateTimeNow(); @HaveAccessed = !Equals(#SaleOutDepotBill.AssessDate_SaleOutDepotBill,DBNull()); dgProduct.SetColumnReadOnly(1, @HaveAccessed); dgProduct.SetColumnReadOnly(2, @HaveAccessed); dgProduct.SetColumnReadOnly(3, @HaveAccessed); dgProduct.SetColumnReadOnly(4, @HaveAccessed); dgProduct.AllowNew(!@HaveAccessed); dgProduct.AllowDelete(!@HaveAccessed); dgProduct.RowHeaderCheck=!@HaveAccessed; @HaveAccessed = !Equals(#SaleOutDepotBill.AssessDate_SaleOutDepotBill,DBNull()); UpdateForm(true, ""); @Status=3; btnDelete.Enabled = false;