[dbo].[StorageProcessBillingHeader]
CREATE TABLE [dbo].[StorageProcessBillingHeader]
(
[StorageProcessBillingHeaderID] [int] NOT NULL IDENTITY(1, 1),
[SessionID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[BranchFID] [int] NOT NULL,
[StorageTypeFID] [int] NOT NULL,
[ReportFID] [int] NOT NULL,
[BillFromDate] [datetime] NOT NULL,
[BillToDate] [datetime] NOT NULL,
[DocumentDate] [datetime] NOT NULL,
[JournalDate] [datetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageProcessBillingHeader] ADD CONSTRAINT [PK_StorageProcessBillingHeader] PRIMARY KEY NONCLUSTERED ([StorageProcessBillingHeaderID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageProcessBillingHeader] ADD CONSTRAINT [FK_StorageProcessBillingHeader_Reports] FOREIGN KEY ([ReportFID]) REFERENCES [dbo].[Reports] ([Prikey])
GO
GRANT SELECT ON [dbo].[StorageProcessBillingHeader] TO [MssExec]
GRANT INSERT ON [dbo].[StorageProcessBillingHeader] TO [MssExec]
GRANT DELETE ON [dbo].[StorageProcessBillingHeader] TO [MssExec]
GRANT UPDATE ON [dbo].[StorageProcessBillingHeader] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'The starting date for the storage run identified by SessionID', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessBillingHeader', 'COLUMN', N'BillFromDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The ending date for the storage run identified by SessionID.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessBillingHeader', 'COLUMN', N'BillToDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'ID of the branch chosen for the storage run identified by SessionID, or 0 if the storage run is for all branches.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessBillingHeader', 'COLUMN', N'BranchFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The Document Date for transactions generated by the storage run identified by SessionID.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessBillingHeader', 'COLUMN', N'DocumentDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The Journal Date for transactions generated by the storage run identified by SessionID.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessBillingHeader', 'COLUMN', N'JournalDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'ID of the invoice report to be used when generating invoices for the storage run identified by SessionID.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessBillingHeader', 'COLUMN', N'ReportFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Session ID that uniquely identifies a storage run.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessBillingHeader', 'COLUMN', N'SessionID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessBillingHeader', 'COLUMN', N'StorageProcessBillingHeaderID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'ID of the billing type chosen for the storage run identified by SessionID, or 0 if the storage run is for all billing types.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessBillingHeader', 'COLUMN', N'StorageTypeFID'
GO