import clr
clr.AddReference('mscorlib')
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.K3.SCM.App')
clr.AddReference('Kingdee.BOS.DataEntity')
clr.AddReference('Kingdee.K3.BD.Contracts')
clr.AddReference('Kingdee.K3.SCM.Contracts')
from System import *
from Kingdee.BOS.Core.Metadata import *
from Kingdee.K3.SCM.App import *
from Kingdee.BOS.Orm.DataEntity import *
from Kingdee.K3.BD.Contracts import *
from Kingdee.K3.BD.Contracts.FIN import *
from Kingdee.K3.SCM.Contracts import *
def AfterCreateNewData(e):
#获取USD兌人民幣的系統匯率
myDate = this.View.Model.GetValue("FCreateDate")
finCommonService = ServiceFactory.GetService[IFINServiceForCommon](this.Context)
exchangeRate = finCommonService.GetExchangeBusRateAndDecimal(this.Context,7,1,1,myDate,myDate)
exchangeRateValue = Math.Round(exchangeRate.Key, exchangeRate.Value)
this.View.Model.SetValue("F_XVKJ_USD2RMB",exchangeRateValue,0)
本文转载自:https://vip.kingdee.com/article/595632004951815168?productLineId=1&isKnowledge=2&lang=zh-CN
作者:https://vip.kingdee.com/article/595632004951815168?productLineId=1&isKnowledge=2&lang=zh-CN
原文链接:https://vip.kingdee.com/article/595632004951815168?productLineId=1&isKnowledge=2&lang=zh-CN
推荐阅读