<?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
08 Aug 2011    NO      First version - draft.
06 Sep 2011   NO      Initial Check-in (JIRA BOD-1390)

*****     Update End     *****
 
-->


<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="ServiceContract" type="ServiceContractType">
        <xsd:annotation>
            <xsd:documentation >The Contract is a light-weight version of the noun which will be created in conjucntion with the pricing evolve component.</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:complexType name="ServiceContractType">
        <xsd:sequence>
            <xsd:element ref="ServiceContractHeader" minOccurs="0"/>
            <xsd:element ref="ServiceContractLine" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
        
    <xsd:complexType name="ServiceContractHeaderType">
        <xsd:complexContent>
            <xsd:extension base="StatusEnabledHeaderType">
                <xsd:sequence>
                    <xsd:element ref="CustomerParty" minOccurs="0"/>
                    <xsd:element ref="ShipToParty" minOccurs="0"/>
                    <xsd:element ref="BillToParty" minOccurs="0"/>
                    <xsd:element ref="PayFromParty" minOccurs="0"/>
                    <xsd:element ref="SupplierParty" minOccurs="0"/>
                    <xsd:element ref="ShipFromParty" minOccurs="0" maxOccurs="unbounded"/>   
                    <xsd:element ref="RemitToParty" minOccurs="0"/>
                    <xsd:element ref="Location" minOccurs="0" maxOccurs="unbounded"/> 
                    <xsd:element ref="BuyerReference" minOccurs="0"/>
                    <xsd:element ref="UserArea" minOccurs="0"/>
                    <xsd:element ref="SalesPersonReference" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="ContractTypeCode" minOccurs="0"/>
                    <xsd:element ref="Classification" minOccurs="0"/>
                    <xsd:element ref="IndexationTimePeriod" minOccurs="0"/>
                    <xsd:element ref="RenewalTimePeriod" minOccurs="0"/>
                    <xsd:element ref="PaymentTerm" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="PricingMethodCode" minOccurs="0"/>
                    <xsd:element ref="ContractTemplateCode" minOccurs="0"/>
                    <xsd:element ref="ContractPrice" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    
    <xsd:element name="ServiceContractHeader" type="ServiceContractHeaderType"/>
    
    <xsd:complexType name="ServiceContractLineType">
        <xsd:sequence>
            <xsd:element ref="LineNumber" minOccurs="0"/>
            <xsd:element ref="EffectiveTimePeriod" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>from the 'OTIS UK Design Document SMSLN1.04 - ERP5.0c Contracts 
                        Integration' -  contractEffectiveDate and contractExpiryDate..</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="ContractBasisCode" minOccurs="0"/>
            <xsd:element ref="ContractPrice" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="ShipToParty" minOccurs="0" />
            <xsd:element ref="TransportationTerm" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="Status" minOccurs="0"/>
            <xsd:element ref="AgreedQuantity" minOccurs="0"/>
            <xsd:element ref="MinimumQuantity" minOccurs="0"/>
            <xsd:element ref="MaximumQuantity" minOccurs="0"/>
            <xsd:element ref="LSPProcessIndicator" minOccurs="0"/>
            <xsd:element ref="CUMUpdateBasisCode" minOccurs="0"/>
            <xsd:element ref="Reference" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="UserArea" minOccurs="0"/>
            <xsd:element ref="DeviatingCustomerOrderNumberActionCode" minOccurs="0"/>
            <xsd:element ref="DeviatingEmptyCustomerOrderNumberActionCode" minOccurs="0"/>
            <xsd:element ref="ConfiguredAsset" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="SupervisorPerson" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="CoverageTermGroup" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="ContractTemplateCode" minOccurs="0"/>
        </xsd:sequence>
        <xsd:attribute name="sequence" type="PositiveIntegerNumericType" use="optional"/>
    </xsd:complexType>
    
    <xsd:element name="ServiceContractLine" type="ServiceContractLineType"/>
    
    <xsd:complexType name="ContractPriceType">
        <xsd:sequence>
            <xsd:element ref="Item" minOccurs="0"/>
            <xsd:element ref="Location" minOccurs="0"/>
            <xsd:element ref="TargetQuantity" minOccurs="0"/>
            <xsd:element ref="ContractAmount"  minOccurs="0"/>
            <xsd:element ref="BaseCurrencyAmount" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="CostAmount" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>The sum of the cost amounts of all coverage terms that are associated 
                        with the indicated service type or term type.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="SalesAmount" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="ContractPrice" type="ContractPriceType"/>
      
    <xsd:element name="ContractBasisCode" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>These will be in the Dimension ContractBasis and will have initially the 
                values of Order, Ship, Delivery.</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:element name="ContractAmount" type="AmountType"/>
    
    <xsd:element name="TargetQuantity" type="QuantityType"/>
    <xsd:element name="AgreedQuantity" type="QuantityType"/>
    
    <xsd:element name="DeviatingEmptyCustomerOrderNumberActionCode" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>This field is used for the handling of an empty CON value in a Sales Release. 
                This can be different from the handling of a non-empty CON value in the Release.</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
     
    <xsd:element name="DeviatingCustomerOrderNumberActionCode" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>This field is used for handling situations where the incoming Sales Release 
                has a non-empty CON, but the CON value differs from the one in the contract.</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
   
    <xsd:element name="ContractTypeCode" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>from the 'OTIS UK Design Document SMSLN1.04 - ERP5.0c Contracts 
                Integration' - ContractTypeCode; String 9</xsd:documentation>
        </xsd:annotation>
    </xsd:element>    

    <xsd:element name="SupervisorPerson" type="PersonType">
        <xsd:annotation>
            <xsd:documentation>from the 'OTIS UK Design Document SMSLN1.04 - ERP5.0c Contracts 
                Integration' - Supervisor (Service Office); String 6</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:element name="IndexationTimePeriod" type="TimePeriodType">
        <xsd:annotation>
            <xsd:documentation>Indexation can be applied  to the service contract price. Indexation 
                enables you to lower or raise the price of the service contract at given intervals</xsd:documentation>
        </xsd:annotation>        
    </xsd:element>
    
    <xsd:element name="RenewalTimePeriod" type="TimePeriodType">
        <xsd:annotation>
            <xsd:documentation>Service contract describes the terms and conditions between the service provider 
                and the customer. Service contracts can be renewed to provide extended services and thereby, 
                additional stream of revenue to the service organization.</xsd:documentation>
        </xsd:annotation>        
    </xsd:element>
    
    <xsd:element name="PricingMethodCode" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>The method indicating how the contract price is determined. 
                The following pricing methods are available:
                • Sales Value of Configuration 
                • Budgeted Service Costs 
                • Installation Group/Item Pricing </xsd:documentation>
        </xsd:annotation>        
    </xsd:element>
    
    <xsd:element name="CostCoveringMethodCode" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>A method that determines how the costs of the service order are covered by the service contract.
                The following cost-covering methods are available:
                Fixed Price , Ceiling , Coverage Percentage, Ceiling on Coverage Percentage, Exclusion, Own Risk  </xsd:documentation>
        </xsd:annotation>        
    </xsd:element>    
    
    <xsd:element name="ContractTemplateCode" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>Templates for service contracts and service-contract quotations are prepared in advance. You can use the 
                templates to save time as you need not retype similar information. Templates are generic and can be made specific to 
                the item with a definition of price per period. These templates are not specific to customers and do not have specific 
                cluster lines, but the templates themselves are specific to items. </xsd:documentation>
        </xsd:annotation>        
    </xsd:element>
    
    <xsd:element name="SalesAmount" type="AmountType">
        <xsd:annotation>
            <xsd:documentation>Need description for this element...</xsd:documentation>
        </xsd:annotation>        
    </xsd:element>
    
    
    <xsd:complexType name="CoverageTermGroupType">
        <xsd:sequence>
            <xsd:element ref="CoverageTypeCode" minOccurs="0"/>
            <xsd:element ref="ServiceContractTerm" minOccurs="0"/>
            <xsd:element ref="CostCoveringMethodCode" minOccurs="0"/>
            <xsd:element ref="CeilingAmount" minOccurs="0"/>
            <xsd:element ref="CoveragePercentage" minOccurs="0"/>
            <xsd:element ref="CostAmount" minOccurs="0"/>
            <xsd:element ref="SalesAmount" minOccurs="0"/>
            <xsd:element ref="UserArea" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="CoverageTermGroup" type="CoverageTermGroupType"/>       
    
    <xsd:element name="ServiceContractTerm" type="TermType">
        <xsd:annotation>
            <xsd:documentation>Categories used to group costs. Term types enable you to have a more detailed view of the source of costs.
                The Contract Management module in Service distinguishes the following term types:
                Material , Labor, Tooling, Traveling, Subcontracting, Help Desk, Other, Uptime, All</xsd:documentation>
        </xsd:annotation>        
    </xsd:element>
    
    <xsd:element name="CeilingAmount" type="AmountType">
        <xsd:annotation>
            <xsd:documentation>The agreed limit up to which the costs are covered by the contract, quotation, order, or warranty.
                If the Ceiling on Coverage Percentage method is selected, this is the discount limit.
                In this case it is the phase term that holds the discount information, and not the coverage term.</xsd:documentation>
        </xsd:annotation>              
    </xsd:element>
    
    <xsd:element name="CoveragePercentage" type="PercentType">
        <xsd:annotation>
            <xsd:documentation>The percentage that you can subtract from the gross sales price or purchase price.
                In this case the phase term holds the discount information.</xsd:documentation>
        </xsd:annotation>        
    </xsd:element>
 
    
</xsd:schema>
