
/****** Object:  Table [dbo].[ApiWmsDocLines]    Script Date: 06.09.2021 20:15:24 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ApiWmsDocLines](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ErpId] [int] NOT NULL,
	Lp [int] NOT NULL,
	[DocumentId] [int] NOT NULL,
	[Direction] [int] NOT NULL,
	[ItemId] [int] NOT NULL,
	[ItemCode] [nvarchar](60) NULL,
	[ItemName] [nvarchar](200) NULL,
	[OrgQuantity] [decimal](18, 2) NOT NULL,
	[Quantity] [decimal](16, 4) NOT NULL,
	[UMRatio] [decimal](16, 4) NOT NULL,
	[UM] [nvarchar](15) NULL,
	[Quantity2] [decimal](16, 4) NOT NULL,
	[UM2] [nvarchar](15) NULL,
	[Barcode] [nvarchar](30) NULL,
	[FeaturesRequired] [int] NOT NULL,
	[ItemFeatures] [nvarchar](50) NULL,
	SerialNumberId [int] NULL,
	StockBarcode [nvarchar](60) NULL,
	[LocationId] [int] NOT NULL,
	[LocationAdress] [nvarchar](20) NULL,
	[OrgLocationId] [int] NOT NULL,
	[OrgLocationAdress] [nvarchar](20) NULL,
	[TS] [datetime] NOT NULL,
	[Description] [nvarchar](max) NULL,
	[Stock] [decimal](16, 4) NOT NULL,
	[RepositoryId] [int] NOT NULL,
	[DocumentNumber] [nvarchar](60) NULL,
	[FeatureType] [nvarchar](10) NULL,
	[OrgLineId] [int] NULL,
 CONSTRAINT [PK_dbo.ApiWmsDocLines] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[ApiWmsDocLines] ADD  DEFAULT ((0)) FOR [OrgQuantity]
GO

ALTER TABLE [dbo].[ApiWmsDocLines] ADD  DEFAULT ((0)) FOR [Quantity]
GO

ALTER TABLE [dbo].[ApiWmsDocLines] ADD  DEFAULT ((0)) FOR [UMRatio]
GO

ALTER TABLE [dbo].[ApiWmsDocLines] ADD  DEFAULT ((0)) FOR [FeaturesRequired]
GO

ALTER TABLE [dbo].[ApiWmsDocLines] ADD  DEFAULT ((0)) FOR [OrgLocationId]
GO

ALTER TABLE [dbo].[ApiWmsDocLines] ADD  DEFAULT ((0)) FOR [Stock]
GO

ALTER TABLE [dbo].[ApiWmsDocLines] ADD  DEFAULT ((0)) FOR [RepositoryId]
GO


