ShowSearchBox("BillSearch","NODEPOT", "tbNo",tbNo.CValue); 0) { #PriceQueryBill.Name_Linkman = #Linkman.Name_Linkman; } else { #PriceQueryBill.Name_Linkman = DBNull(); } if (RowCount("Telephone") > 0) { #PriceQueryBill.Name_Telephone = #Telephone.No_Telephone; } else { #PriceQueryBill.Name_Telephone = DBNull(); } if (RowCount("Fax") > 0) { #PriceQueryBill.Fax_Telephone = #Fax.No_Fax; } else { #PriceQueryBill.Fax_Telephone = DBNull(); } } UpdateForm(true, ""); } ]]> UpdateForm(false, "ntbDiscount"); if(!@viewMode) { } UpdateForm(false, "cbPrincipal"); Search("SearchAllPrincipal"); UpdateForm(true, "cbPrincipal"); UpdateForm(false, "cbLinkman"); Search("SearchLinkman", tbCustomerNo.CValue); UpdateForm(true, "cbLinkman"); UpdateForm(false, "cbTele"); Search("SearchTele", tbCustomerNo.CValue); UpdateForm(true, "cbTele"); UpdateForm(false, "cbFax"); Search("SearchFax", tbCustomerNo.CValue); UpdateForm(true, "cbFax"); @SetFlag=1; ShowSearchBox("ProductSearch","INFOMATION",#PriceQueryBillProduct.No_Product); @SetFlag=0; if(Search("SearchPriceQueryBillFirst",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight(@Title,"最低报价","查看"),GetCurrentUser())) { ChangeMode("View"); } if (Search("SearchPriceQueryBillPrevious", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight(@Title,"最低报价","查看"),GetCurrentUser())) { ChangeMode("View"); } if (Search("SearchPriceQueryBillNext", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight(@Title,"最低报价","查看"),GetCurrentUser())) { ChangeMode("View"); } if (Search("SearchPriceQueryBillLast",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight(@Title,"最低报价","查看"),GetCurrentUser())) { ChangeMode("View"); } ChangeMode("Search"); if(@AuditMode) { } Search("SearchPrincipal", tbCustomerNo.CValue); ChangeMode("Modify"); Delete(); ChangeMode("Search"); ShowPrintBox("BillSearch",#PriceQueryBill.No_PriceQueryBill,#PriceQueryBill.No_PriceQueryBill); if(@AuditMode) return; BeginUnAudit(); #PriceQueryBill.ID_Assessor = DBNull(); #PriceQueryBill.Name_Assessor = ""; UnAudit(); ChangeMode("View"); EndUnAudit(); ; ; ; if(toolBar.ExpandForm==true) { pnRight.Visible=true; } else { pnRight.Visible=false; } if(toolBar.MenuItemText=="销货单") { ExportBillProductStart("#SaleBillProduct.Type_FromBill",23,"#SaleBillProduct.Name_BillType","报价单","#SaleBillProduct.No_FromBill",#PriceQueryBill.No_PriceQueryBill,"#SaleBill.No_Customer",#PriceQueryBill.No_Customer,"#SaleBill.TaxCurrency_SaleBill",#PriceQueryBill.TaxCurrency_PriceQueryBill); ExportBillProduct("dgProduct","#PriceQueryBillProduct","#SaleBillProduct.No_FromBillProduct","#PriceQueryBillProduct.No_PriceQueryBillProduct"); } else if(toolBar.MenuItemText=="采购订单") { ExportBillProductStart("#PurchaseOrderBill.No_Supplier",#PriceQueryBill.No_Customer,"#PurchaseOrderBillProduct.Comment_PurchaseOrderBillProduct",#PriceQueryBill.No_PriceQueryBill,"#PurchaseOrderBill.TaxCurrency_PurchaseOrderBill",#PriceQueryBill.TaxCurrency_PriceQueryBill); ExportBillProduct("dgProduct","#PriceQueryBillProduct","#PurchaseOrderBillProduct.No_Product","#PriceQueryBillProduct.No_Product"); } else if(toolBar.MenuItemText=="询价单") { ExportBillProductStart("#PurchaseQueryBill.No_Supplier",#PriceQueryBill.No_Customer,"#PurchaseQueryBillProduct.Comment_PurchaseQueryBillProduct",#PriceQueryBill.No_PriceQueryBill,"#PurchaseQueryBill.TaxCurrency_PurchaseQueryBill",#PriceQueryBill.TaxCurrency_PriceQueryBill); ExportBillProduct("dgProduct","#PriceQueryBillProduct","#PurchaseQueryBillProduct.No_Product","#PriceQueryBillProduct.No_Product"); } #PriceQueryBillProduct.Quantity_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.Quantity_PriceQueryBillProduct, @PriceDecimal); #PriceQueryBillProduct.Amount_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct * #PriceQueryBillProduct.Quantity_PriceQueryBillProduct, #SystemSetting.PriceDecimal_SystemSetting); #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct, @PriceDecimal); if(#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct==0) #PriceQueryBillProduct.Discount_PriceQueryBillProduct=100; else #PriceQueryBillProduct.Discount_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct/#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct*100,@PriceDecimal); #PriceQueryBillProduct.Amount_PriceQueryBillProduct = FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct * #PriceQueryBillProduct.Quantity_PriceQueryBillProduct, #SystemSetting.PriceDecimal_SystemSetting); if(#PriceQueryBillProduct.Discount_PriceQueryBillProduct==0) { if(Search("SearchRelation",#PriceQueryBillProduct.No_Product,tbCustomerNo.CValue)) { if(cbTaxCurrency.Text=="内含") #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct=#PriceReference.UnitPriceWithTax_PriceReference; else #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = #PriceReference.UnitPrice_PriceReference; if(#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct==0) #PriceQueryBillProduct.Discount_PriceQueryBillProduct=100; else #PriceQueryBillProduct.Discount_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct/#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct*100,@PriceDecimal); } else { #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = #PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct; #PriceQueryBillProduct.Discount_PriceQueryBillProduct=100; } } else { #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = FormatNumber(#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct*#PriceQueryBillProduct.Discount_PriceQueryBillProduct/100,@PriceDecimal); } #PriceQueryBillProduct.Amount_PriceQueryBillProduct = FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct * #PriceQueryBillProduct.Quantity_PriceQueryBillProduct,#SystemSetting.PriceDecimal_SystemSetting);
if(GetRight("客户基本资料","全权查看")) { FormatString(""); } else { FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID()); } if(GetRight("客户基本资料","全权查看")) { FormatString(""); } else { FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID()); }
Empty(); NewInstance(); dtpDate.Enabled = false; tbNo.ReadOnly = false; tbCustomerNo.ReadOnly = true; dtpQueryDate.Enabled = false; ntbDiscount.ReadOnly = true; dtpValidDate.Enabled = false; cbTaxCurrency.Enabled = false; cbPrincipal.Enabled = false; cbLinkman.Enabled = false; cbTele.Enabled = false; cbFax.Enabled = false; txtSendAddr.ReadOnly = true; dgProduct.ReadOnly = true; dgRemark.ReadOnly = true; dgReport.ReadOnly = true; ckSpecial.Enabled=false; toolBar.EnableNew = GetRight(@Title,"新增"); toolBar.EnableSubmit = false; toolBar.EnableModify = false; toolBar.EnableDelete = false; toolBar.EnableAudit = false; toolBar.EnablePrint = false; toolBar.EnableUnAudit = false; toolBar.EnableExport = false; toolBar.EnableImport = false; #PriceQueryBill.ToGet_PriceQueryBill = 0; #PriceQueryBill.Discount_PriceQueryBill = 0; #PriceQueryBill.TaxCurrency_PriceQueryBill = ""; #PriceQueryBill.Currency_PriceQueryBill = ""; #PriceQueryBill.AssessDate_PriceQueryBill = DBNull(); #PriceQueryBill.LastModUser_PriceQueryBill = DBNull(); #PriceQueryBill.LastModDate_PriceQueryBill = DBNull(); #PriceQueryBill.NumSum = 0; #PriceQueryBill.ValidDate_PriceQueryBill = #PQDate.ValiDate; UpdateForm(true, ""); tbNo.Focus(); @Status = 0; Empty(); NewInstance(); @viewMode = false; dtpDate.Enabled = true; tbNo.ReadOnly = true; tbCustomerNo.ReadOnly = false; dtpQueryDate.Enabled = true;; ntbDiscount.ReadOnly = false; cbTaxCurrency.Enabled = true; dtpValidDate.Enabled = true; cbPrincipal.Enabled = true; cbLinkman.Enabled = true; cbTele.Enabled = true; cbFax.Enabled = true; txtSendAddr.ReadOnly = false; dgProduct.ReadOnly = false; dgRemark.ReadOnly = false; dgReport.ReadOnly = false; ckSpecial.Enabled=GetFieldRight(@Title,"最低报价","修改"); toolBar.EnableNew = false; toolBar.EnableSubmit = GetRight(@Title,"新增"); toolBar.EnableModify = false; toolBar.EnableDelete = false; toolBar.EnableAudit = false; toolBar.EnableUnAudit = false; toolBar.EnableExport = false; toolBar.EnableImport = true; toolBar.EnablePrint = false; #PriceQueryBill.ID_PriceQueryBill = NewGuid(); #PriceQueryBill.ToGet_PriceQueryBill = 0; #PriceQueryBill.Discount_PriceQueryBill = 100; #PriceQueryBill.TaxCurrency_PriceQueryBill = "外加"; #PriceQueryBill.Currency_PriceQueryBill = @SysCurrency; #PriceQueryBill.ID_Creator = GetLoginUserID(); #PriceQueryBill.Name_Creator = GetCurrentUser(); #PriceQueryBill.ID_Assessor = DBNull(); #PriceQueryBill.AssessDate_PriceQueryBill = DBNull(); #PriceQueryBill.LastModUser_PriceQueryBill = DBNull(); #PriceQueryBill.LastModDate_PriceQueryBill = DBNull(); #PriceQueryBill.ID_Principal = DBNull(); #PriceQueryBill.NumSum = 0; #PriceQueryBill.ValidDate_PriceQueryBill = #PQDate.ValiDate; #PriceQueryBill.Date_PriceQueryBill = GetCurrentTime(); SetColumnDefaultValue("PriceQueryBillProduct", "Discount_PriceQueryBillProduct", #PriceQueryBill.Discount_PriceQueryBill); SetColumnDefaultValue("PriceQueryBillProduct", "Quantity_PriceQueryBillProduct", 1); UpdateForm(true, ""); dtpDate.Focus(); @Status = 1; @viewMode = true; dtpDate.Enabled = false; tbNo.ReadOnly = false; tbCustomerNo.ReadOnly = true; ntbDiscount.ReadOnly = true; dtpValidDate.Enabled = false; dtpQueryDate.Enabled = false; cbTaxCurrency.Enabled = false; cbPrincipal.Enabled = false; cbLinkman.Enabled = false; cbTele.Enabled = false; cbFax.Enabled = false; txtSendAddr.ReadOnly = true; dgProduct.ReadOnly = true; dgRemark.ReadOnly = true; dgReport.ReadOnly = true; ckSpecial.Enabled=false; toolBar.EnableNew = GetRight(@Title,"新增"); toolBar.EnableSubmit = false; toolBar.EnablePrint = true; if(Equals(#PriceQueryBill.ID_Assessor, DBNull())) { toolBar.EnableModify = GetRight(@Title,"修改"); toolBar.EnableDelete = GetRight(@Title,"删除"); toolBar.EnableAudit = GetRight(@Title,"审核"); toolBar.EnableUnAudit = false; } else { toolBar.EnableModify = false; toolBar.EnableDelete = false; toolBar.EnableAudit = false; toolBar.EnableUnAudit = GetRight(@Title,"取消审核"); } toolBar.EnableExport = true; toolBar.EnableImport = false; UpdateForm(true, ""); @Status = 2; tbNo.Focus(); @viewMode = false; dtpDate.Enabled = false; tbNo.ReadOnly = true; tbCustomerNo.ReadOnly = false; ntbDiscount.ReadOnly = false; dtpQueryDate.Enabled = true; dtpValidDate.Enabled = true; cbPrincipal.Enabled = true; cbLinkman.Enabled = true; cbTele.Enabled = true; cbFax.Enabled = true; txtSendAddr.ReadOnly = false; dgProduct.ReadOnly = false; dgRemark.ReadOnly = false; dgReport.ReadOnly = false; ckSpecial.Enabled=GetFieldRight(@Title,"最低报价","修改"); toolBar.EnableNew = false; toolBar.EnableSubmit = GetRight(@Title,"新增"); toolBar.EnableModify = false; toolBar.EnableDelete = false; toolBar.EnableAudit = false; toolBar.EnableUnAudit = false; toolBar.EnableExport = false; toolBar.EnablePrint = false; toolBar.EnableImport = false; #PriceQueryBill.LastModUser_PriceQueryBill = GetLoginUserID(); #PriceQueryBill.LastModUserName = GetCurrentUser(); #PriceQueryBill.LastModDate_PriceQueryBill = DateTimeNow(); SetColumnDefaultValue("PriceQueryBillProduct", "Discount_PriceQueryBillProduct", #PriceQueryBill.Discount_PriceQueryBill); SetColumnDefaultValue("PriceQueryBillProduct", "Quantity_PriceQueryBillProduct", 1); @HaveAccessed = !Equals(#PriceQueryBill.AssessDate_PriceQueryBill,DBNull()); if(@HaveAccessed) cbTaxCurrency.Enabled = false; else cbTaxCurrency.Enabled = true; UpdateForm(true, ""); @Status = 3; =0;@i=@i-1) { SetPosition("#BillComment", @i); if(#BillComment.Comment_BillComment=="") { DeleteRow( "#BillComment",@i); continue; } if (Equals(#BillComment.ID_BillComment,GuidEmpty())) #BillComment.ID_BillComment = NewGuid(); #BillComment.ID_Bill = #PriceQueryBill.ID_PriceQueryBill; } for (@i=0;@i 0) { SuspendLayout(); for (@a=0;@a BeginAudit(); #PriceQueryBill.ID_Assessor = GetLoginUserID(); #PriceQueryBill.Name_Assessor = GetCurrentUser(); #PriceQueryBill.AssessDate_PriceQueryBill = DateTimeNow(); Audit(); ChangeMode("View"); EndAudit();