[dbo].[ClaimLiabilityItemPayment]
CREATE TABLE [dbo].[ClaimLiabilityItemPayment]
(
[ClaimLiabilityItemPaymentID] [int] NOT NULL IDENTITY(1, 1),
[ClaimLiabilityItemFID] [int] NOT NULL,
[ClaimPaymentDetailFID] [int] NOT NULL,
[ApplyAmount] [money] NOT NULL,
[DocDate] [datetime] NULL,
[JournalDate] [datetime] NULL,
[AccountingNoteFID] [int] NULL,
[PostedBySysuserFID] [int] NULL,
[PostedDate] [datetime] NULL,
[DocumentNumber] [varchar] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimLiabilityItemPayment] ADD CONSTRAINT [PK_ClaimLiabilityItemPayment] PRIMARY KEY NONCLUSTERED ([ClaimLiabilityItemPaymentID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimLiabilityItemPayment] ADD CONSTRAINT [IX_ClaimLiabilityItemPayment_ClaimLiabilityItemFID_ClaimPaymentDetailFID] UNIQUE NONCLUSTERED ([ClaimLiabilityItemFID], [ClaimPaymentDetailFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ClaimLiabilityItemPayment_PostedBySysuserFID] ON [dbo].[ClaimLiabilityItemPayment] ([PostedBySysuserFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimLiabilityItemPayment] ADD CONSTRAINT [FK_ClaimLiabilityItemPayment_AccountingNote] FOREIGN KEY ([AccountingNoteFID]) REFERENCES [dbo].[AccountingNote] ([ANPriKey])
GO
ALTER TABLE [dbo].[ClaimLiabilityItemPayment] ADD CONSTRAINT [FK_ClaimLiabilityItemPayment_ClaimLiabilityItem] FOREIGN KEY ([ClaimLiabilityItemFID]) REFERENCES [dbo].[ClaimLiabilityItem] ([ClaimLiabilityItemID])
GO
ALTER TABLE [dbo].[ClaimLiabilityItemPayment] ADD CONSTRAINT [FK_ClaimLiabilityItemPayment_ClaimPaymentDetail] FOREIGN KEY ([ClaimPaymentDetailFID]) REFERENCES [dbo].[ClaimPaymentDetail] ([ClaimPaymentDetailID])
GO
ALTER TABLE [dbo].[ClaimLiabilityItemPayment] ADD CONSTRAINT [FK_ClaimLiabilityItemPayment_SysUser] FOREIGN KEY ([PostedBySysuserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[ClaimLiabilityItemPayment] TO [MssExec]
GRANT INSERT ON [dbo].[ClaimLiabilityItemPayment] TO [MssExec]
GRANT DELETE ON [dbo].[ClaimLiabilityItemPayment] TO [MssExec]
GRANT UPDATE ON [dbo].[ClaimLiabilityItemPayment] TO [MssExec]
GO