public static ExchangeRateType Create(ExchangeRateTypesEnum enumItem) { return(new ExchangeRateType { Name = enumItem.ToString() }); }
public bool IsEqual(ExchangeRateTypesEnum enumItem) { return(this.Name == enumItem.ToString()); }
private void CreateSOLines(Organization org, SOInfo soInfo, SaleOrderDTO dtoSO, Customer customer) { CustomerSite cs = CustomerSite.Finder.Find("Customer ='" + customer.ID + "'"); CustomerSiteMISCInfo customerSite = new CustomerSiteMISCInfo(); customerSite.CustomerSite = cs; customerSite.Code = cs.Code; customerSite.Name = cs.Name; foreach (var itemLine in soInfo.Lines) { UFIDA.U9.ISV.SM.SOLineDTO soLine = new UFIDA.U9.ISV.SM.SOLineDTO(); //料品 soLine.ItemInfo = new UFIDA.U9.CBO.SCM.Item.ItemInfo(); ItemMaster beItemMaster = ItemMaster.Finder.Find("Code = @code and Org = @orgID", new OqlParam[2] { new OqlParam(itemLine.ItemMasterCode), new OqlParam(org.ID) }); if (beItemMaster == null) { throw new Exception(string.Format("物料编码{0}在U9中不存在", itemLine.ItemMasterCode)); } soLine.ItemInfo.ItemID = beItemMaster; //soLine.BomOwner = new UFIDA.U9.CBO.Pub.Controller.CommonArchiveDataDTO(); //soLine.BomOwner.ID = org.ID; //soLine.BomOwner.Code = org.Code; //soLine.BomOwner.Name = org.Name; //数量 soLine.ChoiceResult = 0; soLine.OrderByQtyTU = itemLine.Qty; //扩展字段 soLine.DescFlexField = new UFIDA.U9.Base.FlexField.DescFlexField.DescFlexSegments(); //收款条件 if (customer.RecervalTerm != null) { soLine.RecTerm = new CommonArchiveDataDTO(); soLine.RecTerm.Code = customer.RecervalTerm.Code; } //立账位置 if (customer.CustomerSites != null) { if (customer.CustomerSites.Count > 0) { soLine.BillToSite = customerSite; soLine.BillToSite.Code = customerSite.Code; soLine.BillToSite.CustomerSiteKey = customerSite.CustomerSiteKey; } } //定价方式 soLine.CooperatePriceStyle = -1; //免费品类型 soLine.FreeType = FreeTypeEnum.GetFromValue(-1); //免费品原因 soLine.FreeReason = DonationReasonEnum.GetFromValue(-1); //台阶划分依据 soLine.StepBy = -1; //预收环节 soLine.PreRecObject = -1; //原币-额币 soLine.TCToCCExchRateType = ExchangeRateTypesEnum.GetFromValue(0); //来源单据类别 soLine.SrcDocType = SOSourceTypeEnum.GetFromValue(0); //成套收发货标志 soLine.ShipTogetherFlag = KITShipModeEnum.GetFromValue(-1); //数量类型 soLine.QuantityType = UsageQuantityTypeEnum.GetFromValue(-1); //资源成本计费基础 soLine.ChargeBasis = ChargeBasisEnum.GetFromValue(-1); //价格来源 soLine.PriceSource = PriceSourceEnum.GetFromValue(1); //是否消耗信用额度 soLine.IsEngrossCreditLimit = true; //添加销售订单上的计划行 soLine.SOShiplines = new List <SOShipLineDTO>(); SOShipLineDTO soship = new SOShipLineDTO(); soship.ItemInfo = new UFIDA.U9.CBO.SCM.Item.ItemInfo(); soship.ItemInfo.ItemID = beItemMaster; soship.ItemInfo.ItemCode = beItemMaster.Code; soship.ItemInfo.ItemName = beItemMaster.Name; soship.RequireDate = DateTime.Parse(itemLine.DeliveryDate); soship.DescFlexField = new UFIDA.U9.Base.FlexField.DescFlexField.DescFlexSegments(); //区域位置 soship.ShipToSite = new CustomerSiteMISCInfo(); soship.ShipToSite.CustomerSite = customerSite.CustomerSite; soship.ShipToSite.Code = customerSite.Code; soship.ShipToSite.Name = customerSite.Name; //单价 soLine.OrderPriceTC = itemLine.TCPrice; soLine.SOShiplines.Add(soship); dtoSO.SOLines.Add(soLine); } }