<?xml version="1.0" encoding="utf-8"?>
<xs:schema 
    targetNamespace="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v5_0/AKC_US.xsd"
    xmlns:tr="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v4_0/Trader.xsd" 
    xmlns:tp4="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v4_0/Types.xsd"
    xmlns:akcus="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v4_0/AKC_US.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#" 
    xmlns:auth="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v2_0/Authentication.xsd"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    version="5_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/v4_0/Types.xsd" schemaLocation="Types_Z4.xsd" />
    <xs:import namespace="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v4_0/Trader.xsd" schemaLocation="Trader_Z4.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 UPROSZCZONA DLA PODATKU AKCYZOWEGO
			OD NABYCIA WEWNĄTRZWSPÓLNOTOWEGO SAMOCHODÓW OSOBOWYCH
        </xs:documentation>
        <xs:documentation source="doc" xml:lang="pl">
			Podstawa prawna: 
			Art. 106 ust. 2 ustawy z dnia 6 grudnia 2008 r. o podatku akcyzowym (Dz. U. z 2017 r. poz. 43, z późn. zm.).
			Termin składania: 
			Do 14 dni, licząc od dnia powstania obowiązku podatkowego, nie później jednak niż w dniu rejestracji
			samochodu osobowego na terytorium kraju zgodnie z przepisami o ruchu drogowym. 
			Miejsce składania:
			Urząd skarbowy, przy pomocy którego wykonuje swoje zadania naczelnik urzędu skarbowego właściwy ze względu
			na miejsce wykonywania czynności lub wystąpienia stanów faktycznych, podlegających opodatkowaniu akcyzą;
			jeżeli czynności podlegające opodatkowaniu akcyzą są wykonywane lub stany faktyczne podlegające opodatkowaniu
			akcyzą występują na obszarze właściwości miejscowej dwóch lub więcej naczelników urzędów skarbowych
			– zgodnie z art. 14 ust. 4-4f ustawy z dnia 6 grudnia 2008 r. o podatku akcyzowym;
			jeżeli właściwym organem podatkowym jest Naczelnik Trzeciego Urzędu Skarbowego Warszawa-Śródmieście w Warszawie,
			to miejscem składania jest Trzeci Urząd Skarbowy Warszawa-Śródmieście w Warszawie.
        </xs:documentation>
    </xs:annotation>
    <xs:element name="AKCUS">
        <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">
                                <xs:annotation>
                                    <xs:documentation source="doc" xml:lang="pl">PODMIOT</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="AmountPayable">	
                                <xs:annotation>
                                    <xs:documentation source="doc" xml:lang="pl">WYSOKOŚĆ PODATKU AKCYZOWEGO</xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:attribute name="totalAmountOfTax" type="tp4:ZAmountP" use="required">
                                        <xs:annotation>
                                            <xs:documentation source="doc" xml:lang="pl">Kwota podatku akcyzowego z poz. 41</xs:documentation>
                                            <xs:documentation source="box">18</xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="totalAmountOfReductions" type="tp4:ZAmountP" use="optional">
                                        <xs:annotation>
                                            <xs:documentation source="doc" xml:lang="pl">Zwolnienia i obniżenia.</xs:documentation>
                                            <xs:documentation source="box">19</xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="toPay" type="tp4:ZAmountP" use="required">
                                        <xs:annotation>
                                            <xs:documentation source="doc" xml:lang="pl">Podatek akcyzowy do zapłaty.</xs:documentation>
                                            <xs:documentation source="box">20</xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
							<xs:element name="TaxPayer">	
                                <xs:annotation>
                                    <xs:documentation source="doc" xml:lang="pl">Podatnik</xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
									<xs:attribute name="TaxPayerStatus" use="required">				
										<xs:annotation>
											<xs:documentation source="doc" xml:lang="pl">Status podatnika.</xs:documentation>	
										</xs:annotation>
										<xs:simpleType>
											<xs:restriction base="xs:string">
												<xs:enumeration value="wspolwlasciciel"/>
												<xs:enumeration value="podmiotOKtorymMowaWArt109Ust3aUstawy"/>
												<xs:enumeration value="inny"/>
											</xs:restriction>
										</xs:simpleType>							
									</xs:attribute>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="CalcAmountPayable">
                                <xs:annotation>
                                    <xs:documentation source="doc" xml:lang="pl">OBLICZENIE
												WYSOKOŚCI PODATKU AKCYZOWEGO OD SAMOCHODÓW OSOBOWYCH</xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="Item" minOccurs="0" maxOccurs="999">
                                            <xs:complexType>
                                               <xs:attribute name="id" type="tp4:ZNumeric" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">Liczba	porządkowa.</xs:documentation>
                                                        <xs:documentation source="box">D.a</xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
												<xs:attribute name="condition" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Stan pojazdu.</xs:documentation>
                                                        <xs:documentation source="box">D.b</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:enumeration value="nowy"/>
															<xs:enumeration value="uzywany"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="mark" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Marka samochodu.</xs:documentation>
                                                        <xs:documentation source="box">D.b.a</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:maxLength value="22"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="model" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Model samochodu.</xs:documentation>
                                                        <xs:documentation source="box">D.b.b</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:maxLength value="25"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="yearOfProduction" type="xs:gYear" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Rok produkcji.</xs:documentation>
                                                        <xs:documentation source="box">D.b.c</xs:documentation>
													</xs:annotation>
												</xs:attribute>
												<xs:attribute name="customVIN" type="xs:boolean" default="false" use="optional">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Niestandardowy numer VIN</xs:documentation>
													</xs:annotation>
												</xs:attribute>
												<xs:attribute name="VIN" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Numer identyfikacyjny VIN (nadwozia/podwozia).</xs:documentation>
                                                        <xs:documentation source="box">D.b.d</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:maxLength value="20" />
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="VINis" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">VIN dotyczy.</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:enumeration value="VIN"/>
															<xs:enumeration value="nadwozia"/>
															<xs:enumeration value="podwozia"/>
															<xs:enumeration value="ramy"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="enginePower" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Moc silnika w kW</xs:documentation>
                                                        <xs:documentation source="box">D.b.e</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:decimal">
															<xs:fractionDigits value="2" />
															<xs:totalDigits value="6" />
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="capacityOfEngine" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Pojemność skokowa silnika.</xs:documentation>
                                                        <xs:documentation source="box">D.b.f</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:decimal">
															<xs:fractionDigits value="0" />
															<xs:totalDigits value="5" />
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="milage" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Przebieg w km</xs:documentation>
                                                        <xs:documentation source="box">D.b.g</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:decimal">
															<xs:totalDigits value="9" />
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="typeOfTransmission" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Rodzaj skrzyni biegów</xs:documentation>
                                                        <xs:documentation source="box">D.b.h</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:enumeration value="manualna"/>
															<xs:enumeration value="automatyczna"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="driveType" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Sposób napędu.</xs:documentation>
                                                        <xs:documentation source="box">D.b.i</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:pattern value="((olejNapedowy|benzyna|energiaElektryczna|gazDoNapedu|hybrydowyTypuPlug–in|hybrydowyInnyNizTypuPlug–in|wodor|inny)[ ]?)+"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="technicalCondition" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Stan techniczny</xs:documentation>
                                                        <xs:documentation source="box">D.b.j</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:enumeration value="nieuszkodzony"/>
															<xs:enumeration value="uszkodzonyZOpiniaBieglego"/>
															<xs:enumeration value="uszkodzonyBezOpiniiBieglego"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
                                                <xs:attribute name="obligationDate" type="xs:date" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">Data powstania obowiązku podatkowego (dzień-miesiąc-rok).</xs:documentation>
                                                        <xs:documentation source="box">D.c</xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="taxBase" type="tp4:ZAmountP" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">Podstawa opodatkowania</xs:documentation>
                                                        <xs:documentation source="box">D.d</xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="taxRate" type="tp4:ZPercentage" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">Stawka podatku wyrażona ułamkiem dziesiętnym z dokładnością do 4 miejsc po przecinku.(Wartość ze słownika 3091).</xs:documentation>
                                                        <xs:documentation source="box">D.e</xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="amountOfTax" type="tp4:ZAmountT" use="required">
                                                    <xs:annotation>
                                                        <xs:documentation source="doc" xml:lang="pl">Kwota podatku w zł.</xs:documentation>
                                                        <xs:documentation source="box">D.f</xs:documentation>
                                                    </xs:annotation>
                                                </xs:attribute>
												<xs:attribute name="resettlementProperty" use="optional">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Rodzaj zwolnienia</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:enumeration value="mieniePrzesiedlenia"/>
															<xs:enumeration value="samochodElektryczny_NapedzanyWodorem"/>
															<xs:enumeration value="samochodHybrydowyTypuPlug-inDo2000"/>
															<xs:enumeration value="samochodSpecjalistyczny"/>
															<xs:enumeration value="pozostaleZwolnienienia"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="bodyCar" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Rodzaj nadwozia</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:maxLength value="20" />
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="proofOfOwnership" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Dowód własności</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:enumeration value="umowaSprzedazy"/>
															<xs:enumeration value="fakturaONumerze"/>
															<xs:enumeration value="inny"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="invoiceNumber" use="optional">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Numer faktury (wymagalne przy zaznaczeniu profofOwnrship=fakturaONumerze)</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:maxLength value="20" />
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="noOfOwners" use="optional">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Liczba właścicieli (wymagalne przy zaznaczeniu TaxPayerStatus=wspolwlasciciel)</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:integer">
															<xs:totalDigits value="1"/>
															<xs:minInclusive value="1"/>
															<xs:maxInclusive value="9"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                    <xs:attribute name="sum" type="tp4:ZAmountT" use="required">
                                        <xs:annotation>
                                            <xs:documentation source="doc" xml:lang="pl">Kwota podatku razem</xs:documentation>
                                            <xs:documentation source="box">41</xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="Statement" type="tp4:ZIDExtStatement" minOccurs="1" maxOccurs="1"/>
                        </xs:sequence>
                        <xs:attribute name="identifier" type="tp4:ZIdentification" use="required">
                            <xs:annotation>
                                <xs:documentation source="doc" xml:lang="pl">Identyfikator podatkowy NIP/ numer PESEL podatnika.</xs:documentation>
                                <xs:documentation source="box">1</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="taxOffice" type="tp4:ZTaxOffice" use="optional">
                            <xs:annotation>
                                <xs:documentation source="doc" xml:lang="pl">Naczelnik urzędu skarbowego</xs:documentation>
                                <xs:documentation source="box">4</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="submissionAim" type="tp4:ZSubmissionAim" use="required">
                            <xs:annotation>
                                <xs:documentation source="doc" xml:lang="pl">Cel złożenia formularza: złożenie deklaracji/korekta deklaracji</xs:documentation>
                                <xs:documentation source="box">5</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="orgDocNo" type="tp4: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="selfRef" type="tp4:ZSelfRef" use="required">
                            <xs:annotation>
                                <xs:documentation>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="tp4: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:schema>
