使用BeforeSave事件Python原创
金蝶云社区-云社区用户k8649110
云社区用户k8649110
0人赞赏了该文章 66次浏览 未经作者许可,禁止转载编辑于2024年04月11日 09:24:47

python代码:


def BeforeSave(f):

    # 获取业务日期

    billDate = this.Model.GetValue('FDATE')

    # 获取创建日期

    creatDate = this.Model.GetValue('FCREATEDATE')

    # 判断业务日期与创建日期年月

    if billDate.Year == creatDate.Year and billDate.Month<creatDate.Month:

        this.Model.SetValue("F_account_Date",creatDate)

        F_account_Date = this.Model.GetValue('F_account_Date')

    else:

        this.Model.SetValue("F_account_Date",billDate)

        F_account_Date = this.Model.GetValue('F_account_Date')

    #this.View.ShowMessage("保存成功!"+    "账单日期为:"+str(billDate) + ",创建日期为:"+str(creatDate) + ",业务日期所属年月小于创建日期所属年月时,凭证日期为创建日期!否则为业务日期!")


赞 0