<?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.
    
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:oa="http://www.openapplications.org/oagis/9" xmlns="http://schema.infor.com/Infor1.0"
targetNamespace="http://schema.infor.com/Infor1.0" elementFormDefault="qualified"
attributeFormDefault="unqualified">

    <xsd:import namespace="http://www.openapplications.org/oagis/9"
        schemaLocation="../../../9.0/Resources/Nouns/Receivable.xsd"/>
    <xsd:include schemaLocation="../Components/Common/Components.xsd"/>

    <xsd:element name="Receivable" type="ReceivableType" />
    
    <xsd:complexType name="ReceivableType">
        <xsd:sequence>
            <xsd:element ref="ReceivableHeader" minOccurs="0" />
            <xsd:element ref="ReceivableLine" minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="ReceivableHeader" type="ReceivableHeaderType" />
    <xsd:element name="ReceivableLine" type="ReceivableLineType" />

    <xsd:complexType name="ReceivableHeaderType">
        <xsd:complexContent>
            <xsd:extension base="oa:StatusEnabledHeaderType">
                <xsd:sequence>
                    <xsd:element ref="oa:CustomerParty" minOccurs="0"/>
                    <xsd:element ref="oa:BillToParty" minOccurs="0"/>
                    <xsd:element ref="oa:ShipToParty" minOccurs="0"/>
                    <xsd:element ref="SalesLocation" minOccurs="0"/>
                    <xsd:element ref="oa:PaymentTerm" minOccurs="0"/>
                    <xsd:element ref="ReceivableStyle" minOccurs="0"/>
                    <xsd:element ref="InvoiceReference" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="oa:ShipmentReference" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="oa:Classification" minOccurs="0"/>
                    <xsd:element ref="oa:ExtendedAmount" minOccurs="0"/>
                    <xsd:element ref="oa:TotalAmount" minOccurs="0"/>
                    <xsd:element ref="oa:Tax" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="oa:Allowance" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="oa:Charge" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="Discount" minOccurs="0"/>
                    <xsd:element ref="ReceivableAmount" minOccurs="0"/>
                    <xsd:element ref="ReceiptAmount" minOccurs="0"/>
                    <xsd:element ref="ReceivedAmount" minOccurs="0"/>
                    <xsd:element ref="WriteOffAmount" minOccurs="0"/>
                    <xsd:element ref="oa:CurrencyExchangeRate" minOccurs="0"/>
                    <xsd:element ref="MiscAdjustments" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="ReceivableLineType">
        <xsd:complexContent>
            <xsd:extension base="oa:StatusEnabledLineType">
                <xsd:sequence>
                    <xsd:group ref="oa:ItemInstanceGroup"/>
                    <xsd:element ref="oa:Type"/>
                    <xsd:element ref="oa:DocumentDateTime" minOccurs="0"/>
                    <xsd:element ref="oa:Amount" minOccurs="0"/>
                    <xsd:element ref="oa:Tax" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="InvoiceReference" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="MiscAdjustmentsType">
        <xsd:sequence>
            <xsd:element ref="oa:Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Amount" type="oa:AmountType"/>
            <xsd:element name="DocumentDateTime" type="oa:DateTimeType"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="SalesLocation" type="oa:LocationType"/>
    <xsd:element name="MiscAdjustments" type="MiscAdjustmentsType"/>
    <xsd:element name="ReceivableAmount" type="oa:AmountType"/>
    <xsd:element name="ReceiptAmount" type="oa:AmountType"/>
    <xsd:element name="ReceivedAmount" type="oa:AmountType"/>
    <xsd:element name="WriteOffAmount" type="oa:AmountType" />    
    <xsd:element name="ReceivableStyle" type="oa:StringType">
        <xsd:annotation>
            <xsd:documentation> This is the type of document that caused this receivable to exist. 
                This will be an Infor managed dimension. Expected codes in this dimension will be 
                Invoice, Deposit, Contract, ProgressBilling, CreditMemo, Miscellaneous.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
</xsd:schema>
