实现用友U890采购订单或委外订单审核后自动发电邮给供应商

 实现用友U890采购订单或委外订单审核后自动发电邮给供应商

 

1,完成供应商主档中电邮地址,

2,完成人员档案中,采购员的电邮地址,

3,采购订单,委外订单添加触发:

 

USE [UFDATA_001_2012]

GO

/****** Object:  Trigger [dbo].[HW_PO_PomainAuditingSendMail]    Script Date: 03/08/2012 13:46:09 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

ALTER

 Trigger [dbo].[HW_PO_PomainAuditingSendMail] on [dbo].[PO_Pomain]

For update 

as 

if update ([iverifystateex])--当iverifystateex字段被更新时,才会触发此触发器 

BegIn

declare  @POID   int

Select   @POID   = inserted.POID   from   inserted

Declare @iverifystateex Int

Set @iverifystateex=(Select iverifystateex From inserted Where inserted.POID=@POID)

--2012/2/27 , when posted date is getday,insert into HW_UPOsendmailstate

Declare @iverifydate varchar(12)

Set @iverifydate=(Select convert(varchar(11),cAuditDate,(120))  From  PO_Pomain Where POID=@POID)

IF(@iverifydate=convert(varchar(11),getdate(),(120)))

BegIn

IF(@iverifystateex=2)

Begin

IF Not Exists(Select * From HW_U_POSendMailState Where POID=@POID)

Begin

Insert Into HW_U_POSendMailState(POID,cPOID,cAuditTime,SendMailLog)

Select POID,cPOID,cAuditTime,'OE' From PO_Pomain Where  POID=@POID

End

End

End

End

 

5,开发以下组件:

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(职场,休闲,U890,电邮,采购订单)