<?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="JournalEntry" type="JournalEntryType"/>

        <xsd:element name="JournalEntryHeader" type="JournalEntryHeaderType"/>

        <xsd:element name="JournalEntryLine" type="JournalEntryLineType"/>


        
        <xsd:complexType name="JournalEntryType">
                <xsd:annotation>
                        <xsd:documentation source="http://schema.infor.com/InforOAGIS/2">A journal
                                represents a change in the balances of a business's financial
                                accounts. Many tasks or transactions throughout an enterprise will
                                result in the creation of a journal. Some examples are creating a
                                customer invoice, paying a vendor, transferring inventory, or paying
                                employees. A journal consists of a header with general information,
                                and two or more lines specifying what accounts will be affected. A
                                journal typically includes balanced debit and credit
                        lines.</xsd:documentation>
                </xsd:annotation>
                <xsd:sequence>
                        <xsd:element ref="JournalEntryHeader" minOccurs="0"/>
                        <xsd:element ref="JournalEntryLine" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
        </xsd:complexType>

        <xsd:complexType name="JournalEntryHeaderType">
                <xsd:sequence>
                        <xsd:element ref="JournalID" minOccurs="0"/>
                        <xsd:element ref="BaseJournalEntryHeader" minOccurs="0"/>
                </xsd:sequence>
        </xsd:complexType>
        
        <xsd:complexType name="BaseJournalEntryHeaderType">
                <xsd:annotation>
                        <xsd:documentation source="http://schema.infor.com/InforOAGIS/2">In the
                                Header, DocumentReferences is the link that ties back to a sub
                                ledger transaction entry ID. It is the identifier of an original
                                transaction or document. For example, it could be the receipt or the
                                summarized inventory activity. This is the element that refers to an
                                audit record. Together with the Sender information, the
                                DocumentReferences is part of the referencing system, which will
                                enable drill back audit trail functionality.</xsd:documentation>
                </xsd:annotation>
                <xsd:complexContent>
                        <xsd:extension base="LedgerEntryHeaderType">
                                <xsd:sequence>
                                        <xsd:element ref="UserArea" minOccurs="0"/>
                                        <xsd:element ref="SourceJournalID" minOccurs="0"/>
                                        <xsd:element ref="LedgerType" minOccurs="0"/>
                                        <xsd:element ref="JournalUsage" minOccurs="0"/>
                                        <xsd:element ref="AccountingJournalReference" minOccurs="0"/>
                                        <xsd:element ref="JournalStatus" minOccurs="0"/>
                                        <xsd:element ref="SourceSystemJournalCode" minOccurs="0"/>
                                        <xsd:element ref="TransactionReferenceText" minOccurs="0"
                                                maxOccurs="2"/>
                                        <xsd:element ref="ProtocolNumberText" minOccurs="0"/>
                                        <xsd:element ref="MultiBook" minOccurs="0"/>
                                        <xsd:element ref="EnteredAudit" minOccurs="0"/>
                                        <xsd:element ref="ModifiedAudit" minOccurs="0"/>
                                        <xsd:element ref="PostedAudit" minOccurs="0"/>
                                        <xsd:element ref="ApprovedAudit" minOccurs="0"/>
                                        <xsd:element ref="WarningCode" minOccurs="0"
                                                maxOccurs="unbounded"/>
                                </xsd:sequence>
                        </xsd:extension>
                </xsd:complexContent>
        </xsd:complexType>
        
        <xsd:element name="BaseJournalEntryHeader" type="BaseJournalEntryHeaderType"/>

        <xsd:complexType name="JournalEntryLineType">
                <xsd:complexContent>
                        <xsd:extension base="LedgerEntryLineType">
                                <xsd:sequence>
                                        <xsd:element ref="UserArea" minOccurs="0"/>
                                        <xsd:element ref="SourceLine" minOccurs="0"/>
                                        <xsd:element ref="DebitCreditFlag" minOccurs="0">
                                                <xsd:annotation>
                                                  <xsd:documentation> The amount on a
                                                  transaction should recognize the
                                                  setting of this flag. In other
                                                  words, a depreciation account can be
                                                  defined as having a default type of
                                                  debit or credit. If it is a credit
                                                  then the amount posted to it should
                                                  be positive while it is a debit the
                                                  amount should be negative.
                                                  </xsd:documentation>
                                                </xsd:annotation>
                                        </xsd:element>
                                        <xsd:element ref="SourceAccountingDate" minOccurs="0"/>
                                        <xsd:element ref="SourceDocumentReference" minOccurs="0"/>
                                        <xsd:element ref="RevaluationCode" minOccurs="0"/>
                                        <xsd:element ref="DayBookID" minOccurs="0"/>
                                        <xsd:element ref="DocumentReference" minOccurs="0" maxOccurs="unbounded"/>
                                        <xsd:element ref="TransactionReferenceText" minOccurs="0"
                                                maxOccurs="unbounded"/>
                                        <xsd:element ref="ProtocolNumberText" minOccurs="0"/>
                                        <xsd:element ref="MultibookCore" minOccurs="0"/>
                                        <xsd:element ref="MultiBookLine" minOccurs="0"/>
                                        <xsd:element ref="Description" minOccurs="0"
                                                maxOccurs="unbounded"/>
                                        <xsd:element ref="MemoAmount" minOccurs="0"
                                                maxOccurs="unbounded"/>
                                        <xsd:element ref="WarningCode" minOccurs="0"
                                                maxOccurs="unbounded"/>
                                </xsd:sequence>
                                <xsd:attribute name="sequence" type="PositiveIntegerNumericType"
                                        use="optional"/>
                        </xsd:extension>
                </xsd:complexContent>
        </xsd:complexType>

        <xsd:complexType name="MultibookType">
                <xsd:sequence>
                        <xsd:element ref="FinancialCalendarReference" minOccurs="0"/>
                        <xsd:element ref="AccountingChartReference" minOccurs="0"/>                        
                        <xsd:element ref="AccountingDate" minOccurs="0"/>
                        <xsd:element ref="DocumentDateTime" minOccurs="0"/>
                        <xsd:element ref="DraftCoreJournalID" minOccurs="0"/>
                        <xsd:element ref="Core" minOccurs="0"/>
                        <xsd:element ref="PostedBook" minOccurs="0"/>
                </xsd:sequence>
        </xsd:complexType>

        <xsd:complexType name="CoreType">
                <xsd:sequence>
                        <xsd:element ref="DocumentDateTime" minOccurs="0"/>
                        <xsd:element ref="JournalID" minOccurs="0"/>
                        <xsd:element ref="CorrectedJournalID" minOccurs="0"/>
                </xsd:sequence>
        </xsd:complexType>

        <xsd:element name="Core" type="CoreType"/>

        <xsd:element name="MultiBook" type="MultibookType"/>

        <xsd:complexType name="MultibookCoreType">
                <xsd:sequence>
                        <xsd:element ref="LineNumber" minOccurs="0"/>
                </xsd:sequence>
        </xsd:complexType>

        <xsd:element name="MultibookCore" type="MultibookCoreType"/>

        <xsd:complexType name="MultiBookLineType">
                <xsd:sequence>
                        <xsd:element ref="LineNumber" minOccurs="0"/>
                        <xsd:element ref="CorrectedJournalLineNumber" minOccurs="0"/>
                </xsd:sequence>
        </xsd:complexType>

        <xsd:element name="MultiBookLine" type="MultiBookLineType"/>

        <xsd:element name="CorrectedJournalID" type="IdentifierType"/>
        <xsd:element name="DraftCoreJournalID"  type="IdentifierType"/>
        <xsd:element name="JournalID" type="IdentifierType"/>
        <xsd:element name="SourceJournalID" type="IdentifierType">
                <xsd:annotation>
                        <xsd:documentation>The ledger ID from the source system,
                        </xsd:documentation>
                </xsd:annotation>
        </xsd:element>

        <xsd:element name="MixedDateIndicator" type="IndicatorType">
                <xsd:annotation>
                        <xsd:documentation> Indicates that there is more than one AccountingDate at
                                the line level </xsd:documentation>
                </xsd:annotation>
        </xsd:element>

        <xsd:element name="SourceSystemJournalCode" type="CodeType">
                <xsd:annotation>
                        <xsd:documentation> The financial controller will do different validation
                                depending on the value which comes in on the source system journal
                                code.  Example of a few are source ledger system, CDX, Journal Entry, 
                                Correction from MBL
                        </xsd:documentation>
                </xsd:annotation>
        </xsd:element>

        <xsd:element name="SourceAccountingDate" type="AccountingDateType"/>

        <xsd:element name="EnteredAudit" type="AuditType"/>
        <xsd:element name="ModifiedAudit" type="AuditType"/>
        <xsd:element name="PostedAudit" type="AuditType"/>
        <xsd:element name="ApprovedAudit" type="AuditType"/>

        <xsd:element name="LedgerType" type="CodeType">
                <xsd:annotation>
                        <xsd:documentation> For future use, hard coded to "Actual" on all MBL and
                                Financial Controller Journals. </xsd:documentation>
                </xsd:annotation>
        </xsd:element>
        <xsd:element name="PrivateDimensions" type="CodesType"/>
        
        <xsd:complexType name="WarningCodeType">
                <xsd:sequence>
                        <xsd:element ref="Code"/>
                        <xsd:element ref="Property" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
        </xsd:complexType>
        
        <xsd:element name="WarningCode" type="WarningCodeType"/>


        <xsd:element name="DayBookID" type="IdentifierType"/>

        <xsd:element name="ProtocolNumberText" type="NormalizedStringType">
                <xsd:annotation>
                        <xsd:documentation> Used where source systems have unique sequential
                                numbering per document type such as sales invoice or purchases.
                        </xsd:documentation>
                </xsd:annotation>
        </xsd:element>
        <xsd:element name="TransactionReferenceText" type="NormalizedStringType"/>

        <xsd:element name="CorrectedJournalLineNumber" type="IdentifierType"/>
        <xsd:element name="SourceLine" type="NormalizedStringType"/>


        <xsd:complexType name="PostedBookType">
                <xsd:sequence>
                        <xsd:element ref="JournalID" minOccurs="0"/>
                        <xsd:element ref="CorrectedJournalID" minOccurs="0"/>
                </xsd:sequence>
        </xsd:complexType>

        <xsd:element name="PostedBook" type="PostedBookType"/>

</xsd:schema>
