CREATE TABLE [dbo].[InvoiceTerms]
(
[InvoiceTermsID] [int] NOT NULL IDENTITY(1, 1),
[InvoiceChargeAmountTypeFID] [int] NOT NULL,
[BranchFID] [int] NOT NULL,
[DaysDue] [int] NOT NULL CONSTRAINT [DF_InvoiceTerms_DaysDue] DEFAULT ((0)),
[ChargeAmount] [decimal] (19, 2) NOT NULL CONSTRAINT [DF_InvoiceTerms_ChargeAmount] DEFAULT ((0)),
[MinimumCharge] [money] NOT NULL CONSTRAINT [DF_InvoiceTerms_MinimumCharge] DEFAULT ((0)),
[Conditions] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceTerms] ADD CONSTRAINT [PK_InvoiceTerms] PRIMARY KEY NONCLUSTERED ([InvoiceTermsID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceTerms] ADD CONSTRAINT [IX_InvoiceTerms_BranchFID] UNIQUE NONCLUSTERED ([BranchFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceTerms] ADD CONSTRAINT [FK_InvoiceTerms_Branch] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[InvoiceTerms] ADD CONSTRAINT [FK_InvoiceTerms_InvoiceChargeAmountType] FOREIGN KEY ([InvoiceChargeAmountTypeFID]) REFERENCES [dbo].[InvoiceChargeAmountType] ([InvoiceChargeAmountTypeID])
GO
GRANT SELECT ON [dbo].[InvoiceTerms] TO [MssExec]
GRANT INSERT ON [dbo].[InvoiceTerms] TO [MssExec]
GRANT DELETE ON [dbo].[InvoiceTerms] TO [MssExec]
GRANT UPDATE ON [dbo].[InvoiceTerms] TO [MssExec]
GO