
/****** Object:  View [dbo].[ViwSellFactorTrucksUnDocumented]    Script Date: 25/1/2025 01:40:03 ب.ظ ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

ALTER VIEW [dbo].[ViwSellFactorTrucksUnDocumented]
AS
SELECT   dbo.AccSellFactorTrucks.ID, dbo.AccSellFactorTrucks.SellFactorID, dbo.AccSellFactorTrucks.Date, dbo.AccSellFactorTrucks.TruckNo, dbo.AccSellFactorTrucks.Weigh, dbo.AccSellFactorTrucks.Unit, dbo.AccSellFactorTrucks.DocItemID, 
                dbo.AccSellFactorTrucks.DocItemRelationID, dbo.AccSellFactorTrucks.DocHeaderID, dbo.AccSellFactorTrucks.Status, dbo.AccSellFactorTrucks.ShomNameh, dbo.AccSellFactorTrucks.TarikhNameh
FROM      dbo.AccDocItem WITH (NOLOCK) RIGHT OUTER JOIN
                dbo.AccSellFactorTrucks WITH (NOLOCK) ON dbo.AccDocItem.ID = dbo.AccSellFactorTrucks.DocItemID
WHERE   (dbo.AccSellFactorTrucks.DocHeaderID <> dbo.AccDocItem.HeaderID OR
                dbo.AccSellFactorTrucks.DocHeaderID = 0) AND (dbo.AccSellFactorTrucks.Status <> 1)
GO


