CREATE TABLE [dbo].[ClaimLiability]
(
[ClaimLiabilityID] [int] NOT NULL IDENTITY(1, 1),
[ClaimFID] [int] NOT NULL,
[Description] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LiablePersonSysUserFID] [int] NULL,
[ThirdPartyFlag] [bit] NULL,
[ThirdPartyName] [varchar] (65) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VendorNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[WarehouseFID] [int] NULL,
[AgentFID] [int] NULL,
[BranchFID] [int] NULL,
[DivisionFID] [int] NULL,
[ClaimChargebackTypeFID] [int] NULL,
[1099Flag] [bit] NOT NULL CONSTRAINT [DF_ClaimLiability_1099Flag] DEFAULT ((0)),
[LaborTypeFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimLiability] ADD CONSTRAINT [CK_ClaimLiability_ApplyTo] CHECK (((1)=[dbo].[ClaimLiabilityVerifyApplyTo]([LiablePersonSysUserFID],[ThirdPartyFlag],[WarehouseFID],[AgentFID],[VendorNumber],[BranchFID])))
GO
ALTER TABLE [dbo].[ClaimLiability] ADD CONSTRAINT [PK_ClaimLiability] PRIMARY KEY NONCLUSTERED ([ClaimLiabilityID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimLiability] ADD CONSTRAINT [FK_ClaimLiability_Claim] FOREIGN KEY ([ClaimFID]) REFERENCES [dbo].[Claim] ([ClaimID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ClaimLiability] ADD CONSTRAINT [FK_ClaimLiability_LaborType] FOREIGN KEY ([LaborTypeFID]) REFERENCES [dbo].[LaborType] ([PriKey])
GO
GRANT SELECT ON [dbo].[ClaimLiability] TO [MssExec]
GRANT INSERT ON [dbo].[ClaimLiability] TO [MssExec]
GRANT DELETE ON [dbo].[ClaimLiability] TO [MssExec]
GRANT UPDATE ON [dbo].[ClaimLiability] TO [MssExec]
GO