<?xml version="1.0" encoding="utf-8"?>
<!--
        
        ** OAGIS® Revision: 9.1  **
        ** Date: 11 May 2007 **
        ** Copyright 1997-2007, All Rights Reserved **
        
        This is an OAGIS® BOD XML Schema (XSD) Definition.
        
       License information for this file is provided in the file **OAGi License Agreement.txt** that is provided with this download package.
        
        For support, more information, or to report implementation bugs, please contact the Open Applications Group at xml@openapplications.org.
        
        XML Schema 
        
-->

<!--
© Copyright 2007 Infor Global Solutions Technology GmbH and/or its affiliates and subsidiaries. All rights reserved. The 
word and design marks set forth herein are trademarks and/or registered trademarks of Infor Global Solutions 
Technology GmbH and/or its affiliates and subsidiaries. All rights reserved. All other trademarks listed herein 
are the property of their respective owners.
 
-->

<!--    *****     Update Log     *****
 
Date          By      Note
28 Jul 2015   LA      New noun EmployeeTimeSheet, BOD-2976 
26 Aug 2015   LA      Updates based on review commen
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns="http://schema.infor.com/InforOAGIS/2"
        targetNamespace="http://schema.infor.com/InforOAGIS/2" elementFormDefault="qualified"
        attributeFormDefault="unqualified">
    
    <xsd:include schemaLocation="../Components/Common/Components.xsd"/>
    
    <xsd:element name="EmployeeTimesheet" type="EmployeeTimesheetType">
        <xsd:annotation>
            <xsd:documentation> 
                
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:complexType name="EmployeeTimesheetType">
        <xsd:sequence>
            <xsd:element ref="EmployeeTimesheetHeader" minOccurs="0"/>
            <xsd:element ref="EmployeeTimesheetLine" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="EmployeeTimesheetHeaderType">
        <xsd:complexContent>
            <xsd:extension base="StatusEnabledHeaderType">
                <xsd:sequence>
                    <xsd:element ref="TimesheetPeriod" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                Details about the period for which the time sheet is for
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:choice>
                        <xsd:element ref="Employee" minOccurs="0"/>
                        <xsd:element ref="PersonReference" minOccurs="0"/>    
                    </xsd:choice>
                    <xsd:element ref="ScheduleType" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                Should this be a reference to EmployeeWorkSchedule?
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="WorkLocation" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                Work location of the person, needed for tax purposes. 
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="PayRateCode" minOccurs="0" maxOccurs="unbounded">
                        <xsd:annotation>
                            <xsd:documentation>
                                Pay codes related to billable rates, maintained in the ERP.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="TotalDuration" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                Total duration for the time sheet. Generally, the duration 
                                will be mentioned in hours/minutes. This is the sum of regular hours and 
                                sum of all the actual type overtime hours. 
                                Example - 4.5 hours must be mentioned as PT4H30M
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="RegularDuration" minOccurs="0"/>
                    <xsd:element ref="OverTime" minOccurs="0" maxOccurs="unbounded">
                        <xsd:annotation>
                            <xsd:documentation>
                                Specifies the details of different types of overtime and the 
                                corresponding duration (hours)
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="TimeOffDuration" minOccurs="0"/>
                    <xsd:element ref="CreationDateTime" minOccurs="0"/>
                    <xsd:element ref="SubmissionDateTime" minOccurs="0"/> 
                    <xsd:element ref="ApprovalDateTime" minOccurs="0"/>
                    <xsd:element ref="CostCenterCode" minOccurs="0"/>
                    <xsd:element ref="Classification" minOccurs="0"/>
                    <xsd:element ref="UserArea" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="EmployeeTimesheetHeader" type="EmployeeTimesheetHeaderType"/>
    
    <xsd:complexType name="OverTimeType">
        <xsd:sequence>
            <xsd:element ref="Duration" minOccurs="0"/>
        </xsd:sequence>
        <xsd:attribute name="type" type="TokenType" use="optional">
            <xsd:annotation>
                <xsd:documentation>
                    Specifies the type of overtime (Planned/Pre-approved, Actual, External)
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="category" type="TokenType" use="optional">
            <xsd:annotation>
                <xsd:documentation>
                    Specifies various categories of overtime - general, double time, triple time etc.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
    </xsd:complexType>
    <xsd:element name="OverTime" type="OverTimeType"/>
    
    <xsd:complexType name="PayRateCodeType">
        <xsd:complexContent>
            <xsd:extension base="CodeType">
                <xsd:attribute name="category" type="TokenType" use="optional">
                    <xsd:annotation>
                        <xsd:documentation>
                            Specifies various categories of overtime - general, double time, triple time etc.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="PayRateCode" type="PayRateCodeType"/>
    
    <xsd:complexType name="EmployeeTimesheetLineType">
        <xsd:complexContent>
            <xsd:extension base="StatusEnabledLineType">
                <xsd:sequence>
                    <xsd:element ref="LineDate" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                Date for which the time sheet line is being entered. 
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="StartTime" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                Start work time for the day (first in time for the lien date) 
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="EndTime" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                End work time for the day (final out time for line date)
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="TimeEntryDetail" minOccurs="0" maxOccurs="unbounded">
                        <xsd:annotation>
                            <xsd:documentation>
                                Specifies the time entry details for a single or multiple projects
                                on the line date.
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="RegularDuration" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                Sum of regular hours logged for the line (sum of all project regular hours and general hours)
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="OverTime" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="TimeOffDuration" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                Specifies the time off/absence hours. Do we need an absence type?
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="Attendance" minOccurs="0" maxOccurs="unbounded">
                        <xsd:annotation>
                            <xsd:documentation>
                                SPecifies the various in and out times - requirement in some countries
                                for legal reporting
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="CostCenterCode" minOccurs="0"/>
                    <xsd:element ref="Classification" minOccurs="0"/>
                    <xsd:element ref="UserArea" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension> 
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="EmployeeTimesheetLine" type="EmployeeTimesheetLineType"/>
    
    <xsd:complexType name="TimeEntryDetailType">
        <xsd:sequence>
            <xsd:element ref="ProjectReference" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Specifies any reference to a project, 
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="WorkLocation" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Any specific work location for the project
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="CostCenterCode" minOccurs="0"/>
            <xsd:element ref="Task" minOccurs="0">
                <xsd:annotation> 
                    <xsd:documentation>
                        Specifies the actual task code for which the hours are logged
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="BillableIndicator" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates whether the current task is billable or not
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            
            <xsd:element ref="TaskPayRateCode" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Specific pay code for the task. 
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="TaskPayRate" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Pay rate per hour could be specified in the absence of a pay rate code. 
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="TaskRole" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        The role of the task for which the current pay rate (code) is applicable. 
                        E.g. Project Manager, Consultant, Support
                        Generally used for reporting purposes.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="Description" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="DurationType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        The type of hours that are being entered - regular, double time, travel time etc.
                        Depending on the type, the sum of these would be available at  TimesheetLine/RegularDuration
                        or TimesheetLine/OverTime (with appropriate category) or TimesheetLine/TimeOffDuration
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="Duration" minOccurs="0"/>            
            <xsd:element ref="ApprovedDuration" minOccurs="0"/>
            <xsd:element ref="ApproverPersonReference" minOccurs="0"/>
            <xsd:element ref="Classification" minOccurs="0"/>
            <xsd:element ref="UserArea" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="TimeEntryDetail" type="TimeEntryDetailType"/>
    
    <xsd:complexType name="AttendanceType">
        <xsd:sequence>
            <xsd:element ref="InTime" minOccurs="0"/>
            <xsd:element ref="OutTime" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="Attendance" type="AttendanceType"/>
    
    <xsd:complexType name="TaskPayRateType">
        <xsd:sequence>
            <xsd:element ref="Amount" minOccurs="0"/>
            <xsd:element ref="PerDuration" minOccurs="0"> 
                <xsd:annotation>
                    <xsd:documentation>
                            Indicates the PerDuration side of this Amount. 
                            Typically, this value is 1 hour (PT1H), meaning that, 
                            e.g., a TaskPayRate with the Amount 50.5 USD would be the rate per hour or 
                            simply $50.5 per hour. 
                            For complex rates, the PayRate Amount might be $500.00 with a PerDuration of P1D, 
                            meaning the task pay rate would be $500 per day.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="TaskPayRate" type="TaskPayRateType"/>
    
    <xsd:element name="RegularDuration" type="DurationMeasureType"/>
    <xsd:element name="ApprovedDuration" type="DurationMeasureType"/>
    <xsd:element name="TimeOffDuration" type="DurationMeasureType"/>
    <xsd:element name="TimesheetPeriod" type="TimePeriodType"/>
    <xsd:element name="TotalDuration" type="DurationMeasureType"/>
    <xsd:element name="TaskPayRateCode" type="PayRateCodeType"/>
    <xsd:element name="DurationType" type="CodeType"/>
    <xsd:element name="StartTime" type="TimeType"/>
    <xsd:element name="EndTime" type="TimeType"/>
    <xsd:element name="LineDate" type="DateType"/>
    <xsd:element name="InTime" type="TimeType"/>
    <xsd:element name="OutTime" type="TimeType"/>
    <xsd:element name="TaskRole" type="CodeType"/>
    
    <!-- <xsd:element name="TaskPayRate" type="AmountType"/> -->
</xsd:schema>
