/****** Object:  View [dbo].[ViwAccWarehousePhas1]    Script Date: 18/09/2022 05:26:56 ب.ظ ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



ALTER VIEW [dbo].[ViwAccWarehousePhas1]
AS
SELECT     Ware.ID, Ware.InOROut, Ware.Number, Ware.UserNumber, Ware.Date, Ware.WarehouseID, 
                      Ware.PersonTotalID, Ware.PersonControlID, Ware.PersonDetailID1, Ware.PersonDetailID2, Ware.Description, 
                      Ware.UpdateDate, Ware.Updater, Ware.WarehouseIDTo, Ware.FormID, Ware.FromForm, COALESCE (dbo.AccDetail.Title, 
                      dbo.AccControl.Title, dbo.AccTotal.Title) AS PersonTitle, Ware.OutID, Ware.Takhfif, Ware.HamlAndOther, Ware.TakhfifDocItemID, 
                      Ware.TakhfifDocHeaderID, Ware.HamlDocItemID, Ware.HamlDocHeaderID, Ware.CostCenter, Ware.Project, Ware.Flags 
FROM         dbo.AccWarehouse as Ware WITH (NOLOCK) LEFT OUTER JOIN
                      dbo.AccTotal ON Ware.PersonTotalID = dbo.AccTotal.ID LEFT OUTER JOIN
                      dbo.AccControl ON Ware.PersonControlID = dbo.AccControl.ID LEFT OUTER JOIN
                      dbo.AccDetail ON Ware.PersonDetailID1 = dbo.AccDetail.ID
GO


