; ; ShowSearchBox("BillSearch","HAVEDEPOT", "tbNo",tbNo.CValue); UpdateForm(false,""); if(tbNoSupplier.CValue!=StringEmpty()) { if(!Search("SearchSupplier",tbNoSupplier.CValue)) { MessageBox("该供应商不存在!",@Title); @temp = ShowSearchBox("SupplierSearch","INFOMATION",tbNoSupplier.CValue); if(@temp != "") { tbNoSupplier.CValue = @temp; ActiveControlEvent("tbNoSupplier", "Enter"); } } else { if (!Equals(#Supplier.SuspendDate_Supplier,DBNull())) { MessageBox("该供应商已停用!",@Title); } #PurchaseInDepotBill.ID_Supplier=#Supplier.ID_Supplier; #PurchaseInDepotBill.ShortName_Supplier=#Supplier.ShortName_Supplier; } } else { MessageBox("请输入供应商编号!",@Title); #PurchaseInDepotBill.ID_Supplier=GuidEmpty(); #PurchaseInDepotBill.ShortName_Supplier=""; tbNoSupplier.Focus(); } UpdateForm(true,""); UpdateForm(false, "cbProposer"); Search("SearchPrincipal"); UpdateForm(true, "cbProposer"); UpdateForm(false, "cbLocation"); Search("SearchLocation"); UpdateForm(true, "cbLocation"); Search("SearchBillType"); SetDataGridColumnDataSource(1,"dgProduct"); @SetFlag=1; ShowSearchBox("ProductSearch","INFOMATION",#PurchaseInDepotBillProduct.No_Product); @SetFlag=0; @SetFlag1=1; @LocationNo = ShowSearchBox("LocationSearch","INFOMATION",#PurchaseInDepotBillProduct.No_Location); if(@LocationNo != "") #PurchaseInDepotBillProduct.No_Location = @LocationNo; @SetFlag1=0; if(Search("SearchPurchaseInDepotBillFirst")) { ChangeMode("View"); } if(Search("SearchPurchaseInDepotBillPrev", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchPurchaseInDepotBillNext",tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchPurchaseInDepotBillLast")) { ChangeMode("View"); } ChangeMode("Search"); ChangeMode("Modify"); txtNumSum.CValue=SumOfCol("#PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct"); Delete(); ChangeMode("Search"); ShowPrintBox("BillSearch",#PurchaseInDepotBill.No_PurchaseInDepotBill,#PurchaseInDepotBill.No_PurchaseInDepotBill); 0) { dgProduct.Focus(); MessageBox("该单据存在相同库位,审核失败!",@Title); ResumeLayout();return; } } ResumeLayout(); if(@StockAndInDepot==false) { SuspendLayout(); for (@i=0;@i if(#PurchaseInDepotBill.CostVerify_PurchaseInDepotBill == true) { @DialogResult=MessageBox("该单据已经成本核算,确定要取消审核吗?",@Title,MB_OKCANCEL); if(@DialogResult == DialogResult("CANCEL")) return; } BeginUnAudit(); #PurchaseInDepotBill.ID_Assessor=DBNull(); #PurchaseInDepotBill.Assessor=DBNull(); #PurchaseInDepotBill.AssessDate_PurchaseInDepotBill=DateTimeNow(); UnAudit(); ChangeMode("View"); EndUnAudit(); txtNumSum.CValue=SumOfCol("#PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct"); ; ; ; ; ; if(@SetFlag==0) { return; } if(#PurchaseInDepotBillProduct.No_Product!=StringEmpty()) { if(!Search("SearchProduct",#PurchaseInDepotBillProduct.No_Product)) { MessageBox("不存在此产品编号",@Title); #PurchaseInDepotBillProduct.ID_Product=GuidEmpty(); #PurchaseInDepotBillProduct.Name_Product=StringEmpty(); #PurchaseInDepotBillProduct.Unit_Product=StringEmpty(); @temp = ShowSearchBox("InputSearchProduct","INFOMATION",#PurchaseInDepotBillProduct.No_Product); if(@temp != "") { ResumeColumnEvent("#PurchaseInDepotBillProduct.No_Product"); #PurchaseInDepotBillProduct.No_Product = @temp; ClearColumnEvent(); } } else { if(!Equals(#Product.SuspendDate_Product,DBNull())) { MessageBox("该产品已停用!"); } #PurchaseInDepotBillProduct.ID_Product=#Product.ID_Product; #PurchaseInDepotBillProduct.Name_Product=#Product.Name_Product; #PurchaseInDepotBillProduct.Unit_Product=#Product.Unit_Product; if(Search("SearchOneLocation",#PurchaseInDepotBillProduct.No_Product)) { #PurchaseInDepotBillProduct.No_Location = #OneLocation.No_Location; #PurchaseInDepotBillProduct.Name_Location = #OneLocation.Name_Location; #PurchaseInDepotBillProduct.ID_Location = #OneLocation.ID_Location; } } }else{ #PurchaseInDepotBillProduct.ID_Product=GuidEmpty(); #PurchaseInDepotBillProduct.Name_Product=StringEmpty(); #PurchaseInDepotBillProduct.Unit_Product=StringEmpty(); } if(@SetFlag1==0) { return; } if(#PurchaseInDepotBillProduct.No_Location != StringEmpty()) { if(!Search("SearchLocationByNo",#PurchaseInDepotBillProduct.No_Location)) { MessageBox("不存在此库位编号",@Title); #PurchaseInDepotBillProduct.ID_Location=GuidEmpty(); #PurchaseInDepotBillProduct.Name_Location=StringEmpty(); } else { #PurchaseInDepotBillProduct.ID_Location=#Location.ID_Location; #PurchaseInDepotBillProduct.Name_Location=#Location.Name_Location; } } txtNumSum.CValue=SumOfCol("#PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct"); txtNumSum.CValue=SumOfCol("#PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct");
UpdateForm(true, "tbNoSupplier"); tbNoSupplier.Focus(); Search("SearchLocation"); cbLocation.Text = #PurchaseInDepotBill.Name_Location; ActiveControlEvent("tbNoSupplier", "Enter");
Empty(); NewInstance(); tbNo.ReadOnly=false; timeMake.Enabled=false; tbNoSupplier.ReadOnly=true; txtShortName.ReadOnly=true; cbProposer.Enabled=false; cbLocation.Enabled=false; dgProduct.ReadOnly=true; txtComment.ReadOnly=true; txtNumSum.CValue=0.00; ikLabel3.CValue="(未核算成本)"; #PurchaseInDepotBill.Creator=DBNull(); #PurchaseInDepotBill.ID_Creator=DBNull(); #PurchaseInDepotBill.Assessor=DBNull(); #PurchaseInDepotBill.ID_Assessor=DBNull(); #PurchaseInDepotBill.AssessDate_PurchaseInDepotBill=DBNull(); #PurchaseInDepotBill.LastModUser_PurchaseInDepotBill=DBNull(); #PurchaseInDepotBill.LastModUser=DBNull(); #PurchaseInDepotBill.LastModDate_PurchaseInDepotBill=DBNull(); toolBar.EnableSubmit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnableAudit=false; toolBar.EnableUnAudit=false; toolBar.EnableNew=GetRight(@Title,"新增"); toolBar.EnablePrint=false; toolBar.EnableImport = false; UpdateForm(true,""); @Status=0; Empty(); NewInstance(); tbNo.ReadOnly=true; timeMake.Enabled=true; timeMake.Focus(); cbProposer.Enabled=true; cbLocation.Enabled=true; dgProduct.ReadOnly=false; tbNoSupplier.ReadOnly=false; txtShortName.ReadOnly=false; txtComment.ReadOnly=false; txtNumSum.CValue=0.00; ikLabel3.CValue="(未核算成本)"; #PurchaseInDepotBill.ID_PurchaseInDepotBill=NewGuid(); #PurchaseInDepotBill.Creator=GetCurrentUser(); #PurchaseInDepotBill.ID_Creator=GetLoginUserID(); #PurchaseInDepotBill.Assessor=DBNull(); #PurchaseInDepotBill.ID_Assessor=DBNull(); #PurchaseInDepotBill.AssessDate_PurchaseInDepotBill=DBNull(); #PurchaseInDepotBill.LastModUser=DBNull(); #PurchaseInDepotBill.LastModUser_PurchaseInDepotBill=DBNull(); #PurchaseInDepotBill.LastModDate_PurchaseInDepotBill=DBNull(); #PurchaseInDepotBill.ID_Location=GetCurrentDepotID(); #PurchaseInDepotBill.Name_Location=GetCurrentDepot(); #PurchaseInDepotBill.No_Location=GetCurrentDepotNo(); #PurchaseInDepotBill.Date_PurchaseInDepotBill=GetCurrentTime(); toolBar.EnableSubmit=GetRight(@Title,"新增"); toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnableAudit=false; toolBar.EnableUnAudit=false; toolBar.EnableNew=false; toolBar.EnablePrint=false; toolBar.EnableImport = true; dgProduct.SetColumnReadOnly(1, false); dgProduct.SetColumnReadOnly(2, false); dgProduct.SetColumnReadOnly(3, false); dgProduct.SetColumnReadOnly(5, false); dgProduct.RowHeaderCheck=true; dgProduct.AllowNew(true); dgProduct.AllowDelete(true); UpdateForm(true,""); SetColumnDefaultValue("PurchaseInDepotBillProduct", "Quantity_PurchaseInDepotBillProduct",1 ); @Status=1; tbNo.ReadOnly=false; timeMake.Enabled=false; cbLocation.Enabled=false; cbProposer.Enabled=false; dgProduct.ReadOnly=true; tbNoSupplier.ReadOnly=true; txtShortName.ReadOnly=true; txtComment.ReadOnly=true; txtNumSum.CValue=SumOfCol("#PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct"); toolBar.EnableSubmit=false; toolBar.EnableNew=GetRight(@Title,"新增"); toolBar.EnableImport= false; if(Search("SearchStockSettle",#PurchaseInDepotBill.Date_PurchaseInDepotBill)) { toolBar.EnablePrint=GetRight(@Title,"打印"); if(Equals(#PurchaseInDepotBill.ID_Assessor, DBNull())) { toolBar.EnableAudit=GetRight(@Title,"审核"); toolBar.EnableUnAudit=false; toolBar.EnableModify=GetRight(@Title,"修改"); toolBar.EnableDelete=GetRight(@Title,"删除"); } else { toolBar.EnableAudit=false; toolBar.EnableUnAudit=GetRight(@Title,"取消审核"); toolBar.EnableModify=false; toolBar.EnableDelete=false; } } else { toolBar.EnablePrint=false; toolBar.EnableAudit=false; toolBar.EnableUnAudit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; } if(#purchaseInDepotBill.CostVerify_PurchaseInDepotBill==true) ikLabel3.CValue="(已核算成本)"; else ikLabel3.CValue="(未核算成本)"; UpdateForm(true, ""); @Status=2; tbNo.ReadOnly=true; timeMake.Enabled=false; cbLocation.Enabled=true; cbProposer.Enabled=true; dgProduct.ReadOnly=false; tbNoSupplier.ReadOnly=false; txtShortName.ReadOnly=false; txtComment.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.EnableImport = false; #PurchaseInDepotBill.LastModUser=GetCurrentUser(); #PurchaseInDepotBill.LastModUser_PurchaseInDepotBill=GetLoginUserID(); #PurchaseInDepotBill.LastModDate_PurchaseInDepotBill=GetCurrentTime(); @HaveAccessed = !Equals(#PurchaseInDepotBill.AssessDate_PurchaseInDepotBill,DBNull()); dgProduct.SetColumnReadOnly(1, @HaveAccessed); dgProduct.SetColumnReadOnly(2, @HaveAccessed); dgProduct.SetColumnReadOnly(3, @HaveAccessed); dgProduct.SetColumnReadOnly(5, @HaveAccessed); dgProduct.AllowNew(!@HaveAccessed); dgProduct.AllowDelete(!@HaveAccessed); dgProduct.RowHeaderCheck=!@HaveAccessed; UpdateForm(true, ""); SetColumnDefaultValue("PurchaseInDepotBillProduct", "Quantity_PurchaseInDepotBillProduct",1 ); @Status=3; 0) { dgProduct.Focus(); @DialogResult=MessageBox("该单据中存在相同库位,确定要提交吗?",@Title,MB_OKCANCEL); if(@DialogResult == DialogResult("CANCEL")) { ResumeLayout();return; } } } ResumeLayout(); if(@Status==1) { #PurchaseInDepotBill.CreateDate_PurchaseInDepotBill=GetCurrentTime(); #PurchaseInDepotBill.No_PurchaseInDepotBill = New("#PurchaseInDepotBill.No_PurchaseInDepotBill", timeMake.CValue); } else if(@Status==3) { #PurchaseInDepotBill.LastModUser=GetCurrentUser(); #PurchaseInDepotBill.LastModUser_PurchaseInDepotBill=GetLoginUserID(); #PurchaseInDepotBill.LastModDate_PurchaseInDepotBill=GetCurrentTime(); Update(); } ChangeMode("View"); ]]>