/// <summary> /// 审核应付款 /// </summary> /// <param name="sysNo">应付款系统编号</param> /// <param name="objectAuditStatus">审核的目标状态,分待财务审核或已审核</param> public virtual void Audit(int sysNo, PayableAuditStatus objectAuditStatus) { PayableInfo entity = LoadBySysNo(sysNo); PreCheckForAudit(entity, objectAuditStatus); entity.AuditStatus = objectAuditStatus; m_PayableDA.UpdateAuditInfo(entity); }
/// <summary> /// 审核前预先检查 /// </summary> /// <param name="entity">需要审核的应付款</param> /// <param name="objectAuditStatus">审核的目标状态,分待财务审核或已审核</param> protected virtual void PreCheckForAudit(PayableInfo entity, PayableAuditStatus objectAuditStatus) { //要求审核后的新状态必须为待财务审或已审核 if (objectAuditStatus != PayableAuditStatus.WaitFNAudit && objectAuditStatus != PayableAuditStatus.Audited) { ThrowBizException("Payable_Audit_AuditStatusInvalid"); } if (objectAuditStatus == PayableAuditStatus.WaitFNAudit && entity.AuditStatus != PayableAuditStatus.NotAudit) { ThrowBizException("Payable_Audit_AuditStatusNotMatchNotAuditForPMAudit"); } else if (objectAuditStatus == PayableAuditStatus.Audited && entity.AuditStatus != PayableAuditStatus.WaitFNAudit) { ThrowBizException("Payable_Audit_AuditStatusNotMatchWaitFNAuditForFinAudit"); } if (entity.PayStatus != PayableStatus.UnPay) { ThrowBizException("Payable_Audit_StatusNotMatchUnPay"); } }