PYTHON中进行日期比较
```clr.AddReference('System')
clr.AddReference('Kingdee.BOS')
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.BOS.ServiceHelper')
clr.AddReference('Kingdee.BOS.App')
clr.AddReference("System.Core")
clr.AddReference('System.Data')
from System.Collections.Generic import *
from System.Collections.Generic import List, Dictionary
from Kingdee.BOS.App import *
from Kingdee.BOS.App.Data import *
from System import *
from System import StringComparison
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.Metadata.EntityElement import *
from Kingdee.BOS.Core.Validation import *
from Kingdee.BOS.Core.Log import *
from Kingdee.BOS.Log import *
from System.Collections.Generic import *
from Kingdee.BOS.ServiceHelper import *
from System import DateTime
def OnAddValidators(e):
extMoProducTypeValidator=ExtMoProducTypeValidator()
extMoProducTypeValidator.EntityKey="FBillHead"
extMoProducTypeValidator.AlwaysValidate=True
#extMoProducTypeValidator.TimingPointString=",Save"
e.Validators.Add(extMoProducTypeValidator)
class ExtMoProducTypeValidator(AbstractValidator):
def Validate(self,dataEntities,validateContext,ctx):
if len(dataEntities)==0:
return;
for bill in dataEntities:
#BillHead=bill["BillHead"]
date=bill.DataEntity["Date"]
datestandard=DateTime(2023, 9, 1)
if date>=datestandard:
entryData = bill["ER_ExpenseReimbEntry"]
for data in entryData:
ExpIDgroup=data["ExpID"]["FGroup_Id"]
F_SDXY_FACTReimb=data["F_SDXY_FACTReimb_Id"]
#logs = List[LogObject]();
#log = LogObject();
#log.pkValue = data["Id"]#别赋值,有异常
#log.Description = ("{0}{1}").format(str(ExpIDgroup),str(F_SDXY_FACTReimb));
#log.OperateName = "保存上机日志";
#log.ObjectTypeId = "ceshi"
#log.SubSystemId = "ceshi"
#log.Environment = OperatingEnvironment.BizOperate;
#logs.Add(log);
#LogServiceHelper.BatchWriteLog(this.Context, logs);
if (ExpIDgroup==102778 or ExpIDgroup==102779 or ExpIDgroup==102787 or ExpIDgroup==102788) and F_SDXY_FACTReimb==0:
errorInfo=ValidationErrorInfo(" ",str(bill["Id"]),bill.DataEntityIndex,bill.RowIndex,str(bill["Id"]),"存在接待费、差旅费时,实际报销人不得为空",str(bill["BillNo"]),ErrorLevel.Error)
validateContext.AddError(None,errorInfo)
else:
pass
```
PYTHON中进行日期比较
```clr.AddReference('System')clr.AddReference('Kingdee.BOS')clr.AddReference('Kingdee.BOS.Core')clr.AddReference('Kingdee.BOS.Serv...
点击下载文档
本文2024-09-16 18:55:02发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-25220.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章