CREATE TABLE [dbo].[SCContractMiscChargeCodes]
(
[MiscChargeCodeID] [int] NOT NULL IDENTITY(1, 1),
[MiscChargeCode] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[GLID] [int] NOT NULL,
[DeptID] [int] NULL,
[TaxFlag] [int] NOT NULL,
[Active] [bit] NOT NULL CONSTRAINT [DF_SCContractMiscChargeCodes_Active] DEFAULT ((1)),
[CreatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[UpdatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_SCContractMiscChargeCodes_CreateDate] DEFAULT (getdate()),
[LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_SCContractMiscChargeCodes_LastUpdate] DEFAULT (getdate()),
[Quantity] [decimal] (18, 6) NOT NULL CONSTRAINT [DF_SCContractMiscChargeCodes_Quantity] DEFAULT ((0)),
[Rate] [decimal] (18, 6) NOT NULL CONSTRAINT [DF_SCContractMiscChargeCodes_Rate] DEFAULT ((0)),
[Method] [int] NOT NULL CONSTRAINT [DF_SCContractMiscChargeCodes_Method] DEFAULT ((0)),
[PercentMinimumAmount] [money] NULL,
[PercentMaximumAmount] [money] NULL,
[BillWithID] [int] NOT NULL CONSTRAINT [DF_SCContractMiscChargeCodes_BillWithID] DEFAULT ((0)),
[TaxFlagID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SCContractMiscChargeCodes] ADD CONSTRAINT [PK_SCContractMiscChargeCodes] PRIMARY KEY CLUSTERED ([MiscChargeCodeID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SCContractMiscChargeCodes] ADD CONSTRAINT [FK_SCContractMiscChargeCodes_DeptID_GLDepts] FOREIGN KEY ([DeptID]) REFERENCES [dbo].[GLDepts] ([DeptID])
GO
ALTER TABLE [dbo].[SCContractMiscChargeCodes] ADD CONSTRAINT [FK_SCContractMiscChargeCodes_GLID_GLAccounts] FOREIGN KEY ([GLID]) REFERENCES [dbo].[GLAccounts] ([AccountID])
GO
ALTER TABLE [dbo].[SCContractMiscChargeCodes] ADD CONSTRAINT [FK_SCContractMiscChargeCodes_TaxFlagID_ShTaxFlags] FOREIGN KEY ([TaxFlagID]) REFERENCES [dbo].[ShTaxFlags] ([TaxFlagID])
GO