; ; if(tbNo.ReadOnly == false) { if(tbNo.CValue != StringEmpty()) { UpdateForm(false, ""); if(Search("SearchPurchaseQueryBillWithNo", tbNo.CValue)) { ChangeMode("View"); } else { MessageBox("该采购询价单不存在!",@Title); } } else { MessageBox("请输入采购询价单号!", @Title); } } ShowSearchBox("BillSearch","NODEPOT", "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); } #PurchaseQueryBill.ID_Supplier=#Supplier.ID_Supplier; #PurchaseQueryBill.Name_Supplier=#Supplier.Name_Supplier; #PurchaseQueryBill.ShortName_Supplier=#Supplier.ShortName_Supplier; #PurchaseQueryBill.PostalCode_Supplier=#Supplier.PostalCode_Supplier; #PurchaseQueryBill.RegistedAddress_Supplier=#Supplier.RegistedAddress_Supplier; #PurchaseQueryBill.Name_Linkman=""; #PurchaseQueryBill.TaxCurrency_PurchaseQueryBill=#Supplier.LastTax_Supplier; Empty("#ReportComment"); Search("SearchTypeComment",#PurchaseQueryBill.ID_Supplier); MergeTable("#TypeComment","#ReportComment"); if(Search("SearchFocusLinkman",#Supplier.ID_Supplier)) { #PurchaseQueryBill.Name_Linkman=#Linkman.Name_Linkman; }else{ #PurchaseQueryBill.Name_Linkman=""; } if(Search("SearchFocusTelephone",#Supplier.ID_Supplier)) { #PurchaseQueryBill.Name_Telephone=#FocusTelephone.No_Telephone; }else{ #PurchaseQueryBill.Name_Telephone=""; } if(Search("SearchFocusFax",#Supplier.ID_Supplier)) { #PurchaseQueryBill.Fax_Telephone=#FocusFax.No_Fax; }else{ #PurchaseQueryBill.Fax_Telephone=""; } } } else { MessageBox("请输入供应商编号!",@Title); #PurchaseQueryBill.ID_Supplier=GuidEmpty(); #PurchaseQueryBill.ShortName_Supplier=""; #PurchaseQueryBill.Name_Principal=""; #PurchaseQueryBill.Name_Supplier=""; #PurchaseQueryBill.Name_Linkman=""; #PurchaseQueryBill.Name_Telephone=""; #PurchaseQueryBill.Fax_Telephone=""; #PurchaseQueryBill.PostalCode_Supplier=""; #PurchaseQueryBill.RegistedAddress_Supplier=""; tbNoSupplier.Focus(); } UpdateForm(true,""); UpdateForm(false, "cbPrincipal"); Search("SearchPrincipal"); UpdateForm(true, "cbPrincipal"); UpdateForm(false, "cbLinkman"); Search("SearchLinkman",#PurchaseQueryBill.ID_Supplier); UpdateForm(true, "cbLinkman"); UpdateForm(false, "cbTelephone"); Search("SearchTelephone",#PurchaseQueryBill.ID_Supplier); UpdateForm(true, "cbTelephone"); UpdateForm(false, "cbFax"); Search("SearchFax",#PurchaseQueryBill.ID_Supplier); UpdateForm(true, "cbFax"); @SetFlag=1; ShowSearchBox("ProductSearch","INFOMATION",#PurchaseQueryBillProduct.No_Product); @SetFlag=0; if(Search("SearchPurchaseQueryBillFirst")) { ChangeMode("View"); } if(Search("SearchPurchaseQueryBillPrev", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchPurchaseQueryBillNext",tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchPurchaseQueryBillLast")) { ChangeMode("View"); } ChangeMode("Search"); if(@AuditMode) { } ChangeMode("Modify"); Delete(); ChangeMode("Search"); ShowPrintBox("BillSearch",#PurchaseQueryBill.No_PurchaseQueryBill,#PurchaseQueryBill.No_PurchaseQueryBill); if(@AuditMode) return; BeginUnAudit(); #PurchaseQueryBill.ID_Assessor=DBNull(); #PurchaseQueryBill.Assessor=DBNull(); #PurchaseQueryBill.AssessDate_PurchaseQueryBill=DataTimeNow(); UnAudit(); ChangeMode("View"); EndUnAudit(); ; ; ; ; if(toolBar.MenuItemText=="采购订单") { ExportBillProductStart("#PurchaseOrderBillProduct.Type_FromBill",43,"#PurchaseOrderBillProduct.Name_BillType","询价单","#PurchaseOrderBillProduct.No_FromBill",#PurchaseQueryBill.No_PurchaseQueryBill,"#PurchaseOrderBill.No_Supplier",#PurchaseQueryBill.No_Supplier,"#PurchaseOrderBill.TaxCurrency_PurchaseOrderBill",#PurchaseQueryBill.TaxCurrency_PurchaseQueryBill,"#PurchaseOrderBill.No_Principal",#PurchaseQueryBill.No_Principal,"#PurchaseOrderBill.Name_Principal",#PurchaseQueryBill.Name_Principal); ExportBillProduct("dgProduct","#PurchaseQueryBillProduct","#PurchaseOrderBillProduct.No_Product","#PurchaseQueryBillProduct.No_Product","#PurchaseOrderBillProduct.No_FromBillProduct","#PurchaseQueryBillProduct.No_PurchaseQueryBillProduct"); } if(@SetFlag==0) { return; } if(#PurchaseQueryBillProduct.No_Product==StringEmpty() || !Search("SearchProduct",#PurchaseQueryBillProduct.No_Product)) { if(#PurchaseQueryBillProduct.No_Product!=StringEmpty()) MessageBox("该产品不存在!",@Title); #PurchaseQueryBillProduct.ID_Product=GuidEmpty(); #PurchaseQueryBillProduct.Name_Product=""; #PurchaseQueryBillProduct.Unit_Product=""; @temp = ShowSearchBox("InputSearchProduct","INFOMATION",#PurchaseQueryBillProduct.No_Product); if(@temp != "") { ResumeColumnEvent("#PurchaseQueryBillProduct.No_Product"); #PurchaseQueryBillProduct.No_Product = @temp; ClearColumnEvent(); } } else { if(!Equals(#Product.SuspendDate_Product,DBNull())) { MessageBox("该产品已停用!",@Title); } #PurchaseQueryBillProduct.ID_Product=#Product.ID_Product; #PurchaseQueryBillProduct.Name_Product=#Product.Name_Product; #PurchaseQueryBillProduct.Unit_Product=#Product.Unit_Product; } #PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct=FormatNumber(#PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct,@QuantityDecimal); #PurchaseQueryBillProduct.Money=FormatNumber(FormatNumber(#PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct,@QuantityDecimal)*FormatNumber(#PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct,@UnitPriceDecimal),@PriceDecimal); #PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct=FormatNumber(#PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct,@UnitPriceDecimal); #PurchaseQueryBillProduct.Money=FormatNumber(FormatNumber(#PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct,@QuantityDecimal)*FormatNumber(#PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct,@UnitPriceDecimal),@PriceDecimal);
@TaxCurrency=#PurchaseQueryBill.TaxCurrency_PurchaseQueryBill; UpdateForm(true, "tbNoSupplier"); tbNoSupplier.Focus(); ActiveControlEvent("tbNoSupplier", "Enter"); #PurchaseQueryBill.TaxCurrency_PurchaseQueryBill=@TaxCurrency; UpdateForm(true, "cbTaxCurrency");
Empty(); NewInstance(); tbNo.ReadOnly=false; timeMake.Enabled=false; dtpRespondDate.Enabled=false; dtpValidityDate.Enabled=false; tbNoSupplier.ReadOnly=true; cbTaxCurrency.Enabled=false; cbCurrency.Enabled=false; cbPrincipal.Enabled=false; cbLinkman.Enabled=false; cbTelephone.Enabled=false; cbFax.Enabled=false; dgProduct.ReadOnly=true; dgRemark.ReadOnly=true; dgReportComment.ReadOnly=true; txtNumSum.CValue=0.00; txtMoneySum.CValue=0.00; txtTaxSum.CValue=0.00; txtSum.CValue=0.00; cbTaxCurrency.Text=""; #PurchaseQueryBill.Creator=DBNull(); #PurchaseQueryBill.ID_Creator=DBNull(); #PurchaseQueryBill.Assessor=DBNull(); #PurchaseQueryBill.ID_Assessor=DBNull(); #PurchaseQueryBill.AssessDate_PurchaseQueryBill=DBNull(); #PurchaseQueryBill.LastModUser_PurchaseQueryBill=DBNull(); #PurchaseQueryBill.LastModUser=DBNull(); #PurchaseQueryBill.LastModDate_PurchaseQueryBill=DBNull(); toolBar.EnableSubmit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnableAudit=false; toolBar.EnableUnAudit=false; toolBar.EnablePrint=false; toolBar.EnableNew=GetRight(@Title,"新增"); toolBar.EnableExport = false; toolBar.EnableImport = false; UpdateForm(true,""); tbNo.Focus(); @Status=0; Empty(); NewInstance(); tbNo.ReadOnly=true; timeMake.Enabled=true; dtpRespondDate.Enabled=true; dtpValidityDate.Enabled=true; tbNoSupplier.ReadOnly=false; cbTaxCurrency.Enabled=true; cbCurrency.Enabled=false; cbPrincipal.Enabled=true; cbLinkman.Enabled=true; cbTelephone.Enabled=true; cbFax.Enabled=true; dgProduct.ReadOnly=false; dgRemark.ReadOnly=false; dgReportComment.ReadOnly=false; txtNumSum.CValue=0.00; txtMoneySum.CValue=0.00; txtTaxSum.CValue=0.00; txtSum.CValue=0.00; timeMake.Focus(); #PurchaseQueryBill.TaxCurrency_PurchaseQueryBill= "外加"; #PurchaseQueryBill.Currency_PurchaseQueryBill= @SysCurrency; #PurchaseQueryBill.ID_PurchaseQueryBill=NewGuid(); #PurchaseQueryBill.Creator=GetCurrentUser(); #PurchaseQueryBill.ID_Creator=GetLoginUserID(); #PurchaseQueryBill.Assessor=DBNull(); #PurchaseQueryBill.ID_Assessor=DBNull(); #PurchaseQueryBill.AssessDate_PurchaseQueryBill=DBNull(); #PurchaseQueryBill.LastModUser=DBNull(); #PurchaseQueryBill.LastModUser_PurchaseQueryBill=DBNull(); #PurchaseQueryBill.LastModDate_PurchaseQueryBill=DBNull(); #PurchaseQueryBill.Date_PurchaseQueryBill=GetCurrentTime(); 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; toolBar.EnableImport = true; SetColumnDefaultValue("PurchaseQueryBillProduct", "Quantity_PurchaseQueryBillProduct",1 ); UpdateForm(true,""); @Status=1; tbNo.ReadOnly=false; timeMake.Enabled=false; dtpRespondDate.Enabled=false; dtpValidityDate.Enabled=false; tbNoSupplier.ReadOnly=true; cbTaxCurrency.Enabled=false; cbCurrency.Enabled=false; cbPrincipal.Enabled=false; cbLinkman.Enabled=false; cbTelephone.Enabled=false; cbFax.Enabled=false; dgProduct.ReadOnly=true; dgRemark.ReadOnly=true; dgReportComment.ReadOnly=true; toolBar.EnableSubmit=false; toolBar.EnablePrint=GetRight(@Title,"打印"); toolBar.EnableNew=GetRight(@Title,"新增"); if(Equals(#PurchaseQueryBill.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; } toolBar.EnableExport = true; toolBar.EnableImport = false; tbNo.Focus(); UpdateForm(true, ""); @Status=2; tbNo.ReadOnly=true; timeMake.Enabled=false; dtpRespondDate.Enabled=true; dtpValidityDate.Enabled=true; tbNoSupplier.ReadOnly=false; cbCurrency.Enabled=false; cbPrincipal.Enabled=true; cbLinkman.Enabled=true; cbTelephone.Enabled=true; cbFax.Enabled=true; dgProduct.ReadOnly=false; dgRemark.ReadOnly=false; dgReportComment.ReadOnly=false; #PurchaseQueryBill.LastModUser=GetCurrentUser(); #PurchaseQueryBill.LastModUser_PurchaseQueryBill=GetLoginUserID(); #PurchaseQueryBill.LastModDate_PurchaseQueryBill=GetCurrentTime(); 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; toolBar.EnableImport = false; SetColumnDefaultValue("PurchaseQueryBillProduct", "Quantity_PurchaseQueryBillProduct",1 ); @HaveAccessed = !Equals(#PurchaseQueryBill.AssessDate_PurchaseQueryBill,DBNull()); if(@HaveAccessed) cbTaxCurrency.Enabled = false; else cbTaxCurrency.Enabled = true; UpdateForm(true, ""); @Status=3; BeginAudit(); #PurchaseQueryBill.ID_Assessor=GetLoginUserID(); #PurchaseQueryBill.Assessor=GetCurrentUser(); #PurchaseQueryBill.AssessDate_PurchaseQueryBill=DateTimeNow(); Audit(); ChangeMode("View"); EndAudit();