CREATE TABLE [dbo].[ICPhysicalInventoryLists]
(
[PhysicalInventoryListID] [int] NOT NULL IDENTITY(1, 1),
[PhysicalInventoryNo] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[BranchID] [int] NOT NULL,
[StatusID] [int] NOT NULL,
[ItemsPerSheet] [int] NOT NULL,
[AdjustmentCodeID] [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_ICPhysicalInventoryLists_CreateDate] DEFAULT (getdate()),
[LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_ICPhysicalInventoryLists_LastUpdate] DEFAULT (getdate()),
[Batch] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ICPhysicalInventoryLists_Batch] DEFAULT (''),
[ReduceQuantityOnHandByAllocated] [bit] NOT NULL CONSTRAINT [DF_ICPhysicalInventoryLists_ReduceQuantityOnHandByAllocated] DEFAULT ((0)),
[WarehouseID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICPhysicalInventoryLists] ADD CONSTRAINT [PK_ICPhysicalInventoryLists] PRIMARY KEY CLUSTERED ([PhysicalInventoryListID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICPhysicalInventoryLists] ADD CONSTRAINT [FK_ICPhysicalInventoryLists_AdjustmentCodeID_ICAdjustmentCodes] FOREIGN KEY ([AdjustmentCodeID]) REFERENCES [dbo].[ICAdjustmentCodes] ([AdjustmentCodeID])
GO
ALTER TABLE [dbo].[ICPhysicalInventoryLists] ADD CONSTRAINT [FK_ICPhysicalInventoryLists_BranchID_GLBranches] FOREIGN KEY ([BranchID]) REFERENCES [dbo].[GLBranches] ([BranchID])
GO
ALTER TABLE [dbo].[ICPhysicalInventoryLists] ADD CONSTRAINT [FK_ICPhysicalInventoryLists_StatusID_ICPhysicalInventoryListStatuses] FOREIGN KEY ([StatusID]) REFERENCES [dbo].[ICPhysicalInventoryListStatuses] ([StatusID])
GO
ALTER TABLE [dbo].[ICPhysicalInventoryLists] ADD CONSTRAINT [FK_ICPhysicalInventoryLists_WarehouseID_ICWarehouses] FOREIGN KEY ([WarehouseID]) REFERENCES [dbo].[ICWarehouses] ([WarehouseID])
GO