<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.00"
           xmlns:emcs="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:EMCS:V2.02"
           xmlns:doc="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:DOC:V2.02"
           xmlns:emcstypes="http://www.mf.gov.pl/schematy/EMCSPL3/EMCSTYPES/2019/10/"
           xmlns:tcl="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:TCL:V2.02"
           xmlns:tns="http://www.mf.gov.pl/schematy/EDD/DDTYPES/2020/05/"
           targetNamespace="http://www.mf.gov.pl/schematy/EDD/DDTYPES/2020/05/">
  <!--========================================================-->
  <!--===    Dokument dostawy - definicje typów prostych   ===-->
  <!--=== definicja zawiera tylko typy uzupelniajace albo  ===-->
  <!--===        zmieniające typy używane w EMCS           ===-->
  <!--========================================================-->

  <xs:import namespace="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:EMCS:V2.02"    schemaLocation="types.xsd" />
  <xs:import namespace="http://www.mf.gov.pl/schematy/EMCSPL3/EMCSTYPES/2019/10/" schemaLocation="emcsTypes.xsd"/>
  <xs:import namespace="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:TCL:V2.02"     schemaLocation="tcl.xsd" />

  <!--==========================================================-->
  <!--===                   Guarantee Amount                 ===-->
  <!--==========================================================-->
  <xs:simpleType name="GuaranteeAmountType">
    <xs:annotation>
      <xs:documentation>
        <doc:description xml:lang="pl" value="Kwota gwarancji do zwolnienia"/>
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:decimal">
      <xs:totalDigits value="10"/>
      <xs:fractionDigits value="2"/>
      <xs:minInclusive value="0"/>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===   DeliveryDocumentAdministrativeReferenceCodeType  ===-->
  <!--==========================================================-->
  <xs:simpleType name="DeliveryDocumentAdministrativeReferenceCodeType">
    <xs:restriction base="xs:token">
      <xs:length value="21"/>
      <xs:pattern value="[0-9]{2}[A-Z]{2}DD[A-Z0-9]{14}[0-9]"/>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===       DeliveryDocumentLocalReferenceNumberType     ===-->
  <!--==========================================================-->
  <xs:simpleType name="DeliveryDocumentLocalReferenceNumberType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="Local Reference Number"/>
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:length value="23"/>
      <xs:pattern value="[A-Z0-9]{11}[ANP]{1}[0-9]{11}"/>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===                    DDTraderType                    ===-->
  <!--==========================================================-->
  <xs:complexType name="DDTraderType">
    <xs:sequence>
      <xs:element name="Traderid" type="tns:DDTraderIdType" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>
            Identyfikator podmiotu bioracego udział w dostawie.
            W zalezności od typu podmiotu okreslonego przez atrybut "deliveryTraderType" jest to:
            - numer akcyzowy (dla składu podatkowego i zarejestrowanego odbiorcy)
            - NIP dla zuzywającego podmiotu gospodarczego
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TraderName"   type="emcs:TraderNameType"   minOccurs="1" maxOccurs="1"/>
      <xs:element name="StreetName"   type="emcs:StreetNameType"   minOccurs="1" maxOccurs="1"/>
      <xs:element name="StreetNumber" type="emcs:StreetNumberType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="Postcode"     type="emcs:PostcodeType"     minOccurs="1" maxOccurs="1" />
      <xs:element name="City"         type="emcs:CityType"         minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="language" type="emcs:LanguageCodeType" use="required"/>
    <xs:attribute name="deliveryTraderType" type="tns:DeliveryTraderTypeType" use="required"/>
  </xs:complexType>

  <!--==========================================================-->
  <!--===               DDConsigneeTradersType               ===-->
  <!--==========================================================-->
  <xs:complexType name="DDConsigneeTradersType">
    <xs:sequence>
      <xs:element name="ConsigneeTrader" type="tns:DDTraderType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="DeliveryPlaceTrader" type="tns:DDTraderType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="DeliveryPlaceCustomsOffice" type="tns:DDCustomsOfficeType" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--===           DDConsigneeTradersReceiptType            ===-->
  <!--==========================================================-->
  <xs:complexType name="DDConsigneeTradersReceiptType">
    <xs:complexContent>
      <xs:extension base="tns:DDConsigneeTradersType">
        <xs:sequence>
          <xs:element name="ExciseExemption" type="tns:ExciseExemptionType" minOccurs="0" maxOccurs="1" />
        </xs:sequence>
        <xs:attribute name="ReceivedQuantity" type="emcs:QuantityType" use="required" />
        <xs:attribute name="PaidExcise" type="tcl:Flag" use="optional" />
        <xs:attribute name="DateOfArrivalOfExciseProducts" type="emcs:DateType" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!--==========================================================-->
  <!--===                  DDTraderIdType                    ===-->
  <!--==========================================================-->
  <xs:complexType name="DDTraderIdType">
    <xs:choice minOccurs="1" maxOccurs="1">
      <xs:element name="ExciseNumber" type="emcs:TraderidType"  minOccurs="1" maxOccurs="1"/>
      <xs:element name="TaxNumber" type="tns:TaxNumberType"  minOccurs="1" maxOccurs="1"/>
      <xs:element name="PersonalId" type="tns:PersonalIdType"  minOccurs="1" maxOccurs="1"/>
    </xs:choice>
  </xs:complexType>

  <!--==========================================================-->
  <!--===                   TaxNumberType                    ===-->
  <!--==========================================================-->
  <xs:simpleType name="TaxNumberType">
    <xs:restriction base="xs:token">
      <xs:length value="10"/>
      <xs:pattern value="[0-9]{10}"/>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===                  PersonalIdType                    ===-->
  <!--==========================================================-->
  <xs:simpleType name="PersonalIdType">
    <xs:restriction base="xs:token">
      <xs:maxLength value="16"/>
      <xs:pattern value="[a-zA-Z0-9]{1,16}"/>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===                DDCustomsOfficeType                 ===-->
  <!--==========================================================-->
  <xs:complexType name="DDCustomsOfficeType">
    <xs:sequence>
      <xs:element name="ReferenceNumber" type="emcs:ExciseOfficeCodeType"/>
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--===       DDDispatchAndImportCustomsOfficesType        ===-->
  <!--==========================================================-->
  <xs:complexType name="DDDispatchAndImportCustomsOfficesType">
    <xs:complexContent>
      <xs:extension base="tns:DDCustomsOfficeType">
        <xs:sequence>
          <xs:element name="DispatchImportOfficeReferenceNumber" type="emcs:ExciseOfficeCodeType" minOccurs="0" maxOccurs="1" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!--==========================================================-->
  <!--===        DDComplementaryInformation350Type           ===-->
  <!--==========================================================-->
  <xs:simpleType name="DDComplementaryInformation350Type">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="Complementary Information"/>
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:maxLength value="350"/>
      <xs:pattern value=".{1,350}"/>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===      LSDDDComplementaryInformation350Type          ===-->
  <!--==========================================================-->
  <xs:complexType name="LSDDDComplementaryInformation350Type">
    <xs:simpleContent>
      <xs:extension base="tns:DDComplementaryInformation350Type">
        <xs:attribute name="language" type="emcs:LanguageCodeType" use="required"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <!--==========================================================-->
  <!--===             AdministrativeReferenceType            ===-->
  <!--==========================================================-->
  <xs:complexType name="AdministrativeReferenceType">
    <xs:sequence>
      <xs:element name="DeliveryDocumentAdministrativeReferenceCode" type="tns:DeliveryDocumentAdministrativeReferenceCodeType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="SequenceNumber" type="emcs:SequenceNumberType" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--===         UpdatedAdministrativeReferenceType         ===-->
  <!--==========================================================-->
  <xs:complexType name="UpdatedAdministrativeReferenceType">
    <xs:sequence>
      <xs:element name="DeliveryDocumentAdministrativeReferenceCode" type="tns:DeliveryDocumentAdministrativeReferenceCodeType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="SequenceNumber" type="emcs:SequenceNumberType" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--===          DeliveryDocumentReferenceType             ===-->
  <!--==========================================================-->
  <xs:complexType name="DeliveryDocumentReferenceType">
    <xs:choice minOccurs="1" maxOccurs="1">
      <xs:element name="AdministrativeReference" type="tns:AdministrativeReferenceType"/>
      <xs:element name="LocalReferenceNumber"    type="tns:DeliveryDocumentLocalReferenceNumberType" />
    </xs:choice>
  </xs:complexType>

  <!--==========================================================-->
  <!--===               DDTransportDetailsType               ===-->
  <!--==========================================================-->
  <xs:complexType name="DDTransportDetailsType">
    <xs:sequence>
      <xs:element name="TransportUnitCode" type="emcs:TransportUnitCodeType"/>
      <xs:element name="IdentityOfTransportUnits" type="emcs:IdentityOfTransportUnitsType" minOccurs="0"/>
      <xs:element name="ComplementaryInformation" type="tns:LSDDDComplementaryInformation350Type" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--===                 DDTransportModeType                ===-->
  <!--==========================================================-->
  <xs:complexType name="DDTransportModeType">
    <xs:sequence>
      <xs:element name="TransportModeCode" type="emcs:TransportModeCodeType"/>
      <xs:element name="ComplementaryInformation" type="tns:LSDDDComplementaryInformation350Type" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--===                DDAdditionalDocType                 ===-->
  <!--==========================================================-->
  <xs:complexType name="DDAdditionalDocType">
    <xs:sequence>
      <xs:element name="AdditionalDocumentNumber" type="tns:DDAdditionalDocNumberType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="AdditionalDocumentDate"   type="emcs:DateType" minOccurs="0" maxOccurs="1" />
      <xs:element name="ComplementaryInformation" type="tns:LSDDDComplementaryInformation350Type" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--===             DDAdditionalDocNumberType              ===-->
  <!--==========================================================-->
  <xs:simpleType name="DDAdditionalDocNumberType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="Numer dokumentu dodatkowego"/>
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:maxLength value="50"/>
      <xs:pattern value=".{1,50}"/>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===               DDAdditionalDocTypeType              ===-->
  <!--==========================================================-->
  <xs:simpleType name="DDAdditionalDocTypeType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="Określenie typu dokumentu dodatkowego"/>
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:nonNegativeInteger">
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation>Numer poprzedzającego e-DD</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===                ExciseDutyRateType                  ===-->
  <!--==========================================================-->
  <xs:simpleType name="ExciseDutyRateType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="Określenie klasy dostarczonych towarów pod względem obowiązku akcyzowego"/>
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:nonNegativeInteger">
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation>Towary zwolnione z akcyzy ze względu na przeznaczenie</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="2">
        <xs:annotation>
          <xs:documentation>Towary objete zerową stawką akcyzy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===                    BodyEDDType                     ===-->
  <!--==========================================================-->
  <xs:complexType name="BodyEDDType">
    <xs:annotation>
      <xs:documentation>
        <doc:description xml:lang="pl" value="17a e-DD Wyroby"/>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="BodyRecordUniqueReference" type="emcs:BodyRecordUniqueReferenceType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="ExciseProductCode" type="emcs:ExciseProductCodeType"/>
      <xs:element name="CnCode" type="emcs:CnCodeType"/>
      <xs:element name="Quantity" type="emcs:QuantityType"/>
      <xs:element name="AdditionalQuantity" type="emcs:QuantityType" minOccurs="0"/>
      <xs:element name="GrossWeight" type="emcs:GrossWeightType"/>
      <xs:element name="NetWeight" type="emcs:NetWeightType"/>
      <xs:element name="AlcoholicStrength" type="emcs:AlcoholicStrengthType" minOccurs="0"/>
      <xs:element name="DegreePlato" type="emcs:DegreePlatoType" minOccurs="0"/>
      <xs:element name="Density" type="emcs:DensityType" minOccurs="0"/>
      <xs:element name="CommercialDescription" type="tns:LSDDDComplementaryInformation350Type" minOccurs="0"/>
      <xs:element name="BrandNameOfProducts" type="tns:LSDDDComplementaryInformation350Type" minOccurs="0"/>
      <xs:element name="NotColouredAndMarkedFuelOils" type="tcl:Flag" minOccurs="0"/>
      <xs:element name="BiofuelContentMeetsQualityRequirements" type="tcl:Flag" minOccurs="0"/>
      <xs:element name="FuelType" type="emcstypes:FuelTypeType" minOccurs="0"/>
      <xs:element name="MaxRetailPrice" type="tns:MaxRetailPriceType" minOccurs="0"/>
      <xs:element name="FiscalMarkUsedFlag" type="tcl:Flag" minOccurs="0" />
      <xs:element name="SizeOfProducer" type="emcs:SizeOfProducerType" minOccurs="0" />
      <xs:element name="Package" type="tns:DDPackageType" maxOccurs="99"/>
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--===                   DDPackageType                    ===-->
  <!--==========================================================-->
  <xs:complexType name="DDPackageType">
    <xs:sequence>
      <xs:element name="KindOfPackages" type="emcs:KindOfPackagesType"/>
      <xs:element name="NumberOfPackages" type="emcs:NumberOfPackagesType" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--===              DeliveryClosingFlagType               ===-->
  <!--==========================================================-->
  <xs:simpleType name="DeliveryClosingFlagType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="Flaga okreslająca tryb zakończenia obsługi deklaracji"/>
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:nonNegativeInteger">
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation>Zakończenie standardowe tj. przez podmiot odbierający przy użyciu raportu odbioru</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="2">
        <xs:annotation>
          <xs:documentation>Zakończenie przez podmiot wysyłający przy użyciu raportu odbioru</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="3">
        <xs:annotation>
          <xs:documentation>Zakończenie na podstawie deklaracji e-DD</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="4">
        <xs:annotation>
          <xs:documentation>Zakończenie na podstawie procedury eksportowej</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===              DeliveryTraderTypeType                ===-->
  <!--==========================================================-->
  <xs:simpleType name="DeliveryTraderTypeType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="Określenie rodzaju podmiotu wysyłającego albo odbierającego dostawę"/>
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:nonNegativeInteger">
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation>SP - Skład podatkowy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="2">
        <xs:annotation>
          <xs:documentation>ZO - Zarejestrowany odbiorca</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="3">
        <xs:annotation>
          <xs:documentation>PP - Podmiot pośredniczący</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="4">
        <xs:annotation>
          <xs:documentation>ZPG - Zużywający podmiot gospodarczy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="5">
        <xs:annotation>
          <xs:documentation>AWK - Właściciel składu podatkowego</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="6">
        <xs:annotation>
          <xs:documentation>RCO - Zarejestrowany wysyłający</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="7">
        <xs:annotation>
          <xs:documentation>PZ – Podmiot zużywający</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="8">
        <xs:annotation>
          <xs:documentation>PNS – Podmiot nieobjęty systemem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="9">
        <xs:annotation>
          <xs:documentation>PPW – Pośredniczący podmiot węglowy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="10">
        <xs:annotation>
          <xs:documentation>PN – Podmiot niszczący</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===               GuarantorTraderType                  ===-->
  <!--==========================================================-->
  <xs:complexType name="GuarantorTraderType">
    <xs:sequence>
      <xs:element name="TraderExciseNumber" type="emcs:ExciseNumberType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="TraderName" type="emcs:TraderNameType"           minOccurs="1" maxOccurs="1" />
      <xs:element name="StreetName" type="emcs:StreetNameType"           minOccurs="1" maxOccurs="1"/>
      <xs:element name="StreetNumber" type="emcs:StreetNumberType"       minOccurs="0" maxOccurs="1" />
      <xs:element name="City" type="emcs:CityType"                       minOccurs="1" maxOccurs="1"/>
      <xs:element name="Postcode" type="emcs:PostcodeType"               minOccurs="1" maxOccurs="1" />
      <xs:element name="VatNumber" type="emcs:VatNumberType"             minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="language" type="emcs:LanguageCodeType" use="optional"/>
  </xs:complexType>

  <!--==========================================================-->
  <!--===                ExciseExemptionType                 ===-->
  <!--==========================================================-->
  <xs:complexType name="ExciseExemptionType">
    <xs:sequence>
      <xs:element name="ProductPurpose" type="xs:positiveInteger" minOccurs="1" maxOccurs="1"/>
      <xs:element name="ComplementaryInformation" type="tns:LSDDDComplementaryInformation350Type" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <!--=========================================-->
  <!--=====   Requested DDMessage Type    =====-->
  <!--=========================================-->
  <xs:simpleType name="RequestedDDMessageType">
    <xs:annotation>
      <xs:documentation>Requested Message Type</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:enumeration value="DD801">
        <xs:annotation>
          <xs:documentation>E-DD</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DD803">
        <xs:annotation>
          <xs:documentation>NOTIFICATION OF DIVERTED E-DD</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DD810">
        <xs:annotation>
          <xs:documentation>CANCELLATION OF AN E-DD</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DD813">
        <xs:annotation>
          <xs:documentation>CHANGE OF DESTINATION E-DD</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DD818">
        <xs:annotation>
          <xs:documentation>ACCEPTED OR (PARTIALLY) REFUSED REPORT OF RECEIPT/EXPORT</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DD829">
        <xs:annotation>
          <xs:documentation>NOTIFICATION OF ACCEPTED EXPORT</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DD839">
        <xs:annotation>
          <xs:documentation>REJECTION OF E-DD FOR EXPORT</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DD905">
        <xs:annotation>
          <xs:documentation>STATUS RESPONSE</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <!--=========================================-->
  <!--=====         Tryb Dostawy          =====-->
  <!--=========================================-->
  <xs:simpleType name="DeliveryDocumentModeFlag">
    <xs:annotation>
      <xs:documentation>Tryb dostawy</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:nonNegativeInteger">
      <xs:enumeration value="0">
        <xs:annotation>
          <xs:documentation>Dostawa</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation>Zwrot</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="2">
        <xs:annotation>
          <xs:documentation>Import</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="3">
        <xs:annotation>
          <xs:documentation>Dostawa ze zbiornika</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="4">
        <xs:annotation>
          <xs:documentation>Eksport</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="5">
        <xs:annotation>
          <xs:documentation>Dostawa wyrobów węglowych</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--===                 Maximum retail price               ===-->
  <!--==========================================================-->
  <xs:simpleType name="MaxRetailPriceType">
    <xs:annotation>
      <xs:documentation xml:lang="pl" >
        Maksymalna cena detaliczna za 20 szt. lub za kilogram
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:decimal">
      <xs:totalDigits value="5" />
      <xs:fractionDigits value="2" />
      <xs:minInclusive value="0" />
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--=====                   Place Name                   =====-->
  <!--==========================================================-->
  <xs:simpleType name="PlaceNameType">
    <xs:annotation>
      <xs:documentation>Nazwa miejsca</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:maxLength value="182" />
      <xs:pattern value=".{1,182}" />
    </xs:restriction>
  </xs:simpleType>

  <!--==========================================================-->
  <!--=====                   Import Sad                   =====-->
  <!--==========================================================-->
  <xs:complexType name="ImportSadType">
    <xs:sequence>
      <xs:element name="ImportSadNumber" type="emcs:ImportSadNumberType" />
    </xs:sequence>
  </xs:complexType>

</xs:schema>