import clr clr.AddReference("Kingdee.BOS.Core") clr.AddReference("Kingdee.BOS.DataEntity") from Kingdee.BOS.DataEntity import * from Kingdee.BOS.Core.Metadata.FieldElement import * def AfterConvert(e): headEntity = e.Result.FindByEntityKey("FBillHead") for item in headEntity: #【data】为明细单据体 【src】为源单单据体 data=item["PAYBILLENTRY"] src=item["PAYBILLSRCENTRY"] if len(data)!=len(src): continue for index in range(len(data)): #基础资料需要两行,一行需要加_ID,文本,数字一行即可 data[index]["FACCOUNTID_ID"]=src[index]["F_kdH_Bank_ID"] data[index]["FACCOUNTID"]=src[index]["F_kdH_Bank"]