简单的币别换算取汇率方法
//结算币别主键
long SettleCurrId_Id= 单据币别主键;
//信用档案币别主键
long LocalCurrId_Id=信用档案币别
//汇率类型
ICommonService commonService = ServiceHelper.GetService<ICommonService>();
long saleOrgId=销售组织id;
long ExchangeTypeId_Id = commonService.GetDefaultExchangeTypeByBizOrgID(this.Context, saleOrgId);
//汇率
IFINServiceForCommon finCommonService = K3.BD.Contracts.ServiceFactory.GetService<IFINServiceForCommon>(this.Context);
try
{
DateTime dtNow = ServiceHelper.GetService<ITimeService>().GetSystemDateTime(this.Context);
KeyValuePair<decimal, int> exchangeRate = finCommonService.GetExchangeBusRateAndDecimal(this.Context,
Convert.ToInt64(LocalCurrId_Id=),
Convert.ToInt64(SettleCurrId_Id= ),
Convert.ToInt64(ExchangeTypeId_Id),
dtNow,
dtNow);
//得到汇率
decimal ExchangeRate=System.Math.Round(exchangeRate.Key, exchangeRate.Value);
}
简单的币别换算取汇率方法
本文2024-09-16 18:07:19发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-20083.html