
/****** Object:  View [dbo].[ApiHistLinesView]    Script Date: 13.09.2021 14:24:49 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE view  [dbo].[ApiHistLinesView]
 as select TrE_TrEID ErpId, TrE_Lp lp, TrN_NumerPelny  NumberString, TrE_TrNId IdDocId,
TrE_DataDok Date, TrE_TwrId itemId, TrE_TwrNazwa itemName, TrN_PodID CustId, 
TrE_Cena0 itemPrice, TrE_CenaW itemOrgPrice, TrE_Rabat discount, TrE_Ilosc quantity,
TrE_WartoscNetto value, TrE_Jm itemUM, 0 VendorId
 from CDN.TraElem
JOIN CDN.TraNag n ON TrE_TrNId = TrN_TrNID
where TrN_TypDokumentu=302

      
GO


