[dbo].[ClaimHandlingRevenuePayment]
CREATE TABLE [dbo].[ClaimHandlingRevenuePayment]
(
[ClaimHandlingRevenuePaymentID] [int] NOT NULL IDENTITY(1, 1),
[ClaimHandlingRevenueFID] [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].[ClaimHandlingRevenuePayment] ADD CONSTRAINT [PK_ClaimHandlingRevenuePayment] PRIMARY KEY NONCLUSTERED ([ClaimHandlingRevenuePaymentID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimHandlingRevenuePayment] ADD CONSTRAINT [IX_ClaimHandlingRevenuePayment_ClaimHandlingRevenueFID_ClaimPaymentDetailFID] UNIQUE NONCLUSTERED ([ClaimHandlingRevenueFID], [ClaimPaymentDetailFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ClaimHandlingRevenuePayment_PostedBySysuserFID] ON [dbo].[ClaimHandlingRevenuePayment] ([PostedBySysuserFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimHandlingRevenuePayment] ADD CONSTRAINT [FK_ClaimHandlingRevenuePayment_AccountingNote] FOREIGN KEY ([AccountingNoteFID]) REFERENCES [dbo].[AccountingNote] ([ANPriKey])
GO
ALTER TABLE [dbo].[ClaimHandlingRevenuePayment] ADD CONSTRAINT [FK_ClaimHandlingRevenuePayment_ClaimHandlingRevenue] FOREIGN KEY ([ClaimHandlingRevenueFID]) REFERENCES [dbo].[ClaimHandlingRevenue] ([ClaimHandlingRevenueID])
GO
ALTER TABLE [dbo].[ClaimHandlingRevenuePayment] ADD CONSTRAINT [FK_ClaimHandlingRevenuePayment_ClaimPaymentDetail] FOREIGN KEY ([ClaimPaymentDetailFID]) REFERENCES [dbo].[ClaimPaymentDetail] ([ClaimPaymentDetailID])
GO
ALTER TABLE [dbo].[ClaimHandlingRevenuePayment] ADD CONSTRAINT [FK_ClaimHandlingRevenuePayment_SysUser] FOREIGN KEY ([PostedBySysuserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[ClaimHandlingRevenuePayment] TO [MssExec]
GRANT INSERT ON [dbo].[ClaimHandlingRevenuePayment] TO [MssExec]
GRANT DELETE ON [dbo].[ClaimHandlingRevenuePayment] TO [MssExec]
GRANT UPDATE ON [dbo].[ClaimHandlingRevenuePayment] TO [MssExec]
GO