<!--
		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="InvoiceType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>High</privacyRating>
      </xs:appinfo>
      <xs:documentation>
        This object contains an amount to be invoiced to an outside entity (typically a creditor or debtor). This object can include school fees. The object is also used for payments to an outside entity (using debit amounts), where those payments are not for goods and services (PurchaseOrder object): e.g. credit notes, reimbursements, rebates.     </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="InvoicedEntity" minOccurs="0">
        <xs:complexType>
          <xs:annotation>
            <xs:appinfo>
              <sifChar>M</sifChar>
              <privacyRating>High</privacyRating>
            </xs:appinfo>
            <xs:documentation>Id of the entity being billed for this billing activity.</xs:documentation>
          </xs:annotation>
          <xs:simpleContent>
            <xs:extension base="IdRefTypeOrEmpty">
              <xs:attribute name="SIF_RefObject" use="required">
                <xs:annotation>
                  <xs:appinfo>
                    <sifChar>M</sifChar>
                    <privacyRating>High</privacyRating>
                  </xs:appinfo>
                  <xs:documentation>RefId of SIF object referenced by Invoiced Entity.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:token">
                    <xs:enumeration value="Debtor" />
                    <xs:enumeration value="PurchaseOrder" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:attribute>
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
      <xs:element name="FormNumber" minOccurs="0" nillable="true" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Invoice number assigned locally by the system issuing the invoice.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="BillingDate" minOccurs="0" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Date of the transaction.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TransactionDescription" minOccurs="0" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Description of the transaction.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="BilledAmount" minOccurs="0" type="DebitOrCreditAmountType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Gross amount to be billed, including any tax. Can be credit (e.g. for family credit notes, reimbursements, rebates).</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Ledger" minOccurs="0">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The associated ledger for this transaction</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="Creditor" />
            <xs:enumeration value="Family" />
            <xs:enumeration value="Sundry" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="ChargedLocationInfoRefId" minOccurs="0" nillable="true" type="IdRefType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Id of the location billed for this billing activity.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="NetAmount" minOccurs="0" nillable="true" type="MonetaryAmountType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Net amount billed, excluding any tax. Should be BilledAmount minus TaxAmount.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TaxRate" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Rate of tax included in the billed amount.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TaxType" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Tax type (e.g. G11 vs NP6)</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TaxAmount" minOccurs="0" nillable="true" type="MonetaryAmountType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Amount of tax included in the billed amount</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 invoice</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 invoice</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ItemDetail" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Details of items invoiced (free text)</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="DueDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Due date for payment.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="FinancialAccountRefIdList" minOccurs="0" nillable="true" type="FinancialAccountRefIdListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>List of RefIds of the Associated Financial Accounts.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AccountingPeriod" minOccurs="0" nillable="true" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The accounting period against which the transaction is billed.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RelatedPurchaseOrderRefId" minOccurs="0" nillable="true" type="IdRefType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>An invoice purchase order related to this invoice (e.g. an invoice raised for the delivery of goods on a purchase order).</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PurchasingItems" minOccurs="0" nillable="true" type="PurchasingItemsType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Listing of line items from original purchase order. Included to indicate any variation between the items, item cost, or item quantity ordered, and what has been delivered.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Voluntary" minOccurs="0" nillable="true" type="AUCodeSetsYesOrNoCategoryType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>
        Whether the billing is voluntary (applies to some school fees).
      </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>Low</privacyRating>
        </xs:appinfo>
        <xs:documentation>GUID for this transaction. The application that owns this object is responsible for generating this unique Id.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="Invoice" type="InvoiceType">
    <xs:unique name="InvoiceKey1">
      <xs:selector xpath="./Invoice" />
      <xs:field xpath="@RefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="InvoiceCollectionType">
    <xs:sequence>
      <xs:element name="Invoice" type="InvoiceType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Invoices" type="InvoiceCollectionType" />

</xs:schema>