<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<xs:element name="ProformaInvoice">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="ProformaInvoiceItem" maxOccurs="unbounded">
					<xs:annotation>
						<xs:documentation>
							Сведения об отгруженных товарах (о выполненных работах, оказанных услугах), переданных имущественных правах
						</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="VatTotal" type="Vat">
								<xs:annotation>
									<xs:documentation>
										Сумма налога, предъявляемая покупателю
									</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="LineNumber" use="required">
							<xs:annotation>
								<xs:documentation>
									Номер строки таблицы
								</xs:documentation>
							</xs:annotation>
							<xs:simpleType>
								<xs:restriction base="xs:integer">
									<xs:totalDigits value="10"/>
								</xs:restriction>
							</xs:simpleType>
						</xs:attribute>
						<xs:attribute name="Product" type="string1000" use="required">
							<xs:annotation>
								<xs:documentation>
									Наименование товара (описание выполненных работ, оказанных услуг), имущественных прав
								</xs:documentation>
							</xs:annotation>
						</xs:attribute>
						<xs:attribute name="SubtotalWithVatExcluded" type="decimal1902" use="required">
							<xs:annotation>
								<xs:documentation>
									Стоимость товаров (работ, услуг), имущественных прав без налога - всего
								</xs:documentation>
							</xs:annotation>
						</xs:attribute>
						<xs:attribute name="TaxRate" use="required">
							<xs:annotation>
								<xs:documentation>
									Налоговая ставка
								</xs:documentation>
							</xs:annotation>
							<xs:simpleType>
								<xs:restriction base="xs:string">
									<xs:enumeration value="0%"/>
									<xs:enumeration value="10%"/>
									<xs:enumeration value="18%"/>
									<xs:enumeration value="20%"/>
									<xs:enumeration value="10/110"/>
									<xs:enumeration value="18/118"/>
									<xs:enumeration value="20/120"/>
									<xs:enumeration value="без НДС"/>
								</xs:restriction>
							</xs:simpleType>
						</xs:attribute>
						<xs:attribute name="Subtotal" type="decimal1902" use="required">
							<xs:annotation>
								<xs:documentation>
									Стоимость товаров (работ, услуг), имущественных прав с налогом - всего
								</xs:documentation>
							</xs:annotation>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
				<xs:element name="Total">
					<xs:annotation>
						<xs:documentation>
							Всего к оплате
						</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="VatTotal" type="Vat">
								<xs:annotation>
									<xs:documentation>
										Сумма налога, предъявляемая покупателю
									</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="GrandTotal" type="decimal1902" use="required">
							<xs:annotation>
								<xs:documentation>
									Итого к оплате, с учетом дополнительных начислений, перерасчетов и оплат
								</xs:documentation>
							</xs:annotation>
						</xs:attribute>
						<xs:attribute name="TotalWithVatExcluded" type="decimal1902" use="required">
							<xs:annotation>
								<xs:documentation>
									Всего к оплате, Стоимость товаров (работ, услуг), имущественных прав без налога - всего
								</xs:documentation>
							</xs:annotation>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		<xs:attribute name="DocumentNumber" type="string1000" use="required">
			<xs:annotation>
				<xs:documentation>НомерДок - номер Счета</xs:documentation>
			</xs:annotation>
		</xs:attribute>

		<xs:attribute name="DocumentDate" use="required">
			<xs:annotation>
				<xs:documentation>ДатДок - Дата счета в формате ДД.ММ.ГГГГ (01.01.1900 - 31.12.2099)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:length value="10"/>
					<xs:pattern value="(((0[1-9]{1}|[1-2]{1}[0-9]{1})\.(0[1-9]{1}|1[0-2]{1}))|((30)\.(01|0[3-9]{1}|1[0-2]{1}))|((31)\.(01|03|05|07|08|10|12)))\.(19[0-9]{2}|20[0-9]{2})"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
</xs:element>

<xs:complexType name="Vat">
	<xs:choice>
		<xs:element name="VatTotal" type="decimal1902"/>
		<xs:element name="WithoutVat" type="empty"/>
	</xs:choice>
</xs:complexType>
<xs:complexType name="empty"></xs:complexType>
<xs:simpleType name="decimal1902">
	<xs:restriction base="xs:decimal">
		<xs:totalDigits value="19"/>
		<xs:fractionDigits value="2"/>
	</xs:restriction>
</xs:simpleType>
<xs:simpleType name="string1000">
	<xs:restriction base="xs:string">
		<xs:minLength value="1"/>
		<xs:maxLength value="1000"/>
	</xs:restriction>
</xs:simpleType>
</xs:schema>