/****** Object:  View [dbo].[ViwAccSellFactorTrucksDetail]    Script Date: 25/1/2025 01:34:42 ب.ظ ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

ALTER VIEW [dbo].[ViwAccSellFactorTrucksDetail]
AS
SELECT   Factor.ID, Factor.Number, Factor.OrderDate, Factor.OrderTotalID, Factor.OrderControlID, Factor.OrderDetailID1, Factor.OrderDetailID2, Factor.Type, Factor.Source, Factor.BuyerTotalID, Factor.BuyerControlID, Factor.BuyerDetailID1, 
                Factor.BuyerDetailID2, Factor.SellerTotalID, Factor.SellerControlID, Factor.SellerDetailID1, Factor.SellerDetailID2, Factor.Request, Factor.RequestUnit, Factor.RequestText, Factor.SendDate, Factor.ControlA, Factor.ControlB, Factor.ControlC, 
                Factor.ControlD, Factor.SellType, Factor.SellTime, Factor.SellPrice, Factor.BuyType, Factor.BuyTime, Factor.BuyPrice, Factor.City, Factor.Destination, Factor.Address, Factor.DocItemID, Factor.DocItemRelationID, Factor.DocItemType, 
                Factor.Description, Factor.UpdateDate, Factor.Updater, Factor.Trailer, Factor.PrintCount, Factor.CancelDate, Factor.ProfitType, Factor.BuyerRef, Factor.AddDescriptionToDoc, Factor.BuyerPaid, Factor.SellerPaid, Factor.IsPermanent, 
                Factor.MelliCode, Factor.Tel, Factor.BuyPrice2, Factor.SellPrice2, Trucks.InsertDate, Trucks.Inserter, Factor.Barbari, Trucks.Canceler, Factor.PermanentDate, Factor.Permanenter, Factor.Sender, Trucks.SellFactorID, Trucks.Date AS TrucksDate, 
                Trucks.TruckNo, Trucks.Weigh AS TruckWeight, Trucks.Unit, Trucks.FDate, Trucks.DocItemID AS TrucksDocItemID, Trucks.DocItemRelationID AS TrucksDocItemRelationID, Trucks.DocHeaderID, Trucks.Status, Trucks.Flags, Trucks.BarName, 
                Trucks.Description AS TrucksDescription, Trucks.ReportDate, Trucks.Pack, Trucks.TruckTel, Trucks.HamlTotalID, Trucks.HamlControlID, Trucks.HamlDetailID1, Trucks.HamlDetailID2, Trucks.HamlPrice, Trucks.ChaperTotalID, 
                Trucks.ChaperControlID, Trucks.ChaperDetailID1, Trucks.ChaperDetailID2, Trucks.ChaperPrice, Trucks.ShipID, Trucks.UpdateDate AS TrucksUpdateDate, Trucks.Updater AS TrucksUpdater, Trucks.InsertDate AS TrucksInsertDate, 
                Trucks.Inserter AS TrucksInserter, Trucks.CancelDate AS TrucksCancelDate, Trucks.Canceler AS TrucksCanceler, Trucks.ID AS TrucksID, Trucks.FactorID, Trucks.BSK, Trucks.WareOutID, Trucks.WareInID, Trucks.TruckName, Factor.Cottage, 
                Trucks.BarnameSerial, Trucks.TaghirMaghsad, Trucks.BarnameAvval, Trucks.BarnameSerialAvval, Trucks.DestinationAvval, Trucks.CottageAvval, Trucks.NumberAvval, Trucks.BKharidId, Trucks.BTakhsisId, Trucks.ShomNameh, 
                Trucks.TarikhNameh, Factor.AvarezSeller, Factor.AvarezBuyer, Factor.HamlCode, Factor.CompanyCode, Factor.FactorLazem, Factor.Status AS Expr1, Factor.TaghirStatus, Factor.VizTotalID, Factor.VizControlID, Factor.VizDetailID1, 
                Factor.VizDetailID2, Factor.VizValue
FROM      dbo.AccSellFactor AS Factor LEFT OUTER JOIN
                dbo.AccSellFactorTrucks AS Trucks ON Factor.ID = Trucks.SellFactorID
GO


