SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
-- auto-generated definition
CREATE view load.Aftersales_Rechnungen_neu AS
select convert(varchar(10), Hauptbetrieb_ID)               as Hauptbetrieb_ID,
       convert(varchar(50), Hauptbetrieb_Name)             as Hauptbetrieb_Name,
       convert(varchar(10), Standort_ID)                   as Standort_ID,
       convert(varchar(50), Standort_Name)                 as Standort_Name,
       convert(varchar(20), Employee_Function)             as Employee_Function,
       convert(varchar(150), Serviceberater)               as Serviceberater,
       convert(varchar(500), Order_Number)                 as [Order Number],
       convert(varchar(500), Invoice_Desc_100)             as Invoice_Desc_100,
       convert(varchar(100), Fabrikat)                     as Fabrikat,
       convert(varchar(50), Model)                         as Model,
       convert(varchar(100), Fahrzeug)                     as Fahrzeug,
       convert(varchar(56), Kostenstelle)                  as Kostenstelle,
       convert(varchar(50), Marke)                         as Marke,
       convert(varchar(20), Umsatzart)                     as Umsatzart,
       convert(varchar(20), Auftragsart)                   as Auftragsart,
       convert(varchar(20), Auftragsposition)              as Auftragsposition,
       convert(varchar(20), Kundenart)                     as Kundenart,
       convert(varchar(250), Kunde)                        as Kunde,
       convert(varchar(500), Order_Desc_30)                as Order_Desc_30,
       convert(varchar(500), Invoice_Desc_30)              as Invoice_Desc_30,
       convert(varchar(50), c22)                           as Zuordnung_Produktbuchungsgruppe,
       convert(varchar(100), Produktbuchungsgruppe)        as Produktbuchungsgruppe,
       convert(varchar(20), FZG_Altersstaffel)             as [FZG-Altersstaffel],
       convert(varchar(50), Repair_Group_Desc)             as Repair_Group_Desc,
       convert(varchar(20), DB1____EK)                     as [DB1_><_EK],
       convert(varchar(20), Rechnung_Gutschrift)           as Rechnung_Gutschrift,
       convert(varchar(50), Parts_Focus_Group)             as Parts_Focus_Group,
       convert(varchar(50), Parts_Make_Desc)               as Parts_Make_Desc,
       convert(varchar(50), Parts_Group_Desc)              as Parts_Group_Desc,
       convert(varchar(20), PLZ_1_Stelle)                  as PLZ_1_Stelle,
       convert(varchar(20), PLZ_2_Stelle)                  as PLZ_2_Stelle,
       convert(varchar(20), PLZ_3_Stelle)                  as PLZ_3_Stelle,
       convert(varchar(20), PLZ_4_Stelle)                  as PLZ_4_Stelle,
       convert(varchar(100), PLZ)                          as PLZ,
       convert(varchar(20), Zuordnung_Funktion)            as Zuordnung_Funktion,
       convert(varchar(500), Order_Desc_100)               as Order_Desc_100,
       convert(decimal(28, 8), Lohn_Umsatz)                as Lohn,
       convert(decimal(28, 8), Teile_Umsatz)               as Teile,
       convert(decimal(28, 8), EW_Teile)                   as [EW Teile],
       convert(decimal(28, 8), Sonst_)                     as [Sonst.],
       convert(decimal(28, 8), TÜV)                        as TÜV,
       convert(decimal(28, 8), Fremdl_)                    as [Fremdl.],
       convert(decimal(28, 8), Mietw_)                     as [Mietw.],
       convert(decimal(28, 8), Rädereinl_)                 as [Rädereinl.],
       convert(decimal(28, 8), verk__Std_)                 as [verk. Std.],
       convert(decimal(28, 8), ben__Std_)                  as [ben. Std.],
       convert(decimal(28, 8), NL_Lohn)                    as [NL Lohn],
       convert(decimal(28, 8), NL_Teile)                   as [NL Teile],
       convert(decimal(28, 8), NL_Sonst_)                  as [NL Sonst.],
       convert(decimal(28, 8), [NL_Sonst__])               as [NL Sonst %],
       convert(decimal(28, 8), DG)                         as DG,
       convert(decimal(28, 8), Anz__AT)                    as [Anz. AT],
       convert(varchar(20), Anwesenheit_Mech_Karo_Lack)    as [Anwesenheit Mech Karo Lack],
       convert(varchar(20), Anwesenheit_Meister)           as [Anwesenheit Meister],
       convert(datetime, Invoice_Date)                     as [Invoice Date],
       convert(varchar(500), Rechnungsausgang)             as Rechnungsausgang,
       convert(int, Fabrikat_Order_By)                     as Fabrikat_Order_By,
       convert(decimal(28, 8), [EW_Fremdl_])               as [EW Fremdl.],
       convert(varchar(150), Serviceberater_Rg_Steller)    as Serviceberater_Rg_Steller
from transform.Aftersales_Rechnungen_neu
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
