<?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:tms="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:TMS:V2.02"
           xmlns:tcl="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:TCL: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:ddtypes="http://www.mf.gov.pl/schematy/EDD/DDTYPES/2019/10/"
           xmlns:dd818="http://www.mf.gov.pl/schematy/EDD/DD818/2019/10/"
           targetNamespace="http://www.mf.gov.pl/schematy/EDD/DD818/2019/10/">
  <!--==================================================== -->
  <!--======                 DD818                  ====== -->
  <!--====== ACCEPTED OR REJECTED REPORT OF RECEIPT ====== -->
  <!--==================================================== -->

  <!--===== Imports =====-->
  <xs:import namespace="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:EMCS:V2.02" schemaLocation="types.xsd" />
  <xs:import namespace="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:TMS:V2.02" schemaLocation="tms.xsd" />
  <xs:import namespace="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:TCL:V2.02" schemaLocation="tcl.xsd" />
  <xs:import namespace="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:DOC:V2.02" schemaLocation="doc.xsd" />
  <xs:import namespace="http://www.mf.gov.pl/schematy/EMCSPL3/EMCSTYPES/2019/10/" schemaLocation="emcsTypes.xsd" />
  <xs:import namespace="http://www.mf.gov.pl/schematy/EDD/DDTYPES/2019/10/" schemaLocation="ddTypes.xsd" />

  <!--===== Root Element =====-->
  <xs:element name="DD818" type="dd818:DD818Type" />

  <!--===== EMCS Data Groups Declarations =====-->
  <xs:complexType name="DD818Type">
    <xs:sequence>
      <xs:element name="Header" type="tms:HeaderType" />
      <xs:element name="Body" type="dd818:BodyType" />
    </xs:sequence>
  </xs:complexType>

  <!--===== IE Specific Data Groups Declarations =====-->
  <xs:complexType name="BodyType">
    <xs:sequence>
      <xs:element name="AcceptedOrRejectedReportOfReceipt" type="dd818:AcceptedOrRejectedReportOfReceiptType" />
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--=====     Accepted Or Rejected Report Of Receipt     =====-->
  <!--==========================================================-->
  <xs:complexType name="AcceptedOrRejectedReportOfReceiptType">
    <xs:sequence>
      <xs:element name="Attributes" type="dd818:AttributesType" minOccurs="0" />
      <xs:element name="DocumentReference" type="ddtypes:AdministrativeReferenceType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="ReportOfReceipt" type="dd818:ReportOfReceiptType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="ConsigneeTrader" type="ddtypes:DDTraderType" minOccurs="1" maxOccurs="1" />
      <xs:element name="DeliveryPlaceTrader" type="ddtypes:DDTraderType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="DestinationOffice" type="ddtypes:DDCustomsOfficeType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="BodyReportOfReceipt" type="dd818:BodyReportOfReceiptType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="StorageGuarantee" type="dd818:DDStorageGuaranteeType" minOccurs="0" maxOccurs="1" />
      <xs:element name="BodyExciseExemptionInfo" type="dd818:BodyExciseExemptionInfoType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--=====                   Attributes                   =====-->
  <!--==========================================================-->
  <xs:complexType name="AttributesType">
    <xs:sequence>
      <xs:element name="DateAndTimeOfValidationOfReportOfReceipt" type="emcs:DateTimeType" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--=====               Report Of Receipt                =====-->
  <!--==========================================================-->
  <xs:complexType name="ReportOfReceiptType">
    <xs:sequence>
      <xs:element name="DateOfArrivalOfExciseProducts" type="emcs:DateType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="GlobalConclusionOfReceipt" type="tcl:GlobalConclusionOfReceipt" minOccurs="1" maxOccurs="1"/>
      <xs:element name="ComplementaryInformation" type="ddtypes:LSDDDComplementaryInformation350Type" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--=====             Body Report Of Receipt             =====-->
  <!--==========================================================-->
  <xs:complexType name="BodyReportOfReceiptType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="(BODY) REPORT OF RECEIPT" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="BodyRecordUniqueReference" type="emcs:BodyRecordUniqueReferenceType" />
      <xs:element name="IndicatorOfShortageOrExcess" type="tcl:IndicatorOfShortageOrExcess" minOccurs="0" />
      <xs:element name="ObservedShortageOrExcess" type="emcs:ObservedShortageOrExcessType" minOccurs="0" />
      <xs:element name="ExciseProductCode" type="emcs:ExciseProductCodeType" />
      <xs:element name="RefusedQuantity" type="emcs:RefusedQuantityType" minOccurs="0" />
      <xs:element name="UnsatisfactoryReason" type="dd818:UnsatisfactoryReasonType" minOccurs="0" maxOccurs="9" />
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--=====             Unsatisfactory Reason              =====-->
  <!--==========================================================-->
  <xs:complexType name="UnsatisfactoryReasonType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="UNSATISFACTORY REASON" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="UnsatisfactoryReasonCode" type="emcs:UnsatisfactoryReasonCodeType" />
      <xs:element name="ComplementaryInformation" type="ddtypes:LSDDDComplementaryInformation350Type" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--=====           Body Excise Exemption Info           =====-->
  <!--==========================================================-->
  <xs:complexType name="BodyExciseExemptionInfoType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="BODY EXCISE EXEMPTION INFO" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="BodyRecordUniqueReference" type="emcs:BodyRecordUniqueReferenceType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="ExciseProductCode" type="emcs:ExciseProductCodeType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="CnCode" type="emcs:CnCodeType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="ExciseExemption" type="ddtypes:ExciseExemptionType" minOccurs="1" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--=====              DD Storage Guarantee              =====-->
  <!--==========================================================-->
  <xs:complexType name="DDStorageGuaranteeType">
    <xs:annotation>
      <xs:documentation>
        <doc:description xml:lang="pl" value="Gwarancja na magazynowanie" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="GuaranteeReferenceNumber" type="emcstypes:GuaranteeReferenceNumberType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="GuaranteeReferenceNumberAccessCode" type="emcstypes:GuaranteeReferenceNumberAccessCodeType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="GuarantorTIN" type="emcstypes:TINType" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>