控制时间的单据不让反审核
create TRIGGER [dbo].[seoutstock_fcheck] ON [dbo].[SEOutStock]
FOR update
AS
SET NOCOUNT ON
if exists (select 1 from deleted where fdate<'2013-01-01' and isnull(fcheckerid,0)<>0)
begin
if exists (select 1 from inserted where fdate<'2013-01-01' and isnull(fcheckerid,0)=0)
begin
DECLARE @FStatus int
DECLARE @Finterid int
select @FStatus=fcheckerid,@Finterid=finterid from seoutstock
where finterid in (select finterid from inserted)
if isnull(@FStatus,0)=0
begin
ROLLBACK TRAN
RAISERROR('2013年以前数据,无法反审单据,请冲红!',18,18)
end
end
END
控制价格范围审核