SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE VIEW [dbo].[TFM_vfRechnungsausgangsbuch]

AS

/* Hier findet das Mapping der Spalten zwischen DWH und Transformer statt, der historisch bedingt ist. */


SELECT [Mandant ID]					
      ,[Standort_ID]										AS [Standort_ID]						
      --,[Faktenart_ID]										AS [Faktenart_ID]						
      --,[Faktenart_Name]								AS [Faktenart_Name]				
      ,[Rechnungsnummer]									AS [Rechnungsnummer]					
      ,[Invoice Date]										AS [Invoice Date]						
      ,[Kundennummer]										AS [Kundennummer]						
      ,[Umsatzart]											AS [Umsatzart]							
      ,[Plz]												AS [Plz]		
	  ,[SachbearbeiterNr]									AS [SachbearbeiterNr]
      ,[Kundengruppe]										AS [Kundengruppe]						
      ,[KostRechMerkMarke]									AS [KostRechMerkMarke]					
      ,[Vorgangspositionsnummer]							AS [Vorgangspositionsnummer]			
      ,[Kostenstelle]										AS [Kostenstelle]						
      ,[Kostenstelle_VorgPosi]								AS [Kostenstelle_VorgPosi]				
      ,[Model]												AS [Model]								
      ,[Fahrgestellnummer]									AS [Fahrgestellnummer]					
      ,[Fahrzeug]											AS [Fahrzeug]							
      ,[Rechnung / Gutschrift]								AS [Rechnung / Gutschrift]				
      ,[Auftragsart]										AS [Auftragsart]						
      ,[Order Desc 100]										AS [Order Desc 100]						
      ,[Order Desc 30]										AS [Order Desc 30]	
	  ,[Order Number]										AS [Order Number]			
      ,[Rechnungsausgang]									AS [Rechnungsausgang]					
      ,[Invoice Desc 100]									AS [Invoice Desc 100]					
      ,[Invoice Desc 30]									AS [Invoice Desc 30]					
      ,[FZG-Altersstaffel]									AS [FZG-Altersstaffel]					
      ,[Produktbuchungsgruppe]								AS [Produktbuchungsgruppe]				
      ,[DB1_><_EK]											AS [DB1_><_EK]							
      ,[Menge]												AS [Menge]								
      ,[Verkaufsbetrag]										AS [Verkaufsbetrag]						
      ,[Einkaufsbetrag]										AS [Einkaufsbetrag]						
      ,[Lohn]												AS [Lohn]								
      ,[Teile]												AS [Teile]								
      ,[EW Teile]											AS [EW Teile]							
      ,[TÜV]												AS [TÜV]								
      ,[Fremdl.]											AS [Fremdl.]							
      ,[EW Fremdl.]											AS [EW Fremdl.]							
      ,[Mietw.]												AS [Mietw.]								
      ,[Rädereinl.]											AS [Rädereinl.]							
      ,[verk. Std.]											AS [verk. Std.]							
	  ,[verk. Std. Monteur]									AS [verk. Std. Monteur]	
      ,[NL Lohn]											AS [NL Lohn]							
      ,[NL Teile]											AS [NL Teile]							
      ,[verk. Std. (pro Vorgang)]							AS [verk. Std. (pro Vorgang)]			
      ,[Lohn (pro Vorgang)]									AS [Lohn (pro Vorgang)]					
      ,[ben.Std.]											AS [ben.Std.]							
      ,[Fahrzeugalter (in Tag.)]							AS [Fahrzeugalter (in Tag.)]			
      ,[Fahrzeugalter (in Jahr.)]							AS [Fahrzeugalter (in Jahr.)]			
      ,[DG]													AS [DG]									
      ,[Hauptbetrieb_ID]									AS [Hauptbetrieb_ID]					
      ,[Fokus-Produktgruppe]								AS [Fokus-Produktgruppe]				
      ,[Parts Make Desc]									AS [Parts Make Desc]					
      ,[Parts Group Desc]									AS [Parts Group Desc]					
      ,[NL Sonst.]											AS [NL Sonst.]							
      ,[Repair_Group_Desc]									AS [Repair_Group_Desc]					
      ,[Auftragsposition]									AS [Auftragsposition]					
	  ,[Menge Leistung]										AS [Menge Leistung]
	  ,[Preiskennzeichen Leistung]
	  ,[Einheit Leistung]
  FROM [fRechnungsausgangsbuch]
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
