package com.yem.wm.bc.bill.from;

import com.yem.wm.bc.common.CommonUtils;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.datamodel.IDataModel;
import kd.sdk.plugin.Plugin;

import java.util.EventObject;

/**
 * 财务信息模板 表单插件
 */
public class YemEsBillTemplateFiEdit extends AbstractBillPlugIn implements Plugin {

    @Override
    public void afterCreateNewData(EventObject e) {
        super.afterCreateNewData(e);
        IDataModel model = this.getModel();
        DynamicObject org = (DynamicObject) model.getValue("org");
        long org_id = org.getLong("id");
        DynamicObject basecurrrency = CommonUtils.getBaseCurrrency(org_id);
        model.setValue("yem_currencybase",basecurrrency);
        DynamicObject exratetable = CommonUtils.getExratetable(org_id);
        model.setValue("yem_exratetable",exratetable);
    }
}