; ; ShowSearchBox("BillSearch","HAVEDEPOT", "tbNo",tbNo.CValue); UpdateForm(false, "cbLocation"); Search("SearchLocation"); UpdateForm(true, "cbLocation"); @SetFlag=1; ShowSearchBox("ProductSearch","INFOMATION",#StocktakingBillProduct.No_Product); @SetFlag=0; @SetFlag1=1; @LocationNo = ShowSearchBox("LocationSearch","INFOMATION",#StocktakingBillProduct.No_Location); if(@LocationNo != "") #StocktakingBillProduct.No_Location = @LocationNo; @SetFlag1=0; if(Search("SearchStocktakingBillFirst", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchStocktakingBillPrevious", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchStocktakingBillNext", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchStocktakingBillLast", tbNo.CValue)) { ChangeMode("View"); } @NewNumber=GetNextAutoNumber(true); if(@NewNumber != "") { ChangeMode("New"); tbNo.CValue=@NewNumber; } ChangeMode("Search"); ChangeMode("Modify"); Delete(); ChangeMode("Search"); ShowPrintBox("BillSearch",#StocktakingBill.No_StocktakingBill,#StocktakingBill.No_StocktakingBill,GetFieldRight(@Title,"单价","查看")); ; ; ; ; ; if(toolBar.MenuItemText=="库存异动作业") { ExportBillProductStart("#ModifyDepotBillProduct.Type_FromBill",4,"#ModifyDepotBillProduct.SourceBillName_ModifyDepotBillProduct","盘库单","#ModifyDepotBillProduct.No_FromBill",#StocktakingBill.No_StocktakingBill,"#ModifyDepotBill.ChangedDepot_ModifyDepotBill",#StocktakingBill.Name_Location); ExportBillProduct("dgProduct","#StocktakingBillProduct","#ModifyDepotBillProduct.No_FromBillProduct","#StocktakingBillProduct.No_StocktakingBillProduct"); } #StocktakingBillProduct.Account = #StocktakingBillProduct.Quantity_StocktakingBillProduct - #StocktakingBillProduct.StockQty_StocktakingBillProduct; #StocktakingBillProduct.Account = #StocktakingBillProduct.Quantity_StocktakingBillProduct - #StocktakingBillProduct.StockQty_StocktakingBillProduct; if(@SetFlag1==0) { return; } if(#StocktakingBillProduct.No_Location != StringEmpty()) { if(!Search("SearchLocationByNo", #StocktakingBillProduct.No_Location)) { MessageBox("不存在此库位编号",@Title); #StocktakingBillProduct.ID_Location=GuidEmpty(); #StocktakingBillProduct.Name_Location=StringEmpty(); } else { #StocktakingBillProduct.ID_Location=#Location.ID_Location; #StocktakingBillProduct.Name_Location=#Location.Name_Location; if(Search("SearchProductStocks", #StocktakingBillProduct.ID_Product, #Location.ID_Location)) #StocktakingBillProduct.StockQty_StocktakingBillProduct = #ProductStocks.StockQty_ProductStocks; } }
Empty(); NewInstance(); timeMake.Enabled =false; txtComment.ReadOnly =true; tbNo.ReadOnly =false; cbLocation.Enabled =false; dgProduct.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.EnableExport = false; #StocktakingBill.AssessDate_StocktakingBill =DBNull(); #StocktakingBill.ID_Assessor =DBNull(); #StocktakingBill.ID_Creator =DBNull(); #StocktakingBill.LastModUser_StocktakingBill =DBNull(); #StocktakingBill.LastModDate_StocktakingBill =DBNull(); UpdateForm(true,""); tbNo.Focus(); @Status=0; Empty(); NewInstance(); timeMake.Enabled =true; txtComment.ReadOnly =false; tbNo.ReadOnly =true; cbLocation.Enabled =true; dgProduct.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.EnableExport = false; #StocktakingBill.ID_StocktakingBill =NewGuid(); #StocktakingBill.ID_Creator =GetLoginUserID(); #StocktakingBill.Name_Creator =GetCurrentUser(); #StocktakingBill.AssessDate_StocktakingBill =DBNull(); #StocktakingBill.ID_Assessor =DBNull(); #StocktakingBill.LastModUser_StocktakingBill =DBNull(); #StocktakingBill.LastModUserName =DBNull(); #StocktakingBill.LastModDate_StocktakingBill =DBNull(); #StocktakingBill.ID_Location =GetCurrentDepotID(); #StocktakingBill.Name_Location =GetCurrentDepot(); #StocktakingBill.No_Location =GetCurrentDepotNo(); #StocktakingBill.Date_StocktakingBill =GetCurrentTime(); UpdateForm(true,""); timeMake.Focus(); @Status=1; timeMake.Enabled =false; txtComment.ReadOnly =true; tbNo.ReadOnly =false; cbLocation.Enabled =false; dgProduct.ReadOnly =true; toolBar.EnableSubmit =false; toolBar.EnableNew =GetRight(@Title,"新增"); if(Equals(#StocktakingBill.ID_Assessor, DBNull())) { toolBar.EnableUnAudit=false; toolBar.EnableAudit=GetRight(@Title,"审核"); toolBar.EnableModify=GetRight(@Title,"修改"); toolBar.EnableDelete=GetRight(@Title,"删除"); } else { toolBar.EnableAudit=false; toolBar.EnableUnAudit=GetRight(@Title,"取消审核"); toolBar.EnableDelete=false; toolBar.EnableModify=false; } toolBar.EnablePrint =GetRight(@Title,"打印"); toolBar.EnableExport = true; UpdateForm(true, ""); @Status=2; timeMake.Enabled =false; txtComment.ReadOnly =false; tbNo.ReadOnly =true; dgProduct.ReadOnly =false; cbLocation.Enabled =true; toolBar.EnableSubmit =GetRight(@Title,"修改"); toolBar.EnableModify =false; toolBar.EnableDelete =false; toolBar.EnableAudit =false; toolBar.EnableUnAudit =false; toolBar.EnableNew =false; toolBar.EnablePrint =false; toolBar.EnableExport = false; #StocktakingBill.LastModUser_StocktakingBill =GetLoginUserID(); #StocktakingBill.LastModUserName =GetCurrentUser(); #StocktakingBill.LastModDate_StocktakingBill =DateTimeNow(); UpdateForm(true, ""); @Status=3;