<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:include schemaLocation="simpleTypes.xsd"/>
    <xs:include schemaLocation="elements.xsd"/>
     <xs:include schemaLocation="warehouseStockLog.xsd" />
    <!--  Рекапитулативна декларация за ААП -->
   <xs:element name="Declaration">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="KindOfDeclaration" type="KindOfDeclarationType" />
				<xs:element name="TypeOfDeclaration" type="TypeOfDeclarationType" />
				<xs:element name="IsCorrectionDeclaration" type="IsCorrectionDeclarationType" />
				<xs:element name="RefNumberOfCorrectedDeclaration" type="RefNumberOfCorrectedDeclarationType" minOccurs="0" maxOccurs="1"/>
				<xs:element name="PreparationDate" type="DateType" />
				<xs:element name="CustomsOffice" type="CustomsOfficeType" />
				<xs:element ref="Customer" />
				<xs:element ref="Declarer" />
				<xs:element ref="ReportingPeriod" />
				<xs:element ref="AppliedDocuments" minOccurs="0" maxOccurs="1"/>
				<xs:element ref="ExciseGoods" minOccurs="0" maxOccurs="1"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
    <xs:element name="ExciseGoods">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="ExciseGood" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="ExciseGood">
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="ExciseGoodType">
                    <xs:sequence>
                       	<xs:element name="AvailableAmount" type="AvailableAmountType" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="ReceivedAmount" type="ReceivedAmountType" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="UsedAmount" type="UsedAmountType" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="RemainingAmount" type="RemainingAmountType" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="QuantityUsedEnergyProducts" type="QuantityUsedEnergyProductsType" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="AvailableAmountEnergyProducts" type="RDAmountsType" minOccurs="0" maxOccurs="1" />
                        <xs:element name="SoldQuantityEnergyProducts" type="RDAmountsType" minOccurs="0" maxOccurs="1" />
                        <xs:element name="DeclarationDateNumber" type="DeclarationDateNumberType" minOccurs="0" maxOccurs="1" />
                        <xs:element name="SoldQuantityInCountry" type="RDAmountsType" minOccurs="0" maxOccurs="1" />
                        <xs:element name="SoldQuantityForExport" type="RDAmountsType" minOccurs="0" maxOccurs="1" />
                        <xs:element name="SoldQuantityForOtherState" type="RDAmountsType" minOccurs="0" maxOccurs="1" />
                    </xs:sequence>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>
</xs:schema>
