根据本位币和目标币别以及汇率类型获取汇率

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-23浏览:1

根据本位币和目标币别以及汇率类型获取汇率

@[TOC](目录) ### 1、前提 目标币别与本位币之间需要维护”汇率体系“ 准备好本位币、目标币别、汇率类型字段 ### 2、python案例 ```python import clr clr.AddReference('mscorlib') clr.AddReference('Kingdee.K3.BD.Contracts') from System import * from Kingdee.K3.BD.Contracts import * from Kingdee.K3.BD.Contracts.FIN import * def AfterBindData(e): SetExchangeRate() def DataChanged(e): if e.Field.Key == "FLocalCurrId" or e.Field.Key == "FExchangeTypeId" or e.Field.Key == "FCurrencyId": this.View.Model.SetValue("FExchangeRate",0)#先清空 SetExchangeRate() def SetExchangeRate(): locCurr = this.View.Model.GetValue("FLocalCurrId")#本位币 exchangeType = this.View.Model.GetValue("FExchangeTypeId")#汇率类型 setCurr = this.View.Model.GetValue("FCurrencyId")#目标币别 if locCurr == None or exchangeType == None or setCurr == None: return locCurrId = int(locCurr["Id"]) exchangeTypeId = int(exchangeType["Id"]) setCurrId = int(setCurr["Id"]) billdate = this.View.Model.GetValue("FDate")#业务日期 if locCurrId == setCurrId: this.View.Model.SetValue("FExchangeRate", 1)#设置汇率 else: service = ServiceFactory.GetService[IFINServiceForCommon](this.Context) rateNDec = service.GetExchangeBusRateAndDecimal(this.Context, setCurrId, locCurrId, exchangeTypeId, billdate, billdate) this.View.Model.SetValue("FExchangeRate", rateNDec.Key)#设置汇率 this.View.GetFieldEditor("FExchangeRate", 0).Scale = int(rateNDec.Value)#设置精度 this.View.InvokeFieldUpdateService("FExchangeRate", 0) ```

根据本位币和目标币别以及汇率类型获取汇率

@[TOC](目录)### 1、前提目标币别与本位币之间需要维护”汇率体系“准备好本位币、目标币别、汇率类型字段### 2、python案例```pythonimp...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息