<?xml version="1.0" encoding="UTF-8"?>


<!--
© 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
1 Oct 2013    LA      New noun for Bank Statement - based on ISO200222 camt.053.001.004
22 Jun 2015   LA      Added StatementType, BOD-2960

*****     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="BankStatement" type="BankStatementType">
        <xsd:annotation>
            <xsd:documentation> Bank statement noun is used to report balance and transaction details for an account in 
             a bank or a financial institution. The statement could be requested by the account holder or it could be a 
            periodical statement sent by the bank depending on prior agreement with the account holder. The statement could contain
            multiple accounts for different or same set of from-to date ranges. 
            
            The basic structure of the noun is as follows
            
            BankStatement
                --BankStatementHeader
                --BankStatementAccount (repeatable)
                        --AccountEntry (repeatable)
                                --EntryTransaction (repeatable)
                                
             When mapped with a camt.053.001 message, 
                         BankStatementAccount contains the elements from Statement, 
                         AccountEntry contains elements from Entry
                         EntryTransaction contains elements from EntryDetails/TransactionDetails
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="BankStatementHeader" type="BankStatementHeaderType"/>
    <xsd:element name="BankStatementAccount" type="BankStatementAccountType"/>

    <xsd:complexType name="BankStatementType">
        <xsd:sequence>
            <xsd:element ref="BankStatementHeader" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates the header information for the bank statement. Generally this would contain all the message level
                        details for the statement from the bank. There are no status changes for the statement after it would be received by
                        local.ly; only the generic status codes are applicable. 
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="BankStatementAccount" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates the account for which the statement contains the details for a specific period. 
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="BankStatementHeaderType">
        <xsd:complexContent>
            <xsd:extension base="StatusEnabledHeaderType">
                <xsd:sequence>
                    <xsd:element ref="StatementType" minOccurs="0"/>
                    <xsd:element ref="FinancialParty" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                Indicates the bank from which the statement is received. 
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="RecepientParty" minOccurs="0">
                        <xsd:annotation>
                            <xsd:documentation>
                                Indicates the legal entity that receives the statement. 
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element ref="UserArea" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="BankStatementAccountType">
        <xsd:sequence>
            <xsd:element ref="LineNumber" minOccurs="0"/>
            <!--   <xsd:group ref="IDsGroup" minOccurs="0"/> 
            Do we really need the group? looks like only an ID with schemeName and schemeAgencyName would be sufficient-->
            <xsd:element ref="ExternalSequence" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>Indicates the electronic and legal sequence of the bank statement</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="StatementPeriod" minOccurs="0"/>
            <xsd:element ref="CopyIndicator" minOccurs="0"/>
            <xsd:element ref="DuplicateIndicator" minOccurs="0"/>
            <xsd:element ref="BankAccount" minOccurs="0"/>
            <xsd:element ref="AccountOwnerParty" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                                            Account owner would generally be the legal entity that would handle the statement.
                                           In most cases, account owner would be same as the RecipientParty at the header. But in a few
                                           cases where the RecipientParty handles statements of its subsidiary companies, account owner 
                                           might indicate another accounting entity that is related to the RecipientParty. In order to 
                                           identify the accounting entity, use the BICID with the appropriate schemeName attribute.
                                        </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="TransactionSummary" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                           Indicates the total amount details for the account statement.
                       </xsd:documentation>
                </xsd:annotation>
            </xsd:element>

            <xsd:element ref="AccountEntry" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation>
                                            Indicates the individual entry amounts that add up to the account balance for a 
                                            given statement period
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="UserArea" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>


    <xsd:complexType name="StatementSequenceType">
        <xsd:sequence>
            <xsd:element ref="ElectronicSequence" minOccurs="0"/>
            <xsd:element ref="LegalSequence" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="TransactionSummaryType">
        <xsd:sequence>
            <xsd:element ref="CreditSummary" minOccurs="0"/>
            <xsd:element ref="DebitSummary" minOccurs="0"/>
            <xsd:element ref="TotalSummary" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="AccountEntryType">
        <xsd:sequence>
            <xsd:element ref="LineNumber" minOccurs="0"/>
            <xsd:element ref="EntryNote" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Unique external reference for the entry.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="AccountServicerNote" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Unique reference/note as assigned by the account servicing institution to unambiguously identify
                        the entry.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="EntryAmount" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates the entry amount. Note that the amount could be positive or negative depending on
                        the nature of the transaction. 
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="DebitCreditFlag" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates whether the entry amount is a debit amount or a credit amount.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="BankTransactionCode" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates the various bank transaction codes that could be there for the account entry. 
                        It could contain any bank transaction code; for the ISO camt.053 message, the following codes are applicable -
                            - ISO Domain code
                            - ISO Family Code
                            - ISO SubFamily Code
                            - Proprietary Code
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="ReversalIndicator" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates whether the entry is a reversal for an earlier entry. Note that this indicator is used 
                        only when the entry is reversed by the bank because of some internal mistake. This would not be used
                        to indicate the transaction reversal done due to reasons such as insufficient funds for check transfer,
                        incorrect account number specification for an interbank transfer etc.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="Status" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates the status of the entry in the bank. Check the code list for appropriate codes 
                        that could be there for Account Entry Status
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="BookingDateTime" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Date and time when an entry is posted to an account on the account servicer's books.
                        Booking date is the expected booking date, unless the status is booked, in which case it is the
                        actual booking date.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="ValueDateTime" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Date and time at which assets become available to the account owner in case of a credit
                        entry, or cease to be available to the account owner in case of a debit entry.
                        If entry status is pendng and value date is present, then the value date refers to an expected/
                        requested value date.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="InvolvedAmounts" minOccurs="0"/>

            <xsd:element ref="Charges" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        When present at the Entry level, these are applicable only for a batch booked amount. 
                        When batch booked Entry has underlying transactions and charges are applicable, 
                        Entry level InvolvedAmounts is used for totalling the underlying transaction amounts and 
                        charges details added with batch specific items.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>

            <xsd:element ref="EntryDetail" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation> Indicates the details pertaining to the account entry.
                        It is possible that only the batch details are given, and the corresponding transaction details are not given.
                        It is also possible that only transaction details are specified without the batch details. Or, both batch and transaction
                        details could also be specified.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="UserArea" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="ChargesType">
        <xsd:annotation>
            <xsd:documentation>
                Charges applied to Entry level amount only for a batch booked amount. 
                When batch booked Entry has underlying transactions and charges are applicable, 
                Entry level AmountDetails is used for totalling the underlying transaction amounts 
                and charges details added with batch specific items.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element ref="TotalAmount" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates the total charge amount
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="ChargeDetail" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="ChargeDetailType">
        <xsd:sequence>
            <xsd:element ref="ChargeType" minOccurs="0">
                <!-- Do we need a code list for this ? -->
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates the type of charge (either an ISO code or a proprietary code)
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="Bearer" minOccurs="0">
                <!-- Do we need a code list for this ? -->
                <xsd:annotation>
                    <xsd:documentation>
                        Specifies which party/parties will bear the charges associated with the processing of the payment
                        transaction. Following are possible - 
                        -- DEBT - BorneByDebtor -  All transaction charges are to be borne by the debtor.
                        -- CRED - BorneByCreditor - All transaction charges are to be borne by the creditor.
                        -- SHAR - Shared - In a credit transfer context, means that transaction charges on the sender side are to be borne by the debtor, transaction
                                            charges on the receiver side are to be borne by the creditor. In a direct debit context, means that transaction charges
                                            on the sender side are to be borne by the creditor, transaction charges on the receiver side are to be borne by the debtor.
                        -- SLEV -- FollowingServiceLevel - Charges are to be applied following the rules agreed in the service level and/or scheme.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="ChargeAmount" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Transaction charges to be paid by the charge bearer.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="DebitCreditFlag" minOccurs="0"/>
            <xsd:element ref="DistributedTax" minOccurs="0"/>
            <xsd:element ref="ChargeIncludedIndicator" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates whether the charge should be included in the amount or is added as pre-advice.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="ChargeRate" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Rate used to calculate the amount of the charge or fee.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="InvolvedAmountsType">
        <xsd:annotation>
            <xsd:documentation>
                All Amount Details are in all cases given on the Transaction Details level on single and batch bookings. 
                For consistency purposes AccountEntry/Amount information is repeated at EntryTransaction/AmountDetails/TransactionAmount.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element ref="InstructedSection" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Contains the details of the amount of money to be moved between the debtor and creditor, before deduction
                        of charges, expressed in the currency as ordered by the initiating party
                        Used for original amount as instructed in original currency and is the gross value (i.e. prior to application of charges) in same currency situations.  
                        Instructed Amount may be omitted in the case when there are no charges or no FX.  
                        In FX cases the booked transaction FX information can be found with TransactionAmount.  
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="TransactionSection" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        The amount in this section is to be used for matching and aggregation purpose and it is used in all cases when InvolvedAmounts structure is used.  
                        It is always in the currency of the account reported and the Entry Amount and populated in all Transaction Details–cases 
                        when InvolvedAmounts structure is used.  It is the net amount of the underlying transaction including charges expressed in 
                        the currency of the posting account.  This will apply both Single Bookings and Batch Bookings with underlying transactions.  
                        This amount indicates the value that has been debited from or credited to reported bank account (booked or posted amount). 
                        Note: this information may be duplicate with Entry/Amount if the single booking is in the same currency as reported account currency is.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="CounterValueSection" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Counter Value is used for currency conversion reporting.  It is used and available only when account currency is different from 
                        the instructed amount's currency.  In Debit entries the CounterValueAmount reports the result amount converted from the InstructedAmount 
                        with FX information at TransactionAmount.  In Credit entries the CounterValueAmount reports the result amount converted from the 
                        Inter-bank Settlement Amount with FX information at TransactionAmount.  
                        CounterValueAmount need not have the currency exchange rate information - when it is not available, the currency exchange rate details from 
                        Transaction Section must be used.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="ProprietarySection" minOccurs="0" maxOccurs="unbounded">
                <!-- might not be needed in the noun, can be enabled only when some application really needs it -->
                <xsd:annotation>
                    <xsd:documentation>
                        This value can be used by the bank for additional amount reporting on community or bank-specific purposes.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="AmountSectionType">
        <xsd:sequence>
            <xsd:element ref="Amount" minOccurs="0"/>
            <xsd:element ref="CurrencyExchangeRate" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="ProprietaryAmountSectionType">
        <xsd:complexContent>
            <xsd:extension base="AmountSectionType">
                <xsd:sequence>
                    <xsd:element ref="ProprietaryType" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="EntryDetailType">
        <xsd:sequence>
            <xsd:element ref="EntryBatch" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates a summary of the transactions that are detailed with EntryTransaction, but it doesn’t have to. 
                        It could be possible that some transactions are not detailed – they only have a batch section with payment reference information and 
                        the number of transactions/invoices/payments included in the reference. 
                        A reoccurring  example when the batch section appears without details is when the company is doing for example salary payments – 
                        total amount, the number of salaries paid and a reference back to the payment instruction to the bank (for reconciliation) is included. 
                        Each salary is not specified since the company already have this information. Another example is payment of employee travel expenses.
                        
                        It is also possible for outgoing transactions (company making payments) to only look at the batch section (if it exists) for reconciliation. 
                        To reconcile transaction that is incoming to the bank account from customers the specific details are usually analyzed. 
                        
                        If an application has the possibility to reconcile on totals it will be easier to go for the batch section if it exists than going through all the detailed transactions. 
                        The decision on which to look at (details or batch) can  be made by looking on the Bank Transaction Code (BankStatement/BankStatementAccount/AccountEntry/BankTransactionCode). 
                        One of the three levels will give information on what the entry is.
                        
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="EntryTransaction" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation>
                        Provides the details of the underlying transactions
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="EntryBatchType">
        <xsd:sequence>
            <xsd:element ref="MessageID" minOccurs="0"/>
            <xsd:element ref="PaymentInformationID" minOccurs="0"/>
            <xsd:element ref="NumberOfTransactions" minOccurs="0"/>
            <xsd:element ref="TotalAmount" minOccurs="0"/>
            <xsd:element ref="DebitCreditFlag" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="EntryTransactionType">
        <xsd:sequence>
            <xsd:element ref="LineNumber" minOccurs="0"/>
            <xsd:element ref="ExternalReferences" minOccurs="0"/>
            <xsd:element ref="Amount" minOccurs="0"/>
            <xsd:element ref="DebitCreditFlag" minOccurs="0"/>
            <xsd:element ref="InvolvedAmounts" minOccurs="0"/>
            <xsd:element ref="BankTransactionCode" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="PaymentPurposeCode" minOccurs="0"/>
            <xsd:element ref="ReturnInformation" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        This element and ReversalIndicator must not be combined. Examples where return information would be used are  
                        •	Reversal of Cheques (checks that bounces without funds) – the banks call it “cheques debited on account, but debit cancelled afterwards for lack of cover” 
                        o	The same thing can happen with a direct debiting request as well. “cancellation of an undue debit of the debtor at the initiative of the financial institution or the debtor for lack of cover ”
                        •	Supplier payments where the receiving bank account did not exist – happens sometimes when doing payments to a different country where the bank account structure is different. The bank might not validate the bank account when receiving the payment order, it is done after the money have been deducted from the account (day 1). Then day 2 the bank tries to transfer  the money and send a transfer message to the bank in the other country, the message is received. And maybe day 2 or even day 3 the receiving bank responds that the account does not exist. And day 4 the bank restores the amount to the account with reversal information that account did not exist. And during these four days, four different inter-day statements could have been created
                        
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="Charges" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Provides information on the charges, pre-advised or included in the entry amount.
                        This component (on transaction level) can be used in case the booking is for a single transaction,
                        and charges are included in the entry amount. It can also be used in case individual charge
                        amounts are applied to individual transactions in case of a batch or aggregate amount booking.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="RemittanceInformation" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Structured information that enables reconciliation, of a payment with the items that the payment is intended to settle, 
                        such as commercial invoices in an account receivable system. This entire element would be same as what would be sent 
                        for example with a CreditTransfer BOD in case of a supplier payment
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="RelatedParties" minOccurs="0"/>
            <xsd:element ref="RelatedDates" minOccurs="0"/>
            <xsd:element ref="UserArea" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="ExternalReferencesType">
        <xsd:sequence>
            <xsd:element ref="MessageID" minOccurs="0"/>
            <xsd:element ref="PaymentInformationID" minOccurs="0"/>
            <xsd:element ref="InstructionID" minOccurs="0"/>
            <xsd:element ref="TransactionID" minOccurs="0"/>
            <xsd:element ref="MandateID" minOccurs="0"/>
            <xsd:element ref="ChequeNumber" minOccurs="0"/>
            <xsd:element ref="Reference" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType> 

    <xsd:complexType name="RelatedPartiesType">
        <xsd:sequence>
            <xsd:element ref="OriginatorParty" minOccurs="0"/>
            <xsd:element ref="DebtorParty" minOccurs="0"/>
            <xsd:element ref="FirstAgentFinancialParty" minOccurs="0"/>
            <xsd:element ref="CreditorParty" minOccurs="0"/>
            <xsd:element ref="FinalParty" minOccurs="0"/>
            <xsd:element ref="FinalAgentFinancialParty" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="RelatedDatesType">
        <xsd:sequence>
            <xsd:element ref="AcceptanceDateTime" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Point in time when the payment order from the initiating party meets the processing conditions
                        of the account servicing agent. This means that the account servicing agent has received the payment
                        order and has applied checks such as authorisation, availability of funds.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="InterBankSettlementDateTime" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Date on which the amount of money ceases to be available to the agent that owes it and
                        when the amount of money becomes available to the agent to which it is due.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="StartDateTime" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates the starting date of the underlying transaction, for example a cheque issuance date
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element ref="EndDateTime" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Indicates the end date of the underlying transaction, for example cheque expiry date
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="ReturnInformationType">
        <xsd:sequence>
            <xsd:element ref="OriginalBankTransactionCode" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="OriginatorParty" minOccurs="0"/>
            <xsd:element ref="ReturnReasonCode" minOccurs="0"/>
            <xsd:element ref="ReturnReason" minOccurs="0"/>
            <xsd:element ref="UserArea" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    
   
    <!-- Statement account declarations -->
    

    <xsd:element name="AccountEntry" type="AccountEntryType">
        <xsd:annotation>
            <xsd:documentation>
                Indicates the individual entry amounts that add up to the account balance for a 
                given statement period
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
     <xsd:element name="BankTransactionCode" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>Indicates the external code that lists bank transaction code</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:element name="CopyIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation>Indicates whether the bank statement is a copy. When true, this indicates that the bank statement is received by another 
            recepient and not the account owner</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:element name="DuplicateIndicator" type="IndicatorType">
        <xsd:annotation>
            <xsd:documentation>Indicates whether the statement is a duplicate version (one that has been already sent) or a original</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="ElectronicSequence" type="PositiveIntegerNumericType">
        <xsd:annotation>
            <xsd:documentation>Indicates the sequential number that is increased incrementally for each statement sent electronically</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="LegalSequence" type="PositiveIntegerNumericType">
        <xsd:annotation>
            <xsd:documentation>Legal sequential number of the statement, as assigned by the bank. It is increased
                incrementally for each statement sent.Where a paper statement is a legal requirement, it may have a number different from the electronic
                sequential number. Paper statements could for instance only be sent if movement on the account
                has taken place, whereas electronic statements could be sent at the end of each reporting period, regardless
                of whether movements have taken place or not</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <xsd:element name="ExternalSequence" type="StatementSequenceType">
        <xsd:annotation>
            <xsd:documentation>Indicates the legal and electronic sequence numbers for the bank statement</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="StatementPeriod" type="TimePeriodType">
        <xsd:annotation>
            <xsd:documentation>Indicates the period for which the bank statement is published</xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="TransactionSummary" type="TransactionSummaryType">
        <xsd:annotation>
            <xsd:documentation>Indicates the summary information of the bank statement entries. </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
    <!-- Account Entry declarations -->

    <xsd:element name="EntryNote" type="NoteType"/>
    <xsd:element name="AccountServicerNote" type="NoteType"/>
    <xsd:element name="EntryAmount" type="AmountType">
        <xsd:annotation>
            <xsd:documentation>Indicates the amount for the statement entry</xsd:documentation>
        </xsd:annotation>
    </xsd:element>

   <xsd:element name="Charges" type="ChargesType"/>
    <xsd:element name="ChargeDetail" type="ChargeDetailType"/>
    <xsd:element name="ChargeType" type="CodeType"/>
    <xsd:element name="Bearer" type="CodeType"/>
    <xsd:element name="ChargeAmount" type="AmountType"/>
    <xsd:element name="ChargeIncludedIndicator" type="IndicatorType"/>
   <xsd:element name="ChargeRate" type="PercentType"/>
    <xsd:element name="InvolvedAmounts" type="InvolvedAmountsType">
        <xsd:annotation>
            <xsd:documentation>
                All Amount Details are in most cases given on the Transaction Details level (not on Entry level) on single and batch bookings.  
                When batch booked Entry has underlying transactions with charges, Entry level AmountDetails is used for 
                totalling the underlying transaction amounts and charges details added with batch specific items.
                
                If both Entry level and TransactionDetails level amount details are available, 
                TransactionDetails AmountDetails takes precedence over the higher level
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="EntryDetail" type="EntryDetailType"/>
    <xsd:element name="EntryBatch" type="EntryBatchType"/>
    <xsd:element name="EntryTransaction" type="EntryTransactionType"/>
    
    <xsd:element name="ExternalReferences" type="ExternalReferencesType"/>
    <xsd:element name="InstructedSection" type="AmountSectionType"/>
    <xsd:element name="TransactionSection" type="AmountSectionType"/>
    <xsd:element name="CounterValueSection" type="AmountSectionType"/>
    <xsd:element name="ProprietarySection" type="ProprietaryAmountSectionType"/>
    <xsd:element name="ProprietaryType" type="CodeType"/>
    <xsd:element name="RelatedParties" type="RelatedPartiesType"/>
    <xsd:element name="RelatedDates" type="RelatedDatesType"/>
    <xsd:element name="FirstAgentFinancialParty" type="FinancialPartyType"/>
    
    <xsd:element name="ReturnInformation" type="ReturnInformationType"/>
    <xsd:element name="OriginalBankTransactionCode" type="CodeType"/>
    
    <xsd:element name="StatementType" type="CodeType">
        <xsd:annotation>
            <xsd:documentation>
                Indicates the type of bank statement - a statement that provides balances as on a date, 
                a debit statement, a credit statement etc
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
    
</xsd:schema>
