SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
-- auto-generated definition
CREATE view load.Aftersales_Rechnungen_Focus_Group as
select convert(int, [Invoice Type])                        AS [Invoice Type],
       convert(int, [Invoice Number])                      AS [Invoice Number],
       convert(int, [Subsidiary])                          AS [Subsidiary],
       convert(datetime, [Invoice Date])                   AS [Invoice Date],
       convert(datetime, [Service Date])                   AS [Service Date],
       convert(int, [Is Canceled])                         AS [Is Canceled],
       convert(int, [Vehicle Number])                      AS [Vehicle Number],
       convert(varchar(20), [Invoice_Type_Invoice_Number]) AS Invoice_Type_Invoice_Number,
       convert(varchar(20), [Hauptbetrieb_ID])             AS Hauptbetrieb_ID,
       convert(varchar(50), [Hauptbetrieb_Name])           AS Hauptbetrieb_Name,
       convert(varchar(20), [Standort_ID])                 AS Standort_ID,
       convert(varchar(50), [Standort_Name])               AS Standort_Name,
       convert(varchar(150), [Serviceberater])             AS Serviceberater,
       convert(varchar(20), [Umsatzart])                   AS Umsatzart,
       convert(varchar(255), [Fabrikat])                   AS Fabrikat,
       convert(varchar(255), [Description_Makes])          AS Description_Makes,
       convert(varchar(255), [Description_Models])         AS Description_Models,
       convert(varchar(20), [Model])                       AS Model,
       convert(varchar(100), [Fahrzeug])                   AS Fahrzeug,
       convert(varchar(100), [Kostenstelle])               AS Kostenstelle,
       convert(varchar(50), [Marke])                       AS Marke,
       convert(varchar(50), [Auftragsart])                 AS Auftragsart,
       convert(varchar(100), [Geschäftsart])               AS Geschäftsart,
       convert(varchar(150), [Kunde])                      AS Kunde,
       convert(decimal(28, 8), [Time Units])               AS [Time Units],
       convert(decimal(28, 8), [Time Units_Zahl])          AS [Time Units_Zahl],
       convert(decimal(28, 8), [AW/Std.])                  AS [AW/Std.],
       convert(decimal(28, 8), [verk. Std. Focus])         AS [verk. Std. Focus],
       convert(varchar(250), [Order Number])               AS [Order Number],
       convert(varchar(250), [Order Number_Rg_Ausg])       AS [Order Number_Rg_Ausg],
       convert(varchar(100), Kundenart)                    AS Kundenart,
       convert(varchar(100), [Labour Operation Id])        AS [Labour Operation Id],
       convert(varchar(300), [Text Line])                  AS [Text Line],
       convert(decimal(28, 8), [Umsatz Focus])             AS [Umsatz Focus],
       convert(decimal(28, 8), [Rebate Percent])           AS [Rebate Percent],
       convert(varchar(50), [Focus Group])                 AS [Parts_Focus_Group],
       convert(varchar(50), [Parts Number])                AS [Parts_Make_Desc],
       convert(decimal(28, 8), [Menge Focus])              AS [Menge Focus],
       convert(varchar(100), Inv_Type_Number_Parts_Number) AS Inv_Type_Number_Parts_Number,
       convert(varchar(20), [Gmpd Group])                  AS [Gmpd Group],
       convert(decimal(28, 8), [Provision Betrag])         AS [Provision Betrag],
       convert(decimal(28, 8), [Provision SB])             AS [Provision SB],
       convert(varchar(50), [Employee_Function])           AS Employee_Function,
       convert(varchar(50), [Zuordnung_Funktion])          AS Zuordnung_Funktion
from transform.Aftersales_Rechnungen_Focus_Group
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
