


 CREATE VIEW [dbo].[ApiWmsBaseLinesView] as
 select 
 --d.Korekta,  pn.IloscValue,
 TrE_TrEID LineId, TrE_TrNId ObjectId, 10 ObjectType,
 TrE_TwrId ItemId, 
Twr_Kod ItemCode, Twr_Nazwa ItemName, 
 TrE_Ilosc Quantity
, TrE_Jm UM , 
 TrE_Ilosc [Quantity2], 
   TrE_Jm UM2, cast( 1 as decimal) [UMRatio],
Twr_EAN Barcode, '' ItemFeatures,  
--'' FeatureType,
'' FeatureType,
'' [Description]
  from CDN.TraElem p  JOIN CDN.Towary t ON p.TrE_TwrId = t.Twr_TwrId and t.Twr_Typ =1
  JOIN CDN.TraNag d ON TrN_TrNID = TrE_TrNId
  
  
GO



