下推时在单据转换插件中获取本位币、汇率类型、汇率信息

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

下推时在单据转换插件中获取本位币、汇率类型、汇率信息

@[TOC](目录) ### 1、前提 目标币别与本位币之间需要维护”汇率体系“ ### 2、注册单据转换的插件策略 ![image.webp](/download/0100f995e856f4304152bddea6e4c14fc3f0.webp) ### 3、Python参考脚本 ```python 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 AfterConvert(e): billdatas = e.Result.FindByEntityKey("FBillHead") for billdata in billdatas: SetLocalCurrAndExchangeTypeAndExchangeRate(e,billdata) def SetLocalCurrAndExchangeTypeAndExchangeRate(e,billdata): fin = billdata["InStockFin"][0] stockOrgId = billdata["StockOrgId_Id"] currencyId = fin["SettleCurrId_Id"] commonService =ServiceHelper.GetService[ICommonService]() localCurrId = commonService.GetDefaultCurrencyByBizOrgID(this.Context, stockOrgId) fin["LocalCurrId_Id"] = localCurrId localCurrIdField = e.TargetBusinessInfo.GetField("FLocalCurrId") FieldUtils.SetBaseDataFieldValue(this.Context, localCurrIdField, fin, localCurrId) exchangeTypeId = commonService.GetDefaultExchangeTypeByBizOrgID(this.Context, stockOrgId) fin["ExchangeTypeId_Id"] = exchangeTypeId exchangeTypeIdField = e.TargetBusinessInfo.GetField("FExchangeTypeId") FieldUtils.SetBaseDataFieldValue(this.Context, exchangeTypeIdField, fin, exchangeTypeId) finCommonService = ServiceFactory.GetService[IFINServiceForCommon](this.Context) exchangeRate = finCommonService.GetExchangeBusRateAndDecimal(this.Context,localCurrId,currencyId,exchangeTypeId,billdata["CreateDate"],billdata["CreateDate"]) fin["ExchangeRate"] = Math.Round(exchangeRate.Key, exchangeRate.Value) ``` ==该示例代码说明见上图,图中有备注== **其他更多文章入口:**[https://vip.kingdee.com/link/s/lbRPP](https://vip.kingdee.com/link/s/lbRPP)

下推时在单据转换插件中获取本位币、汇率类型、汇率信息

@[TOC](目录)### 1、前提目标币别与本位币之间需要维护”汇率体系“### 2、注册单据转换的插件策略![image.webp](/download/0100f995e856...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息