金蝶K3控制销售订单外币时候,只能填写0税率

-- =============================================
-- Author:  
-- Create date: <2020-07-09>
-- Description: <控制销售订单外币时候,只能填写0税率>
-- =============================================
create TRIGGER [dbo].[SEOrder_Ins]
     ON [dbo].[SEOrder]
   For INSERT
AS 
BEGIN
 SET NOCOUNT ON;

    -- Insert statements for trigger here
    
      IF EXISTS ( SELECT 1 FROM inserted t1
                      inner join SEOrderEntry t2 on t1.FInterID=t2.FInterID WHERE FCurrencyID<>1 and t2.FCess<>0)
    BEGIN
        ROLLBACK TRAN
        RAISERROR('外币销售订单税率应为0!',18,18)
    END

END

 

你可能感兴趣的:(金蝶K3,MSSQL,金蝶,K3,销售订单,外币,税率)