获取核算组织的本位币示例
一、【业务需求】
单据扩展本位币的字段,新增单据时,如何让这个字段自动赋值为账套的本位币种?
二、【分析实现】
1、根据组织取到默认会计政策下面默认的本位币和汇率类型
两种方式:
调用财务领域的服务
Kingdee.K3.BD.Contracts.FIN.IFINServiceForCommon service = Kingdee.K3.BD.Contracts.ServiceFactory.GetService<Kingdee.K3.BD.Contracts.FIN.IFINServiceForCommon>(ctx); return service.GetDefCurrencyAndExchangeTypeByBizOrgID(ctx, subOrgId);
调用供应链领域CommonServiceHelper,引用组件(Kingdee.K3.SCM.ServiceHelper.dll)
CommonServiceHelper.GetDefCurrencyAndExchangeTypeByBizOrgID(this.View.Context, orgId)
返回JSONObject类型,其中
FRateType:汇率类型
FCyForID:本位币内码
FCyForCode: 本位币编码
2、调拨申请单扩展本位币字段,二开表单插件
public override void AfterCreateModelData(EventArgs e) { if (this.View.OpenParameter.Status == OperationStatus.ADDNEW) { if (this.View.OpenParameter.CreateFrom != CreateFrom.Push) { DynamicObject apporg = this.Model.GetValue("FAPPORGID") as DynamicObject; long orgId = apporg == null ? 0 : Convert.ToInt64(apporg["Id"]); JSONObject objk = CommonServiceHelper.GetDefCurrencyAndExchangeTypeByBizOrgID(this.View.Context, orgId); this.View.Model.SetValue("FBaseCurrId", objk["FCyForID"]); } } }
Python:
import clr clr.AddReference("System") clr.AddReference("System.Core") clr.AddReference("Kingdee.BOS") clr.AddReference("Kingdee.BOS.Core") clr.AddReference('Kingdee.K3.SCM.ServiceHelper') from System import * from Kingdee.BOS.Core import * from Kingdee.K3.SCM.ServiceHelper import * def AfterCreateModelData(e): if this.View.OpenParameter.Status == OperationStatus.ADDNEW and this.View.OpenParameter.CreateFrom != CreateFrom.Push: apporg = this.Model.GetValue("FAPPORGID") if apporg != None: orgId = Convert.ToInt64(apporg["Id"]) objk = CommonServiceHelper.GetDefCurrencyAndExchangeTypeByBizOrgID(this.View.Context, orgId) this.View.Model.SetValue("FBaseCurrId", objk["FCyForID"])
获取核算组织的本位币示例
一、【业务需求】单据扩展本位币的字段,新增单据时,如何让这个字段自动赋值为账套的本位币种?二、【分析实现】1、根据组织取到默认会计...
点击下载文档
本文2024-09-16 19:03:02发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-26074.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章