[dbo].[ClaimItemDueFromPayment]
CREATE TABLE [dbo].[ClaimItemDueFromPayment]
(
[ClaimItemDueFromPaymentID] [int] NOT NULL IDENTITY(1, 1),
[ClaimItemDueFromFID] [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].[ClaimItemDueFromPayment] ADD CONSTRAINT [PK_ClaimItemDueFromPayment] PRIMARY KEY NONCLUSTERED ([ClaimItemDueFromPaymentID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimItemDueFromPayment] ADD CONSTRAINT [IX_ClaimItemDueFromPayment_ClaimItemDueFromFID_ClaimPaymentDetailFID] UNIQUE NONCLUSTERED ([ClaimItemDueFromFID], [ClaimPaymentDetailFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ClaimItemDueFromPayment_PostedBySysuserFID] ON [dbo].[ClaimItemDueFromPayment] ([PostedBySysuserFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimItemDueFromPayment] ADD CONSTRAINT [FK_ClaimItemDueFromPayment_AccountingNote] FOREIGN KEY ([AccountingNoteFID]) REFERENCES [dbo].[AccountingNote] ([ANPriKey])
GO
ALTER TABLE [dbo].[ClaimItemDueFromPayment] ADD CONSTRAINT [FK_ClaimItemDueFromPayment_ClaimItemDueFrom] FOREIGN KEY ([ClaimItemDueFromFID]) REFERENCES [dbo].[ClaimItemDueFrom] ([ClaimItemDueFromID])
GO
ALTER TABLE [dbo].[ClaimItemDueFromPayment] ADD CONSTRAINT [FK_ClaimItemDueFromPayment_ClaimPaymentDetail] FOREIGN KEY ([ClaimPaymentDetailFID]) REFERENCES [dbo].[ClaimPaymentDetail] ([ClaimPaymentDetailID])
GO
ALTER TABLE [dbo].[ClaimItemDueFromPayment] ADD CONSTRAINT [FK_ClaimItemDueFromPayment_SysUser] FOREIGN KEY ([PostedBySysuserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[ClaimItemDueFromPayment] TO [MssExec]
GRANT INSERT ON [dbo].[ClaimItemDueFromPayment] TO [MssExec]
GRANT DELETE ON [dbo].[ClaimItemDueFromPayment] TO [MssExec]
GRANT UPDATE ON [dbo].[ClaimItemDueFromPayment] TO [MssExec]
GO