Invoice.xsd

Материал из Фабиус wiki
Перейти к: навигация, поиск

<?xml version="1.0" encoding="utf-8"?>

<xsd:schema id="Document-Invoice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:include schemaLocation="common/simpleTypes/CountryISOCode.xsd"/>
 <xsd:include schemaLocation="common/simpleTypes/CurrencyISOCode.xsd"/>
 <xsd:include schemaLocation="common/simpleTypes/CustomsDeclarationNumber.xsd"/>
 <xsd:include schemaLocation="common/simpleTypes/GlobalLocationNumber.xsd"/>
 <xsd:include schemaLocation="common/simpleTypes/GlobalTradeItemIdentification.xsd"/>
 <xsd:include schemaLocation="common/simpleTypes/Money.xsd"/>
 <xsd:include schemaLocation="common/simpleTypes/VATRate.xsd"/>
 <xsd:include schemaLocation="common/Contractor.xsd"/>
 <xsd:include schemaLocation="common/simpleTypes/UnitOfMeasure.xsd"/>
 <xsd:element name="Document-Invoice"  type="DocumentInvoice"/>
 <xsd:complexType name="DocumentInvoice">
   <xsd:sequence>
     <xsd:element name="Invoice-Header">
       <xsd:complexType>
         <xsd:sequence>
           <xsd:element name="InvoiceNumber">
             <xsd:annotation>
               <xsd:documentation>Номер счёта</xsd:documentation>
             </xsd:annotation>
             <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                 <xsd:minLength value="1"/>
                 <xsd:maxLength value="15"/>
               </xsd:restriction>
             </xsd:simpleType>
           </xsd:element>
           <xsd:element name="InvoiceDate" type="xsd:string">
             <xsd:annotation>
               <xsd:documentation>Дата счёта CCYY-MM-DD</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="InvoiceCurrency" type="CurrencyISOCodeType">
             <xsd:annotation>
               <xsd:documentation>3-х буквенный код валют (вероятно согласно ISO-4217)</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="InvoicePaymentDueDate" type="xsd:string" minOccurs="0">
             <xsd:annotation>
               <xsd:documentation>Срок оплаты счёта</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="ContractNumber" minOccurs="0">
             <xsd:annotation>
               <xsd:documentation>Номер связанного договора</xsd:documentation>
             </xsd:annotation>
             <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                 <xsd:minLength value="1"/>
                 <xsd:maxLength value="16"/>
               </xsd:restriction>
             </xsd:simpleType>
           </xsd:element>
           <xsd:element name="ContractDate" type="xsd:string"  minOccurs="0">
             <xsd:annotation>
               <xsd:documentation>Дата связанного договора CCYY-MM-DD</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="DocumentFunctionCode" fixed="O">
             <xsd:annotation>
               <xsd:documentation>Идентификатор типа документа: O-оригинал, R-замена, C-коррекция, P-предложение, D-отмена, A-подтверждение</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="Remarks" minOccurs="0">
             <xsd:annotation>
               <xsd:documentation>Текстовый комментарий длиной 128 символов</xsd:documentation>
             </xsd:annotation>
             <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                 <xsd:minLength value="1"/>
                 <xsd:maxLength value="128"/>
               </xsd:restriction>
             </xsd:simpleType>
           </xsd:element>
           <xsd:element name="Order">
             <xsd:annotation>
               <xsd:documentation>Информация о связанном  заказе</xsd:documentation>
             </xsd:annotation>
             <xsd:complexType>
               <xsd:sequence>
                 <xsd:element name="BuyerOrderNumber">
                   <xsd:annotation>
                     <xsd:documentation>Номер связанного заказа</xsd:documentation>
                   </xsd:annotation>
                   <xsd:simpleType>
                     <xsd:restriction base="xsd:string">
                       <xsd:minLength value="1"/>
                       <xsd:maxLength value="16"/>
                     </xsd:restriction>
                   </xsd:simpleType>
                 </xsd:element>
                 <xsd:element name="BuyerOrderDate" type="xsd:string">
                   <xsd:annotation>
                     <xsd:documentation>Дата связанного заказа CCYY-MM-DD</xsd:documentation>
                   </xsd:annotation>
                 </xsd:element>
               </xsd:sequence>
             </xsd:complexType>
           </xsd:element>
           <xsd:element name="Delivery">
             <xsd:annotation>
               <xsd:documentation>Информация о доставке</xsd:documentation>
             </xsd:annotation>
             <xsd:complexType>
               <xsd:sequence>
                 <xsd:element name="DeliveryLocationNumber" type="GlobalLocationNumberType" minOccurs="0">
                   <xsd:annotation>
                     <xsd:documentation>Видимо gln места доставки</xsd:documentation>
                   </xsd:annotation>
                 </xsd:element>
                 <xsd:element name="Name" type="xsd:string" minOccurs="0">
                   <xsd:annotation>
                     <xsd:documentation>Непонятное название, может что-то наподобие кода места доставки в системе поставщика</xsd:documentation>
                   </xsd:annotation>
                 </xsd:element>
                 <xsd:element name="DeliveryDate" type="xsd:string" minOccurs="0">
                   <xsd:annotation>
                     <xsd:documentation>Дата уведомления об отгрузке  CCYY-MM-DD</xsd:documentation>
                   </xsd:annotation>
                 </xsd:element>
                 <xsd:element name="DeliveryNoteNumber" minOccurs="0">
                   <xsd:annotation>
                     <xsd:documentation>Номер уведомления об отгрузке (совпадает с номером накладной)</xsd:documentation>
                   </xsd:annotation>
                   <xsd:simpleType>
                     <xsd:restriction base="xsd:string">
                       <xsd:minLength value="1"/>
                       <xsd:maxLength value="10"/>
                     </xsd:restriction>
                   </xsd:simpleType>
                 </xsd:element>
                 <xsd:element name="DespatchNumber" type="xsd:string" minOccurs="0">
                   <xsd:annotation>
                     <xsd:documentation>Непонятный номер, вероятно номер отгрузки</xsd:documentation>
                   </xsd:annotation>
                 </xsd:element>
                 <xsd:element name="ReceivingAdviceNumber" minOccurs="0">
                   <xsd:annotation>
                     <xsd:documentation>Номер уведомления о приемке</xsd:documentation>
                   </xsd:annotation>
                   <xsd:simpleType>
                     <xsd:restriction base="xsd:string">
                       <xsd:minLength value="1"/>
                       <xsd:maxLength value="10"/>
                     </xsd:restriction>
                   </xsd:simpleType>
                 </xsd:element>
               </xsd:sequence>
             </xsd:complexType>
           </xsd:element>
         </xsd:sequence>
       </xsd:complexType>
     </xsd:element>
     <xsd:element name="Document-Parties" minOccurs="0">
       <xsd:annotation>
         <xsd:documentation>Информация о получателе и отправителе сообщения</xsd:documentation>
       </xsd:annotation>
       <xsd:complexType>
         <xsd:sequence>
           <xsd:element name ="Sender">
             <xsd:annotation>
               <xsd:documentation>Информация об отправителе</xsd:documentation>
             </xsd:annotation>
             <xsd:complexType>
               <xsd:sequence>
                 <xsd:element name="ILN" type="GlobalLocationNumberType">
                   <xsd:annotation>
                     <xsd:documentation>gln отправителя</xsd:documentation>
                   </xsd:annotation>
                 </xsd:element>
               </xsd:sequence>
             </xsd:complexType>
           </xsd:element>
           <xsd:element name="Receiver">
             <xsd:annotation>
               <xsd:documentation>Информация о получателе</xsd:documentation>
             </xsd:annotation>
             <xsd:complexType>
               <xsd:sequence>
                 <xsd:element name="ILN" type="GlobalLocationNumberType">
                   <xsd:annotation>
                     <xsd:documentation>gln получателя</xsd:documentation>
                   </xsd:annotation>
                 </xsd:element>
               </xsd:sequence>
             </xsd:complexType>
           </xsd:element>
         </xsd:sequence>
       </xsd:complexType>
     </xsd:element>
     <xsd:element name="Invoice-Parties">
       <xsd:complexType>
         <xsd:sequence>
           <xsd:element name="Buyer" type="ContractorType">
             <xsd:annotation>
               <xsd:documentation>Информация о покупателе</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="Seller" type="ContractorType">
             <xsd:annotation>
               <xsd:documentation>Информация о поставщике</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="DeliveryPoint" type="ContractorType">
             <xsd:annotation>
               <xsd:documentation>Информация о месте доставки (грузополучатель)</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="Consignor" type="ContractorType">
             <xsd:annotation>
               <xsd:documentation>Информация о грузоотправителе</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
         </xsd:sequence>
       </xsd:complexType>
     </xsd:element>
     <xsd:element name="Invoice-Lines">
       <xsd:complexType>
         <xsd:sequence>
           <xsd:element name="Line" maxOccurs="unbounded">
             <xsd:complexType>
               <xsd:sequence>
                 <xsd:element name="Line-Item">
                   <xsd:complexType>
                     <xsd:sequence>
                       <xsd:element name="LineNumber" type="xsd:string">
                         <xsd:annotation>
                           <xsd:documentation>Порядковый номер товарной позиции (номер строки)</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="EAN" type="GlobalTradeItemIdentificationType">
                         <xsd:annotation>
                           <xsd:documentation>GTIN товара</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="BuyerItemCode" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Код, присвоенный покупателем</xsd:documentation>
                         </xsd:annotation>
                         <xsd:simpleType>
                           <xsd:restriction base="xsd:string">
                             <xsd:minLength value="1"/>
                             <xsd:maxLength value="15"/>
                           </xsd:restriction>
                         </xsd:simpleType>
                       </xsd:element>
                       <xsd:element name="SupplierItemCode" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Внутренний код поставщика</xsd:documentation>
                         </xsd:annotation>
                         <xsd:simpleType>
                           <xsd:restriction base="xsd:string">
                             <xsd:minLength value="1"/>
                             <xsd:maxLength value="14"/>
                           </xsd:restriction>
                         </xsd:simpleType>
                       </xsd:element>
                       <xsd:element name="ItemDescription" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Название (описание) товара</xsd:documentation>
                         </xsd:annotation>
                         <xsd:simpleType>
                           <xsd:restriction base="xsd:string">
                             <xsd:minLength value="1"/>
                             <xsd:maxLength value="70"/>
                           </xsd:restriction>
                         </xsd:simpleType>
                       </xsd:element>
                       <xsd:element name="InvoiceQuantity">
                         <xsd:annotation>
                           <xsd:documentation>Количество</xsd:documentation>
                         </xsd:annotation>
                         <xsd:simpleType>
                           <xsd:restriction base="xsd:decimal">
                             <xsd:fractionDigits value="3"/>
                             <xsd:totalDigits value="15"/>
                           </xsd:restriction>
                         </xsd:simpleType>
                       </xsd:element>
                       <xsd:element name="UnitOfMeasure" type="UnitOfMeasureType" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Единица измерения товаров</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="InvoiceUnitNetPrice" type="MoneyType" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Цена за единицу без НДС</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="InvoiceUnitGrossPrice" type="MoneyType" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Цена за единицу с НДС</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="InvoiceUnitPriceBasis" type="xsd:string" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Видимо количество штук товара в продаваемой единице</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="CountryOfOriginCode" type="CountryISOCodeType" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Буквенный код страны, согласно ISO alpha-2</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="TaxRate" type="VATRateType" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Ставка НДС (0, 10 ,18)</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="TaxCategoryCode" fixed="S" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Идентификатор типа ставки налога, S - стандартная ставка</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="TaxAmount" type="MoneyType" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Суммарно НДС по позиции</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="NetAmount" type="MoneyType" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Суммарная стоимость по позиции без НДС</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="GrossAmount" type="MoneyType" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Суммарная стоимость по позиции с НДС</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                     </xsd:sequence>
                   </xsd:complexType>
                 </xsd:element>  
               </xsd:sequence>
             </xsd:complexType>
           </xsd:element>
         </xsd:sequence>
       </xsd:complexType>
     </xsd:element>
     <xsd:element name="Invoice-Summary">
       <xsd:complexType>
         <xsd:sequence>
           <xsd:element name="TotalLines" type="xsd:decimal">
             <xsd:annotation>
               <xsd:documentation>Количество строк</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="TotalInvoicedAmount" type="xsd:decimal" minOccurs="0">
             <xsd:annotation>
               <xsd:documentation>Общее количество единиц товара</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="TotalNetAmount" type="MoneyType">
             <xsd:annotation>
               <xsd:documentation>Общая сумма без НДС по счёту</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="TotalTaxableBasis" type="MoneyType" minOccurs="0">
             <xsd:annotation>
               <xsd:documentation>Итоговая сумма, облагаемая НДС</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="TotalTaxAmount" type="MoneyType">
             <xsd:annotation>
               <xsd:documentation>Общая сумма только НДС по счёту</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="TotalGrossAmount" type="MoneyType">
             <xsd:annotation>
               <xsd:documentation>Общая сумма с НДС по счёту</xsd:documentation>
             </xsd:annotation>
           </xsd:element>
           <xsd:element name="Tax-Summary">
             <xsd:annotation>
               <xsd:documentation>Указываются суммы по счёту для каждой ставки НДС в отдельности (например, в счёте есть ставки 10% и 18% НДС, то должно быть 2 блока Tax-Summary)</xsd:documentation>
             </xsd:annotation>
             <xsd:complexType>
               <xsd:sequence>
                 <xsd:element name="Tax-Summary-Line">
                   <xsd:complexType>
                     <xsd:sequence>
                       <xsd:element name="TaxRate" type="VATRateType">
                         <xsd:annotation>
                           <xsd:documentation>Ставка НДС (0,10,18)</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="TaxCategoryCode" fixed="S" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Идентификатор типа ставки налога, S - стандартная ставка</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="TaxAmount" type="MoneyType">
                         <xsd:annotation>
                           <xsd:documentation>Общая сумма НДС по счёту для указанной ставки</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="TaxableBasis" type="MoneyType" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Сумма по счёту, которая облагается НДС по указанной ставке</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="TaxableAmount" type="MoneyType" minOccurs="0">
                         <xsd:annotation>
                           <xsd:documentation>Облагаемая налогом сумма по данной ставке</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                       <xsd:element name="GrossAmount" type="MoneyType">
                         <xsd:annotation>
                           <xsd:documentation>Общая сумма с НДС по счёту по данной ставке</xsd:documentation>
                         </xsd:annotation>
                       </xsd:element>
                     </xsd:sequence>
                   </xsd:complexType>
                 </xsd:element>              
               </xsd:sequence>
             </xsd:complexType>
           </xsd:element>
         </xsd:sequence>
       </xsd:complexType>
     </xsd:element>
   </xsd:sequence>
 </xsd:complexType>
</xsd:schema>

Смотрите также

Invoice.xml