<?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
    10 Nov 2016   LA        New noun for promotion; BOD-3246
*****     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/Operational/OrderManagementComponents.xsd"/>
    
    <xsd:element name="Promotion" type="PromotionType">
        <xsd:annotation>
            <xsd:documentation source="http://schema.infor.com/InforOAGIS/2">
                To specify sales promotions for a channel
             </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:complexType name="PromotionType">
        <xsd:complexContent>
            <xsd:extension base="StatusEnabledStandardHeaderType">
                <xsd:sequence>
                    <xsd:element ref="Name" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="ChannelCode" minOccurs="0"/>
                    <xsd:element ref="EffectiveTimePeriod" minOccurs="0"/>
                    <xsd:element ref="PromotionDateBasis" minOccurs="0"/>
                    <xsd:element ref="PromotionPriceBasis" minOccurs="0"/>
                    <xsd:element ref="OrderLevelApplicabilityIndicator" minOccurs="0"/>
                    <xsd:element ref="ItemQualification" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="CustomerQualification" minOccurs="0"/>
                    <xsd:group ref="ApplicablePromotion" minOccurs="0"/>
                    <xsd:element ref="UserArea" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    
     <xsd:complexType name="ItemQualificationType">
        <xsd:sequence>
            <xsd:choice>
                    <xsd:element ref="PromotionItem" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="ItemClassification" minOccurs="0" maxOccurs="unbounded"/>
            </xsd:choice>
            <xsd:element ref="EffectiveTimePeriod" minOccurs="0"/>
            <xsd:element ref="UserArea" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ItemQualification" type="ItemQualificationType">
        <xsd:annotation>
            <xsd:documentation>
                All criteria that must be met for items qualifying for promotions;
                individual items or a classification of items could be specified.
                Optional qualifying UOM Code for an item could also be specified
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:complexType name="CustomerQualificationType">
        <xsd:sequence>
            <xsd:choice>
                <xsd:element ref="CustomerParty" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="CustomerClassification" minOccurs="0" maxOccurs="unbounded"/>
            </xsd:choice>
            <xsd:element ref="UserArea" minOccurs="0"/>
        </xsd:sequence>    
    </xsd:complexType>
    <xsd:element name="CustomerQualification" type="CustomerQualificationType">
        <xsd:annotation>
            <xsd:documentation>
                All criteria that must be met for customers qualifying for promotions
                Any classification of customers (like customers belonging to a specific area, 
                belonging to a specific customer type etc could be specified with Classification
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:complexType name="PromotionItemType">
        <xsd:complexContent>
            <xsd:extension base="ItemBaseType">
                <xsd:sequence>
                    <xsd:element ref="QualifyingUOMCode" minOccurs="0"/>
                    <xsd:element ref="UserArea" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="PromotionItem" type="PromotionItemType"/>
    
   
    <xsd:group name="ApplicablePromotion">
        <xsd:sequence>
            <xsd:element ref="Type" minOccurs="0"/>
            <xsd:choice>
                <xsd:element ref="OffInvoice" minOccurs="0"/>
                <xsd:element ref="BillBack" minOccurs="0"/>
                <!-- There could be other options - like a free good, or trade-in promotions etc.
                            When these choice options are provided, it is also required to change the 
                            order details accordingly to handle these types of promotions -->
            </xsd:choice>
        </xsd:sequence>
    </xsd:group>
        
    <xsd:element name="OffInvoice" type="PriceBreakType">
        <xsd:annotation>
            <xsd:documentation>
                To specify a promotion in the form of a discount percent or an amount
                or a fixed changed price
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:complexType name="BillBackType">
        <xsd:sequence>
            <xsd:choice>
                <xsd:element ref="DiscountPercent" minOccurs="0"/>
                <xsd:sequence>
                    <xsd:element ref="DiscountAmount" minOccurs="0"/>
                    <xsd:element ref="DiscountBaseAmount" minOccurs="0"/>
                    <xsd:element ref="DiscountReportAmount" minOccurs="0"/>
                </xsd:sequence>
            </xsd:choice>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="BillBack" type="BillBackType">
        <xsd:annotation>
            <xsd:documentation>
                To specify pending discount (% or amount) or credit that is not earned yet; 
                Can be earned via external events to reduce A/R on an invoice
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="OrderLevelApplicabilityIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation>
                Indicates whether the promotion is applicable at the order level.
                When set to false, it indicates a line level promotion. 
                The default value is false
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="QualifyingUOMCode" type="UOMCodeType">
        <xsd:annotation>
            <xsd:documentation>
                UOMCode for which the promotion is applicable; when nothing is specified
                promotion is applicable for all items the item could be sold in.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="ItemClassification" type="SemanticClassificationType">
        <xsd:annotation>
            <xsd:documentation>
                Classification of items for which the given promotion is applicable
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="CustomerClassification" type="SemanticClassificationType">
        <xsd:annotation>
            <xsd:documentation>
                Classification of customers for which the given promotion is applicable
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:element name="PromotionDateBasis" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>
                Specifies which date must fall in the promotion's effective date time period.
                CreationDate, RequestedShipToDate, pricing date etc.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="PromotionPriceBasis" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>
                Specifies on which price the promotion must be applied - 
                Item's list price, 
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
</xsd:schema>
