CREATE TABLE [dbo].[ClaimItemDueFrom]
(
[ClaimItemDueFromID] [int] NOT NULL IDENTITY(1, 1),
[ClaimItemFID] [int] NOT NULL,
[CustomerNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Amount] [money] NOT NULL CONSTRAINT [DF_ClaimItemDueFrom_Amount] DEFAULT ((0)),
[BilledDate] [datetime] NULL,
[PaidDate] [datetime] NULL,
[DocDate] [datetime] NULL,
[JournalDate] [datetime] NULL,
[PostedDate] [datetime] NULL,
[PostedBySysuserFID] [int] NULL,
[InvoicedHeaderFID] [int] NULL,
[DocumentNumber] [varchar] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimItemDueFrom] ADD CONSTRAINT [PK_ClaimItemDueFrom] PRIMARY KEY NONCLUSTERED ([ClaimItemDueFromID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ClaimItemDueFrom_PostedBySysuserFID] ON [dbo].[ClaimItemDueFrom] ([PostedBySysuserFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimItemDueFrom] ADD CONSTRAINT [FK_ClaimItemDueFrom_ClaimItem] FOREIGN KEY ([ClaimItemFID]) REFERENCES [dbo].[ClaimItem] ([ClaimItemID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ClaimItemDueFrom] ADD CONSTRAINT [FK_ClaimItemDueFrom_PostedbySysuser] FOREIGN KEY ([PostedBySysuserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[ClaimItemDueFrom] TO [MssExec]
GRANT INSERT ON [dbo].[ClaimItemDueFrom] TO [MssExec]
GRANT DELETE ON [dbo].[ClaimItemDueFrom] TO [MssExec]
GRANT UPDATE ON [dbo].[ClaimItemDueFrom] TO [MssExec]
GO