返工工单生产用料清单成品不参与MRP运算

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

返工工单生产用料清单成品不参与MRP运算

返工工单领料单直接领产品本身, 不需要参与MRP运算


 clr.AddReference('Kingdee.BOS')
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.BOS.Log')
clr.AddReference('Kingdee.BOS.ServiceHelper')


from Kingdee.BOS import *
from Kingdee.BOS.Core import *
from Kingdee.BOS.Log import *
from Kingdee.BOS.ServiceHelper import *


def OnPreparePropertys(e):
    e.FieldKeys.Add("FMOType");
    e.FieldKeys.Add("FMATERIALID");
    e.FieldKeys.Add("FISMRPRUN");

def BeginOperationTransaction(e):
    billDatas = e.DataEntitys;
    if len(billDatas)>0:
        for billData in billDatas:
            moBillType=billData["MOType_Id"];
            #raise Exception(str(moBillType));
            billTypePara = BusinessDataServiceHelper.LoadBillTypePara(this.Context, "MoBillTypeParaSetting",moBillType);
            
            #raise Exception(str(billTypePara["ProductType"]));
            #Logger.Info("CS002", str(IsEntrust));
            if (str(billTypePara["ProductType"])== '2'):#返工工单
                    PMaterial = billData["MaterialID"]["Number"] #成品物料
                    entryDatas = billData["PPBomEntry"];
                    #raise Exception(str(PMaterial))
                    for entryData in entryDatas:
                        SMaterial = entryData["MaterialID"]["Number"]#子项物料
                        if PMaterial == SMaterial:
                            entryData["ISMRPRUN"] = 0 #不勾选MRP运算
                            entryData["SupplyOrg_Id"] = 1 #修改发料组织
                            #raise Exception(str(entryData["SupplyOrg"]["Number"]))
                            #raise Exception(str(entryData["ISMRPRUN"] ))
                         

返工工单生产用料清单成品不参与MRP运算

返工工单领料单直接领产品本身, 不需要参与MRP运算 clr.AddReference('Kingdee.BOS')clr.AddReference('Kingdee.BOS.Core')clr.AddRefere...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息