CREATE TABLE [dbo].[SCQBillingMeterGroupBaseCycleCharges]
(
[BillingMeterGroupBaseCycleChargeID] [int] NOT NULL IDENTITY(1, 1),
[BillingID] [int] NOT NULL,
[ContractDetailID] [int] NOT NULL,
[BillingMeterGroupID] [int] NOT NULL,
[CycleChargeDetailID] [int] NOT NULL,
[BaseFromDate] [datetime] NOT NULL,
[BaseToDate] [datetime] NOT NULL,
[NonAdjustedBaseFromDate] [datetime] NOT NULL,
[NonAdjustedBaseToDate] [datetime] NOT NULL,
[BaseRatePerCopy] [decimal] (18, 6) NOT NULL,
[NextBaseRatePerCopy] [decimal] (18, 6) NULL,
[NonAdjustedBaseRatePerCopy] [decimal] (18, 6) NOT NULL,
[BilledCoveredCopies] [decimal] (18, 6) NOT NULL,
[CoveredCopies] [decimal] (18, 6) NOT NULL,
[NonAdjustedCoveredCopies] [decimal] (18, 6) NOT NULL,
[BaseAmount] [money] NOT NULL,
[CreatorID] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_SCQBillingMeterGroupBaseCycleCharges_CreateDate] DEFAULT (getdate()),
[UpdatorID] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_SCQBillingMeterGroupBaseCycleCharges_LastUpdate] DEFAULT (getdate()),
[MeterGroupDetailID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SCQBillingMeterGroupBaseCycleCharges] ADD CONSTRAINT [FK_SCQBillingMeterGroupBaseCycleCharges_BillingMeterGroupID_SCQBillingMeterGroups] FOREIGN KEY ([BillingMeterGroupID]) REFERENCES [dbo].[SCQBillingMeterGroups] ([BillingMeterGroupID])
GO