生产领料单实发数不能有小数保存服务插件
#引入clr运行库
import clr
#添加对cloud插件开发的常用组件的引用
clr.AddReference('System')
clr.AddReference('System.Data')
clr.AddReference('Kingdee.BOS')
clr.AddReference('Kingdee.BOS.DataEntity')
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.BOS.App')
clr.AddReference('Kingdee.BOS.App.Core')
clr.AddReference('Kingdee.BOS.ServiceHelper')
#导入cloud基础库中的常用实体对象(分命名空间导入,不会递归导入)
from Kingdee.BOS import *
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.DependencyRules import *
from Kingdee.BOS.Core.Bill import *
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
from System import *
from System.Data import *
from Kingdee.BOS.App.Data import *
from System.Collections.Generic import List
from Kingdee.BOS.ServiceHelper import *
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.Core.Metadata.EntityElement import *
from Kingdee.BOS.Core.Metadata.FieldElement import *
from Kingdee.BOS.Orm.DataEntity import *
def BeginOperationTransaction(e):
if this.FormOperation.OperationId == 8:
#this.View.ShowMessage("触动审核动作");
# // 新增:6,修改:5,删除:3,保存:8,提交:9,撤销:87,审核:1,反审核:26
#msg = "";
for entity in e.DataEntitys:
entry=entity["Entity"];
for each in entry:
unitID = each["UnitID"]["Number"].upper()
actualQty= each["ActualQty"]
FSeq = each["Seq"]
#msg += str(FSeq)+","+ str(Qty) +","+ str(unitID) + "\t"
if unitID in ("PCS","DIC") and (actualQty - int(actualQty)) > 0:
raise Exception("第[" +str(FSeq) + "]行物料单位为PCS或啤,实发数不能有小数,请修改实发数后再保存")
def OnPreparePropertys(e):
e.FieldKeys.Add("FUnitID")
e.FieldKeys.Add("FACTUALQTY")
#e.FieldKeys.Add("F_UAGW_LockDtl")
收藏了
生产领料单实发数不能有小数保存服务插件
本文2024-09-16 17:09:49发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-13930.html