根据本位币和目标币别以及汇率类型获取汇率
@[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...
点击下载文档
本文2024-09-23 02:38:23发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-153746.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章