<?xml version="1.0" encoding="utf-8"?>
<xs:schema 
    targetNamespace="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v4_0/GHD_1.xsd" 
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    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" 
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    version="4_0"
    xml:lang="pl" xmlns:ghd1="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v4_0/GHD_1.xsd">

	<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_Z2.xsd"/>
	<xs:import namespace="http://www.e-clo.pl/ZEFIR2/eZefir2/xsd/v4_0/Trader.xsd" schemaLocation="Trader_Z2.xsd"/>

	<xs:annotation>
		<xs:documentation source="doc" xml:lang="pl">INFORMACJA O DOPŁATACH W GRACH LICZBOWYCH, LOTERIACH PIENIĘŻNYCH I GRZE TELEBINGO</xs:documentation>
		<xs:documentation source="doc" xml:lang="pl">
            Podstawa prawna: Art.82 ustawy z dnia 19 listopada 2009 r. o grach hazardowych (Dz.U. Nr 201, poz.1540), zwanej dalej ”ustawą”.
            Składający: Podmioty urządzające gry liczbowe, loterie pieniężne i grę telebingo.
            Termin składania: Do 10 dnia miesiąca następującego po miesiącu, którego dotyczy rozliczenie (art.82 pkt 1 ustawy).
            Miejsce składania: Naczelnik urzędu skarbowego właściwy zgodnie z art.81 ustawy, zwany dalej „organem”.
            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="GHD1">
		<xs:annotation>
			<xs:documentation source="doc" xml:lang="pl">ELEMENT GŁÓWNY</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Header">
					<xs:annotation>
						<xs:documentation source="doc" xml:lang="pl">NAGłÓWEK DEKLARACJI</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Trader" minOccurs="1" maxOccurs="1">
								<xs:annotation>
									<xs:documentation source="doc" xml:lang="pl">PODMIOT</xs:documentation>
									<xs:documentation source="box">B</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:annotation>
										<xs:documentation>Podstawowy zestaw danych o osobie niefizycznej.</xs:documentation>
									</xs:annotation>
									<xs:sequence>
										<xs:element name="Corporate" minOccurs="1" maxOccurs="1">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="TaxpayerData" type="tr:ZIDCorporateReg">
														<xs:annotation>
															<xs:documentation source="doc" xml:lang="pl">Dane identyfikacyjne</xs:documentation>
															<xs:documentation source="box">B.1</xs:documentation>
														</xs:annotation>
													</xs:element>
													<xs:element name="Residence" type="tr:ZAddress">
														<xs:annotation>
															<xs:documentation source="doc" xml:lang="pl">Adres siedziby</xs:documentation>
															<xs:documentation source="box">B.2</xs:documentation>
														</xs:annotation>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element> 
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="CalculationAmountOfAid" maxOccurs="1" minOccurs="1">
								<xs:annotation>
									<xs:documentation source="doc" xml:lang="pl">OBLICZENIE KWOTY DOPŁAT</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Item" minOccurs="1" maxOccurs="3">
											<xs:annotation>
												<xs:documentation source="doc" xml:lang="pl">Kwota dopłat dla gry</xs:documentation>
											</xs:annotation>
											<xs:complexType>
												<xs:attribute name="typeOfGame" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Rodzaj gry.</xs:documentation>
														<xs:documentation source="box">-</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:string">
															<xs:enumeration value="6">
																<xs:annotation>
																	<xs:documentation>Loterie pieniężne.</xs:documentation>
																</xs:annotation>
															</xs:enumeration>
															<xs:enumeration value="7">
																<xs:annotation>
																	<xs:documentation>Gra telebingo.</xs:documentation>
																</xs:annotation>
															</xs:enumeration>
															<xs:enumeration value="9">
																<xs:annotation>
																	<xs:documentation>Gry liczbowe.</xs:documentation>
																</xs:annotation>
															</xs:enumeration>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="taxBase" type="tp4:ZAmountP" use="optional">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Podstawa dopłaty dla gier liczbowych.</xs:documentation>
														<xs:documentation source="box">20,23,26</xs:documentation>
													</xs:annotation>
												</xs:attribute>
												<xs:attribute name="taxRatePercentage" use="required">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">
                                                            Stawka dopłaty dla gier liczbowych.
														</xs:documentation>
														<xs:documentation source="box">21,24,27</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="xs:decimal">
															<xs:totalDigits value="7"/>
															<xs:fractionDigits value="3"/>
														</xs:restriction>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="amountOfAid" type="tp4:ZAmountP" use="optional">
													<xs:annotation>
														<xs:documentation source="doc" xml:lang="pl">Kwota wyliczonej dopłaty dla gier liczbowych.</xs:documentation>
														<xs:documentation source="box">22,25,28</xs:documentation>
													</xs:annotation>
												</xs:attribute>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
									<xs:attribute name="sum" type="tp4:ZAmountC" use="required">
										<xs:annotation>
											<xs:documentation source="doc" xml:lang="pl">Kwota wyliczonej dopłaty dla gier liczbowych.</xs:documentation>
											<xs:documentation source="box">29</xs:documentation>
										</xs:annotation>
									</xs:attribute>
								</xs:complexType>
							</xs:element>
							<xs:element name="AmountPayable" minOccurs="1" maxOccurs="1">
								<xs:annotation>
									<xs:documentation source="doc" xml:lang="pl">ROZLICZENIE DOPŁAT</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<!-- 
                                                                        <xs:attribute name="totalAmountOfAid" type="tp4:ZAmountP" use="required">
                                                                                <xs:annotation>
                                                                                        <xs:documentation source="doc" xml:lang="pl">Suma wyliczonych kwot dla wszystkich wykazanych rodzajów podatku od gier.</xs:documentation>
                                            <xs:documentation source="box">31</xs:documentation>
                                                                                </xs:annotation>
                                                                        </xs:attribute>
                                    -->
									<xs:attribute name="excessContributSettlementOfPrevDecl" type="tp4:ZAmountP" use="optional">
										<xs:annotation>
											<xs:documentation source="doc" xml:lang="pl">Nadpłata  wpłat  dziennych z ostatnio zło łożonej informacji.</xs:documentation>
											<xs:documentation source="box">30</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="amountOfPaymentsDaily" type="tp4:ZAmountP" use="required">
										<xs:annotation>
											<xs:documentation source="doc" xml:lang="pl">Wpłaty dopłat za okres, którego informacja dotyczy. Suma wpłat dziennych wpłaconych dopłat za okres, którego dotyczy.</xs:documentation>
											<xs:documentation source="box">31</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="amountOfDeductedRemuneration" type="tp4:ZAmountP" use="optional">
										<xs:annotation>
											<xs:documentation source="doc" xml:lang="pl">Kwota potrąconego wynagrodzenia, o którym mowa w art. 28 § 1 ustawy z dnia sierpnia 1997 r. - Ordynacja podatkowa (Dz. U. z 2017 r. poz. 201</xs:documentation>
											<xs:documentation source="box">32</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="toPay" type="tp4:ZAmountP" use="optional">
										<xs:annotation>
											<xs:documentation source="doc" xml:lang="pl">Kwota wyliczana z wartości w polach wg wzoru: „Razem kwota dopłat” – („Nadpłata  wpłat dziennych” + „Wpłaty dzienne”). Jeśli wartość jest ujemna, to powinno być 0.</xs:documentation>
											<xs:documentation source="box">33</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="excessContributSettlement" type="tp4:ZAmountP" use="optional">
										<xs:annotation>
											<xs:documentation source="doc" xml:lang="pl">Nadpłata wpłat do rozliczania w następnym okresie rozliczeniowym. Kwota wyliczana z wartości w polach wg wzoru: („Nadpłata  wpłat dziennych” + „Wpłaty dzienne”) – „Razem”. Jeśli wartość jest ujemna, to powinno być 0.</xs:documentation>
											<xs:documentation source="box">34</xs:documentation>
										</xs:annotation>
									</xs:attribute>
								</xs:complexType>
							</xs:element>
							<xs:element name="Statement" type="tp4:ZExtStatement" minOccurs="1" maxOccurs="1">
								<xs:annotation>
									<xs:documentation source="doc" xml:lang="pl">
                                        Oświadczenie podatnika lub osoby reprezentującej podatnika
									</xs:documentation>
									<xs:documentation source="box">E</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="identifier" type="tp4:ZIdentification" use="required">
							<xs:annotation>
								<xs:documentation source="doc" xml:lang="pl">Pole na wprowadzenie NIP Podatnika.</xs:documentation>
								<xs:documentation source="box">1</xs:documentation>
							</xs:annotation>
						</xs:attribute>
						<xs:attribute name="period" type="tp4:ZPeriod" use="required">
							<xs:annotation>
								<xs:documentation source="doc" xml:lang="pl">Rok i miesiąc, za jaki została złożona deklaracja.</xs:documentation>
								<xs:documentation source="box">4,5</xs:documentation>
							</xs:annotation>
						</xs:attribute>
						<xs:attribute name="taxOffice" type="tp4:ZTaxOffice" use="required">
							<xs:annotation>
								<xs:documentation source="doc" xml:lang="pl">Organ, do którego składana jest deklaracja.</xs:documentation>
								<xs:documentation source="box">6</xs:documentation>
							</xs:annotation>
						</xs:attribute>
						<xs:attribute name="submissionAim" type="tp4: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">7</xs:documentation>
							</xs:annotation>
						</xs:attribute>
						<xs:attribute name="orgDocNo" type="xs:string" 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="tp4: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="ds:Signature" minOccurs="0"/>
			</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>
