USE [befri_Goldhoo]
GO

/****** Object:  View [basedata].[V_CombtItemMember]    Script Date: 2021/3/14 0:21:39 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

ALTER VIEW [basedata].[V_CombtItemMember]
AS
SELECT   cim.CombtItemId, cim.SuitId, i.InventoryNumber AS SuitNumber, i.InventoryName AS SuitName, cim.Quantity, 
                cim.Opened, cim.Status, cim.VersionNumber, cim.CreatedBy, cim.CreatedOn, cim.ModifiedBy, cim.ModifiedOn, 
                cim.Description, i.DeliveryCycleStr, i.ProductionProperty, vtm.Text AS ProductionPropertyText
FROM      basedata.CombtItemMember AS cim INNER JOIN
                basedata.Inventory AS i ON i.InventoryId = cim.SuitId LEFT OUTER JOIN
                dbo.ValueTextMap AS vtm ON vtm.TableName = 'basedata.Inventory' AND vtm.FieldName = 'ProductionProperty' AND 
                i.ProductionProperty = vtm.Value

GO


