<?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 Apr 2008    JB      Added correct Copyright and update comments to schema.
10 May 2010    NO      Added additional amounts for transaction currency
02 Jun 2010    NO      Changed cardinality of WriteOff to 0..*
19 Jan 2011    NO      Added UserArea (BOD-1464)
*****     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="ReceivableTransaction" type="ReceivableTransactionType" />
    
    <xsd:complexType name="ReceivableTransactionType">
        <xsd:sequence>
            <xsd:element ref="ReceivableTransactionHeader" minOccurs="0" />
            <xsd:element ref="ReceivableTransactionLine" minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="ReceivableTransactionHeader" type="ReceivableTransactionHeaderType" />
    <xsd:element name="ReceivableTransactionLine" type="ReceivableTransactionLineType" />

    <xsd:complexType name="ReceivableTransactionHeaderType">
        <xsd:complexContent>
            <xsd:extension base="StatusEnabledHeaderType">
                <xsd:sequence>
                    <xsd:element ref="CustomerParty" minOccurs="0"/>
                    <xsd:element ref="BillToParty" minOccurs="0"/>
                    <xsd:element ref="ShipToParty" minOccurs="0"/>
                    <xsd:element ref="PayFromParty" minOccurs="0"/>
                    <xsd:element ref="SalesLocation" minOccurs="0"/>
                    <xsd:element ref="PaymentTerm" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="ReceivableStyle" minOccurs="0"/>
                    <xsd:element ref="ReceivableStyleCategory" minOccurs="0"/>
                    <xsd:element ref="InvoiceReference" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="ShipmentReference" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="Classification" minOccurs="0"/>
                    <xsd:element ref="ExtendedAmount" minOccurs="0"/>
                    <xsd:element ref="ExtendedLocalAmount" minOccurs="0"/>
                    <xsd:element ref="TotalAmount" minOccurs="0"/>
                    <xsd:element ref="TotalLocalAmount" minOccurs="0"/>
                    <xsd:element ref="Tax" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="Allowance" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="Charge" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="DiscountStatus" minOccurs="0"/>
                    <xsd:element ref="PenaltyTakenAmount" minOccurs="0"/>
                    <xsd:element ref="ReceivableAmount" minOccurs="0"/>
                    <xsd:element ref="ReceiptAmount" minOccurs="0"/>
                    <xsd:element ref="ReceivedAmount" minOccurs="0"/>
                    <xsd:element ref="PaymentMethodCode" minOccurs="0"/>                    
                    <xsd:element ref="WriteOff" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="CurrencyExchangeRate" minOccurs="0"/>
                    <xsd:element ref="MiscAdjustments" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="BaseCurrencyAmount" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="UserArea" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="ReceivableTransactionLineType">
        <xsd:complexContent>
            <xsd:extension base="StatusEnabledLineType">
                <xsd:sequence>
                    <xsd:group ref="ItemInstanceGroup"/>
                    <xsd:element ref="Type"/>
                    <xsd:element ref="DocumentDateTime" minOccurs="0"/>
                    <xsd:element ref="Amount" minOccurs="0"/>
                    <xsd:element ref="ExtendedAmount" minOccurs="0"/>
                    <xsd:element ref="ExtendedLocalAmount" minOccurs="0"/>
                    <xsd:element ref="TotalAmount" minOccurs="0"/>
                    <xsd:element ref="TotalLocalAmount" minOccurs="0"/>
                    <xsd:element ref="Tax" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="InvoiceReference" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="BaseCurrencyAmount" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

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

    <xsd:complexType name="WriteOffType">
        <xsd:sequence>
            <xsd:element name="Amount" type="AmountType"/>
            <xsd:element ref="ReasonCode" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="SalesLocation" type="LocationType"/>
    <xsd:element name="MiscAdjustments" type="MiscAdjustmentsType"/>
    <xsd:element name="ReceivableAmount" type="AmountType"/>
    <xsd:element name="ReceiptAmount" type="AmountType"/>
    <xsd:element name="ReceivedAmount" type="AmountType"/>
    <xsd:element name="PenaltyTakenAmount" type="AmountType"/>
    <xsd:element name="WriteOff" type="WriteOffType" />    
    <xsd:element name="ReceivableStyle" type="CodeType">
        <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, Prepaid, ProgressBilling, CreditMemo, Miscellaneous.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:element name="ReceivableStyleCategory" type="NormalizedStringType">
        <xsd:annotation>
            <xsd:documentation> This field is added so each transaction may be classified by type, 
                and the type is used by Decisions to calculate measures. This flag accomodates 
                Miscellaneous transactions so ERPs can signify if a Misc. transaction is an invoice 
                or an adjustment. Values: I=Invoice,P=Payment,A=Adjustment
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>    
    
    
</xsd:schema>
