<?xml version="1.0" encoding="utf-8"?>
<xs:schema
    targetNamespace="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v3_0/P_KOP_MS.xsd"
    xmlns:tr="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v3_0/Trader.xsd" 
    xmlns:tp3="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v3_0/Types.xsd"
    xmlns:pkopms="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v3_0/P_KOP_MS.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:auth="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v2_0/Authentication.xsd" 
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    version="3_0"
    xml:lang="pl">
    
    <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd" />
    <xs:import namespace="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v3_0/Types.xsd" schemaLocation="Types_Z3.xsd" />
    <xs:import namespace="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v3_0/Trader.xsd" schemaLocation="Trader_Z3.xsd" />
    <xs:import namespace="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v2_0/Authentication.xsd" schemaLocation="auth.xsd"/>
    
    <xs:annotation>
        <xs:documentation source="doc" xml:lang="pl">DEKLARACJA	DLA PODATKU OD WYDOBYCIA NIEKTÓRYCH KOPALIN W ZAKRESIE MIEDZI I SREBRA</xs:documentation>
        <xs:documentation source="doc" xml:lang="pl">
            Podstawa prawna: 
            Art. 14 ust. 1 pkt 1 ustawy z dnia 2 marca 2012 r. 
            o podatku od wydobycia niektórych kopalin
            (Dz. U. poz. 362, z 2014 r. poz. 1215 oraz z 2015 r. poz. 211) zwanej dalej "ustawą".
            Termin składania:
            Do 25. dnia miesiąca następującego po miesiącu, 
            w którym powstał obowiązek podatkowy.
            Miejsce składania: Urząd Skarbowy w Legnicy.
            W przypadku niewpłacenia w obowiązującym terminie kwoty z pola 'toPay'
            lub wpłacenia jej w niepełnej wysokości, niniejsza deklaracja stanowi
            podstawę do wystawienia tytułu wykonawczego, zgodnie z przepisami
            ustawy z dnia 17 czerwca 1966 r. o postępowaniu egzekucyjnym w
            administracji (Dz. U. z 2005 r. Nr 229, poz. 1954, z późn. zm.).
        </xs:documentation>
    </xs:annotation>
    <xs:element name="PKOPMS">
        <xs:annotation>
            <xs:documentation source="doc" xml:lang="pl">ELEMENT GŁÓWNY</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Header" minOccurs="1" maxOccurs="1">
                    <xs:annotation>
                        <xs:documentation source="doc" xml:lang="pl">NAGłÓWEK DEKLARACJI</xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="Trader" type="tr:ZTrader" minOccurs="1" maxOccurs="1">
                                <xs:annotation>
                                    <xs:documentation source="doc" xml:lang="pl">PODMIOT</xs:documentation>
                                    <xs:documentation source="doc" xml:lang="pl">B</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="CalcTax" minOccurs="1" maxOccurs="1">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="Item" minOccurs="1" maxOccurs="2">
                                            <xs:annotation>
                                                <xs:documentation source="doc" xml:lang="pl">
                                                    OBLICZENIE KWOT PODATKU OD POSZCZEGÓLNYCH WYROBÓW
                                                </xs:documentation>
                                                <xs:documentation source="doc" xml:lang="pl">
                                                    Dla stawki procentowo-kwotowej przy opodatkowaniu papierosów
                                                    należy podać oddzielnie wyrób ze stawką procentową 
                                                    i oddzielnie ze stawką kwotową.
                                                </xs:documentation>
                                            </xs:annotation>
                                            <xs:complexType>
                                                <xs:attribute name="id" type="tp3:ZNumeric" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">
                                                            Liczba porządkowa.
                                                        </xs:documentation>
                                                        <xs:documentation source="box">-</xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="codeOfMineral" type="pkopms:ZMineralList" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">
                                                            Nazwa (kod) kopaliny.
                                                        </xs:documentation>
                                                        <xs:documentation source="box">
                                                            C.a
                                                        </xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="unitOfMeasure" use="optional">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">
                                                            Jednostka miary, w jakiej podane są ilości wyrobów.
                                                            Ilość wyrobów może być podana w kilogramach lub tonach.
                                                        </xs:documentation>
                                                        <xs:documentation source="box">
                                                            -
                                                        </xs:documentation>
                                                    </xs:annotation>
                                                    <xs:simpleType>
                                                        <xs:restriction base="xs:string">
                                                            <xs:whiteSpace value="collapse"/>
                                                            <xs:enumeration value="kg"/>
                                                            <xs:enumeration value="t"/>
                                                        </xs:restriction>
                                                    </xs:simpleType>
                                                </xs:attribute>
                                                <xs:attribute name="numberOfGoods" type="tp3:ZAmountC" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">
                                                            Podstawa obliczenia podatku (ilość miedzi wyrażona w tonach/ilość srebra wyrażona w kg).
                                                        </xs:documentation>
                                                        <xs:documentation source="box">
                                                            C.b
                                                        </xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="averagePrice" type="tp3:ZAmountP" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">
                                                            Średnia cena jednej tony miedzi/średnia cena jednego kilograma srebra.
                                                        </xs:documentation>
                                                        <xs:documentation source="box">
                                                            C.c
                                                        </xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="taxRate" type="tp3:ZAmountC" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">
                                                            Stawka podatku.
                                                        </xs:documentation>
                                                        <xs:documentation source="box">
                                                            C.d
                                                        </xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="amountOfTax" type="tp3:ZAmountT" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">
                                                            Kwota podatku w zł.
                                                        </xs:documentation>
                                                        <xs:documentation source="box">
                                                            C.e
                                                        </xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                    <xs:attribute name="totalTaxLoss" type="tp3:ZAmountP" use="optional">
                                        <xs:annotation>
                                            <xs:documentation source="doc" xml:lang="pl">Wysokość skumulowanej straty podatkowej.</xs:documentation>
                                            <xs:documentation source="box">27</xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="amountOfReductions" type="tp3:ZAmountP" use="optional">
                                        <xs:annotation>
                                            <xs:documentation source="doc" xml:lang="pl">Kwota odliczenia</xs:documentation>
                                            <xs:documentation source="box">28</xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="sum" type="tp3:ZAmountP" use="required">
                                        <xs:annotation>
                                            <xs:documentation source="doc" xml:lang="pl">
                                                Podatek do zapłaty.
                                            </xs:documentation>
                                            <xs:documentation source="box">
                                                29
                                            </xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="Statement" type="tp3:ZExtStatement" minOccurs="1" maxOccurs="1"/>
                        </xs:sequence>
                        <xs:attribute name="identifier" type="tp3:ZIdentification" use="required">
                            <xs:annotation>
                                <xs:documentation source="doc" xml:lang="pl">
                                    Identyfikator podatnika (NIP lub PESEL)
                                </xs:documentation>
                                <xs:documentation source="box">
                                    1
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="period" type="tp3:ZPeriod" use="required">
                            <xs:annotation>
                                <xs:documentation source="doc" xml:lang="pl">
                                    Data w formacie rok i miesiąc (RRRR-MM) ,gdzie RRRR - oznacza rok, MM - oznacza miesiąc.
                                </xs:documentation>
                                <xs:documentation source="box">
                                    4,5
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="taxOffice" type="tp3:ZTaxOffice" use="required" fixed="0210">
                            <xs:annotation>
                                <xs:documentation source="doc" xml:lang="pl">
                                    Urząd skarbowy, do którego adresowana jest deklaracja - US w Legnicy.
                                </xs:documentation>
                                <xs:documentation source="box">
                                    -
                                </xs:documentation>
                            </xs:annotation>                                
                        </xs:attribute>
                        <xs:attribute name="submissionAim" type="tp3:ZSubmissionAim" use="required">
                            <xs:annotation>
                                <xs:documentation source="doc" xml:lang="pl">
                                    Informacja czy dokument jest deklaracją czy korektą.</xs:documentation>
                                <xs:documentation source="box">6</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="orgDocNo" type="tp3:ZDocNo" use="optional">
                            <xs:annotation>
                                <xs:documentation source="doc" xml:lang="pl">
                                    Numer dokumentu pierwotnego, którego dotyczy korekta.
                                </xs:documentation>
                                <xs:documentation source="box">
                                    -
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>                           
                        <xs:attribute name="justification" use="optional">
                            <xs:annotation>
                                <xs:documentation source="doc" xml:lang="pl">
                                    Pole tekstowe pozwalające na wprowadzenie informacji uzasadniającej korektę.
                                </xs:documentation>
                                <xs:documentation source="box">
                                    -
                                </xs:documentation>
                            </xs:annotation>
                            <xs:simpleType>
                                <xs:restriction base="xs:string">
                                    <xs:maxLength value="256" />
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="selfRef" type="tp3:ZSelfRef" use="optional">
                            <xs:annotation>
                                <xs:documentation source="doc" xml:lang="pl">Numer własny komunikatu.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
                <xs:element ref="auth:Authentication" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="ds:Signature" minOccurs="0" maxOccurs="1"/>
            </xs:sequence>
            <xs:attribute name="version" type="tp3:ZVersion" use="required">
                <xs:annotation>
                    <xs:documentation source="doc" xml:lang="pl">Wersja schematu, z którą zgodny jest komunikat.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:simpleType name="ZMineralList">
        <xs:annotation>
            <xs:documentation source="doc" xml:lang="pl">Rodzaje kopalin.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse" />
            <xs:enumeration value="Cu">
                <xs:annotation>
                    <xs:documentation source="doc" xml:lang="pl">Miedź</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="Ag">
                <xs:annotation>
                    <xs:documentation source="doc" xml:lang="pl">Srebro</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>
