Tables [dbo].[ICLedger]
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created12:56:32 AM Thursday, March 21, 2019
Last Modified1:11:34 AM Thursday, March 21, 2019
KeyNameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_ICLedger: LedgerIDLedgerIDint4
False
1 - 1
Foreign Keys FK_ICLedger_ItemID_ICItems: [dbo].[ICItems].ItemIDItemIDint4
False
SerialNumbervarchar(30)30
False
StockTypeIDint4
False
((1))
Datedatetime8
False
DatePeriodint4
False
Periodint4
False
Modulechar(4)4
False
Sourcevarchar(15)15
False
Referencevarchar(15)15
False
Descriptionvarchar(255)255
False
Foreign Keys FK_ICLedger_WarehouseID_ICWarehouses: [dbo].[ICWarehouses].WarehouseIDWarehouseIDint4
False
Foreign Keys FK_ICLedger_BinID_ICBins: [dbo].[ICBins].BinIDBinIDint4
False
Quantitydecimal(18,6)9
False
Amountmoney8
False
TransactionTypeIDint4
False
CreatorIDchar(8)8
False
UpdatorIDchar(8)8
False
CreateDatedatetime8
False
(getdate())
LastUpdatedatetime8
False
(getdate())
timestamptimestamp8
False
Foreign Keys FK_ICLedger_BalanceSheetGroupID_GLBalanceSheetGroups: [dbo].[GLBalanceSheetGroups].BalanceSheetGroupIDBalanceSheetGroupIDint4
True
TransactionDetailTableFlagint4
False
((0))
TransactionDetailTableRecordIDint4
True
Foreign Keys FK_ICLedger_CostPoolID_ICCostPools: [dbo].[ICCostPools].CostPoolIDCostPoolIDint4
False
IsReversaldecimal(18,6)9
False
((0))
IntraCostPoolTransferdecimal(18,6)9
False
((0))
KeyNameKey ColumnsUniqueFill Factor
Cluster Primary Key PK_ICLedger: LedgerIDPK_ICLedgerLedgerID
True
80
NameColumns
FK_ICLedger_BalanceSheetGroupID_GLBalanceSheetGroupsBalanceSheetGroupID->[dbo].[GLBalanceSheetGroups].[BalanceSheetGroupID]
FK_ICLedger_BinID_ICBinsBinID->[dbo].[ICBins].[BinID]
FK_ICLedger_CostPoolID_ICCostPoolsCostPoolID->[dbo].[ICCostPools].[CostPoolID]
FK_ICLedger_ItemID_ICItemsItemID->[dbo].[ICItems].[ItemID]
FK_ICLedger_WarehouseID_ICWarehousesWarehouseID->[dbo].[ICWarehouses].[WarehouseID]
CREATE TABLE [dbo].[ICLedger]
(
[LedgerID] [int] NOT NULL IDENTITY(1, 1),
[ItemID] [int] NOT NULL,
[SerialNumber] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[StockTypeID] [int] NOT NULL CONSTRAINT [DF_ICLedger_StockTypeID] DEFAULT ((1)),
[Date] [datetime] NOT NULL,
[DatePeriod] [int] NOT NULL,
[Period] [int] NOT NULL,
[Module] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Source] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Reference] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[WarehouseID] [int] NOT NULL,
[BinID] [int] NOT NULL,
[Quantity] [decimal] (18, 6) NOT NULL,
[Amount] [money] NOT NULL,
[TransactionTypeID] [int] NOT NULL,
[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_ICLedger_CreateDate] DEFAULT (getdate()),
[LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_ICLedger_LastUpdate] DEFAULT (getdate()),
[timestamp] [timestamp] NOT NULL,
[BalanceSheetGroupID] [int] NULL,
[TransactionDetailTableFlag] [int] NOT NULL CONSTRAINT [DF_ICLedger_TransactionDetailTableFlag] DEFAULT ((0)),
[TransactionDetailTableRecordID] [int] NULL,
[CostPoolID] [int] NOT NULL,
[IsReversal] [decimal] (18, 6) NOT NULL CONSTRAINT [DF_ICLedger_IsReversal] DEFAULT ((0)),
[IntraCostPoolTransfer] [decimal] (18, 6) NOT NULL CONSTRAINT [DF_ICLedger_IntraCostPoolTransfer] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICLedger] ADD CONSTRAINT [PK_ICLedger] PRIMARY KEY CLUSTERED  ([LedgerID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICLedger] ADD CONSTRAINT [FK_ICLedger_BalanceSheetGroupID_GLBalanceSheetGroups] FOREIGN KEY ([BalanceSheetGroupID]) REFERENCES [dbo].[GLBalanceSheetGroups] ([BalanceSheetGroupID])
GO
ALTER TABLE [dbo].[ICLedger] ADD CONSTRAINT [FK_ICLedger_BinID_ICBins] FOREIGN KEY ([BinID]) REFERENCES [dbo].[ICBins] ([BinID])
GO
ALTER TABLE [dbo].[ICLedger] ADD CONSTRAINT [FK_ICLedger_CostPoolID_ICCostPools] FOREIGN KEY ([CostPoolID]) REFERENCES [dbo].[ICCostPools] ([CostPoolID])
GO
ALTER TABLE [dbo].[ICLedger] ADD CONSTRAINT [FK_ICLedger_ItemID_ICItems] FOREIGN KEY ([ItemID]) REFERENCES [dbo].[ICItems] ([ItemID])
GO
ALTER TABLE [dbo].[ICLedger] ADD CONSTRAINT [FK_ICLedger_WarehouseID_ICWarehouses] FOREIGN KEY ([WarehouseID]) REFERENCES [dbo].[ICWarehouses] ([WarehouseID])
GO
  • [dbo].[v_ICItemHistory]