


CREATE VIEW [dbo].[ApiWmsDocumentsView] as
SELECT  [Id]
      ,[ErpId]
      ,[Direction]
      ,[DefId]
      ,[StateId]
      ,[Number]
      ,[Year]
      ,[Month]
      ,[Series]
      ,[NumberString]
      ,[Priority]
      ,[PlaceId]
      ,[CustId]
      ,[CustInfo]
      ,[Date]
      ,[OperatorId]
      ,[CreateTS]
      ,[OwnerId]
      ,[TS]
      ,[Description]
      ,[ObjectId]
      ,[ObjectType]
      ,[OrgDocumentNumber]
      ,[RepositoryId]
	  , DepartamentId
	  , StateDoc
      , Link 
	  , ExtId 
	  ,dbo.[ApiObjectAttachmentns](Id,40)  [Info]
	  ,[dbo].[ApiWmsDocLinesInfo](Id) Info2
	  , ReciverId
	  ,ForeginNumber
	  ,CategoryId
	  	  ,ProjectId
	  ,ProjectLineId
	  , [dbo].[ApiObjectCourierPackages](Id,40) PackageInfo
	  
  FROM [dbo].[ApiWmsDocuments]
GO


