<?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.
 
        *****     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/Financial/Components.xsd"/>

    <xsd:element name="LedgerSetup" type="LedgerSetupType">
        <xsd:annotation>
            <xsd:documentation> LedgerSetup used for associating a chart of accounts, a currency,
                and a calendar.</xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="LedgerSetupType">
        <xsd:sequence>
            <xsd:element ref="Ledger" minOccurs="0"/>
            <xsd:element ref="BookInstance" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="LedgerType">
        <xsd:complexContent>
            <xsd:extension base="StatusEnabledStandardHeaderType">
                <xsd:sequence>
                    <xsd:element ref="Name" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="ShortName" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="DimensionSequence" minOccurs="0"/>
                    <xsd:element ref="CurrencyCode" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="NegativeAmountsSupportedIndicator" minOccurs="0"/>
                    <xsd:element ref="SplitDateProcessingCode" minOccurs="0"/>
                    <xsd:element ref="UserArea" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="Ledger" type="LedgerType"/>

    <xsd:complexType name="BookInstanceType">
        <xsd:sequence>
            <xsd:element ref="ID" minOccurs="0"/>
            <xsd:element ref="Status" minOccurs="0"/>
            <xsd:element ref="Name" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="ShortName" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="Description" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="BookType" minOccurs="0"/>
            <xsd:element ref="AccountingBookDefinitionReference" minOccurs="0"/>
            <xsd:element ref="AccountingChartReference" minOccurs="0"/>
            <xsd:element ref="FinancialCalendarReference" minOccurs="0"/>
            <xsd:element ref="CurrencyID" minOccurs="0"/>
            <xsd:element ref="DimensionProfileSetID" minOccurs="0"/>
            <xsd:element ref="YearEnd" minOccurs="0"/>
            <xsd:element ref="OpenPeriods" minOccurs="0"/>
            <xsd:element ref="ClosedPeriods" minOccurs="0"/>
            <xsd:element ref="YearStatus" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="AccountingJournalUsages" minOccurs="0"/>
            <xsd:element ref="RoundingRule" minOccurs="0"/>
            <xsd:element ref="ExchangeRule" minOccurs="0"/>
            <xsd:element ref="ConversionChain" minOccurs="0"/>
            <xsd:element ref="SuspenseAccount" minOccurs="0"/>
            <xsd:element ref="DailyBalanceIndicator" minOccurs="0"/>
            <xsd:element ref="RootBookIndicator" minOccurs="0"/>
            <xsd:element ref="AGLOwnedIndicator" minOccurs="0"/>
            <xsd:element ref="RevaluationCode" minOccurs="0"/>
            <xsd:element ref="InProcessBook" minOccurs="0"/>
            <xsd:element ref="UserArea" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="FinancialPeriodsType">
        <xsd:sequence>
            <xsd:element ref="FinancialPeriod" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="VarianceRuleType">
        <xsd:sequence>
            <xsd:element ref="ThresholdAmount" minOccurs="0"/>
            <xsd:element ref="JournalLineDescription" minOccurs="0"/>
            <xsd:element ref="DebitAccount" minOccurs="0"/>
            <xsd:element ref="CreditAccount" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="ConversionChainType">
        <xsd:sequence>
            <xsd:element ref="ParentBook" minOccurs="0"/>
            <xsd:element ref="JournalInputCode" minOccurs="0"/>
            <xsd:element ref="CurrencyRateTypeReference" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="ConversionChain" type="ConversionChainType"/>

    <xsd:element name="RoundingRule" type="VarianceRuleType"/>
    <xsd:element name="ExchangeRule" type="VarianceRuleType"/>

    <xsd:complexType name="AccountingJournalUsageType">
        <xsd:sequence>
            <xsd:element ref="AccountingJournalReference" minOccurs="0"/>
            <xsd:element ref="DirectIndicator" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="AccountingJournalUsage" type="AccountingJournalUsageType"/>

    <xsd:complexType name="AccountingJournalUsagesType">
        <xsd:sequence>
            <xsd:element ref="AccountingJournalUsage" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="AccountingJournalUsages" type="AccountingJournalUsagesType"/>

    <xsd:complexType name="YearStatusType">
        <xsd:sequence>
            <xsd:element ref="Year"/>
            <xsd:element ref="YearStatusCode" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>Standard values will be: Open, Closed, Not Yet Open,
                        Definitively Closed. Default value is Open if not populated
                    specified.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="YearStatus" type="YearStatusType"/>
    
    <xsd:complexType name="YearEndType">
        <xsd:sequence>
            <xsd:element ref="AccountingJournalReference" minOccurs="0"/>
            <xsd:element ref="CurrentYearEarningsAccount" minOccurs="0"/>
            <xsd:element ref="RetainedEarningsAccount" minOccurs="0"/>
            <xsd:element ref="PAndLOffsetAccount" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="YearEnd" type="YearEndType"/>
    
    <xsd:complexType name="InProcessBookType">
        <xsd:sequence>
            <xsd:element ref="Year" minOccurs="0"/>
            <xsd:element ref="PeriodID" minOccurs="0"/>
            <xsd:element ref="EffectiveDateTime" minOccurs="0"/>
            <xsd:element ref="ProcessingSuspendedIndicator" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="InProcessBook" type="InProcessBookType"/>

    <xsd:element name="ThresholdAmount" type="AmountType"/>
    <xsd:element name="JournalLineDescription" type="DescriptionType"/>
    <xsd:element name="DebitAccount" type="GLAccountType"/>
    <xsd:element name="CreditAccount" type="GLAccountType"/>
    <xsd:element name="CurrentYearEarningsAccount" type="GLAccountType"/>
    <xsd:element name="RetainedEarningsAccount" type="GLAccountType"/>
    <xsd:element name="PAndLOffsetAccount" type="GLAccountType"/>
    
    <xsd:element name="BookInstance" type="BookInstanceType"/>

    <xsd:element name="BookType" type="CodeType"/>
    <xsd:element name="JournalInputCode" type="CodeType"/>
    <xsd:element name="SplitDateProcessingCode" type="CodeType"/>
    <xsd:element name="YearStatusCode" type="CodeType"/>

    <xsd:element name="CurrencyID" type="CurrencyCodeAttributeType"/>

    <xsd:element name="OpenPeriods" type="FinancialPeriodsType"/>
    <xsd:element name="ClosedPeriods" type="FinancialPeriodsType"/>

    <xsd:element name="SuspenseAccount" type="GLAccountType"/>

    <xsd:element name="DimensionProfileSetID" type="IdentifierType"/>
    <xsd:element name="ParentBook" type="IdentifierType"/>
    <xsd:element name="ProcessingSuspendedIndicator" type="IdentifierType"/>
    
    <xsd:element name="DailyBalanceIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation>When true this indicates that the book produces daily balances.
                
                The default is False</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="DirectIndicator" type="IndicatorType"/>
    <xsd:element name="NegativeAmountsSupportedIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation>Some accounting entities will be set up to accept negative debits and
                credits and some will not. This flag allows the financial controller to ascertain if
                a journal for a particular entity is acceptable or should be rejected if it contains
                these negative debits and credits. 
                
                The default is False</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="RootBookIndicator" type="IndicatorType"/>
    <xsd:element name="AGLOwnedIndicator" type="IndicatorType"/>
</xsd:schema>
