SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE     VIEW [transform].[Zeit_Stempelungen_Pausen] AS

select "GC_Department"."Hauptbetrieb_ID"           AS "Hauptbetrieb_ID",
       "GC_Department"."Hauptbetrieb_Name"         AS "Hauptbetrieb_Name",
       "GC_Department"."Standort_ID"               AS "Standort_ID",
       "GC_Department"."Standort_Name"             AS "Standort_Name",
       "GC_Mitarbeiter"."Zuordnung_Funktion"       AS "Monteur_Gruppe",
       "GC_Mitarbeiter"."Zuordnung_Funktion"       AS "Monteur_Gruppe_2",
       "Zeit_Stempelungen_Pausen"."Monteur"        AS "Monteur",
       "Zeit_Stempelungen_Pausen"."Order Number"   AS "Order_Number",
       "Zeit_Stempelungen_Pausen"."Zeitkategorie"  AS "Activity_Codes_Group1",
       "Zeit_Stempelungen_Pausen"."Zeitkategorie2" AS "Activity_Codes_Group2",
       ''                                          AS "Activity_Desc",
       ''                                          AS "Kostenstelle",
       "Zeit_Stempelungen_Pausen"."Datum"          AS "Invoice_Date",
       0                                           AS "prod_",
       0                                           AS "unprod__falsch",
       0                                           AS "Abw_",
       0                                           AS "Extern",
       0                                           AS "GWL",
       0                                           AS "Intern",
       0                                           AS "Sollzeit",
       0                                           AS "TOY_produktiv_Zeit",
       0                                           AS "verr__Zeit_ohne_TOY",
       0                                           AS "ben__Zeit_ohne_TOY",
       0                                           AS "Anz__AT",
       "Zeit_Stempelungen_Pausen"."Anwesenheit"    AS "Anw_"
from (locosoft."Zeit_Stempelungen_Pausen" "Zeit_Stempelungen_Pausen" LEFT OUTER JOIN "data"."GC_Department" "GC_Department"
      on "Zeit_Stempelungen_Pausen"."Hauptbetrieb" = "GC_Department"."Hauptbetrieb" and
         "Zeit_Stempelungen_Pausen"."Standort" = "GC_Department"."Standort")
         LEFT OUTER JOIN "data"."GC_Mitarbeiter" "GC_Mitarbeiter"
                         on "Zeit_Stempelungen_Pausen"."Employee Number_Employees" = "GC_Mitarbeiter"."Employee_ID"
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
