<!--
		SIF Implementation Specification (Australia) 3.4.3


		(April 5, 2018)
		
		Infrastructure Version: v3
	-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sifassociation.org/datamodel/au/3.4" targetNamespace="http://www.sifassociation.org/datamodel/au/3.4" elementFormDefault="qualified" version="3.4.3">
  <xs:complexType name="JournalType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>High</privacyRating>
      </xs:appinfo>
      <xs:documentation>This object is used to adjust balances between accounts. It is typically used to correct chart of account coding errors (e.g. created invoices for parents against the maths chart of account code when it should have been English).</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="DebitFinancialAccountRefId" type="IdRefType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>RefId of account to debit.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="CreditFinancialAccountRefId" type="IdRefType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>RefId of account to credit.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="OriginatingTransactionRefId" minOccurs="0" nillable="true">
        <xs:complexType>
          <xs:annotation>
            <xs:appinfo>
              <sifChar>O</sifChar>
              <privacyRating>High</privacyRating>
            </xs:appinfo>
            <xs:documentation>RefId of the originating transaction which requires adjustment. This could be an Invoice, PaymentReceipt or PurchaseOrder.</xs:documentation>
          </xs:annotation>
          <xs:simpleContent>
            <xs:extension base="IdRefType">
              <xs:attribute name="SIF_RefObject" use="required">
                <xs:annotation>
                  <xs:appinfo>
                    <sifChar>M</sifChar>
                    <privacyRating>High</privacyRating>
                  </xs:appinfo>
                  <xs:documentation />
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:token">
                    <xs:enumeration value="Invoice" />
                    <xs:enumeration value="PaymentReceipt" />
                    <xs:enumeration value="PurchaseOrder" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:attribute>
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
      <xs:element name="Amount" type="MonetaryAmountType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Amount to transfer between the two accounts.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="GSTCodeOriginal" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Original GST code for journal transfer (if required).</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="GSTCodeReplacement" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Replacement GST code for journal transfer (if required).</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Note" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Note about the journal.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="CreatedDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Date on which journal was created.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ApprovedDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Date on which journal was approved.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="CreatedBy" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Authority or person who created the journal.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ApprovedBy" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Authority or person who approved the journal.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SIF_Metadata" minOccurs="0" nillable="true" type="SIF_MetadataType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
      <xs:element name="SIF_ExtendedElements" minOccurs="0" nillable="true" type="SIF_ExtendedElementsType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="RefId" use="required" type="RefIdType">
      <xs:annotation>
        <xs:appinfo>
          <sifChar>M</sifChar>
          <privacyRating>High</privacyRating>
        </xs:appinfo>
        <xs:documentation>Journal Id.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="Journal" type="JournalType">
    <xs:key name="JournalKey1">
      <xs:selector xpath="./Journal" />
      <xs:field xpath="@RefId" />
    </xs:key>
  </xs:element>

  <xs:complexType name="JournalCollectionType">
    <xs:sequence>
      <xs:element name="Journal" type="JournalType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Journals" type="JournalCollectionType" />

</xs:schema>