<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.esocial.gov.br/schema/evt/evtComProd/v02_04_01" targetNamespace="http://www.esocial.gov.br/schema/evt/evtComProd/v02_04_01" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
  <xs:element name="eSocial">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="evtComProd">
          <xs:annotation>
            <xs:documentation>Evento Comercialização da Produção Rural Pessoa Física</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ideEvento" type="TIdeEveFopagMensal">
                <xs:annotation>
                  <xs:documentation>Informações de identificação do evento</xs:documentation>
                </xs:annotation>
              </xs:element>
              <xs:element name="ideEmpregador">
                <xs:annotation>
                  <xs:documentation>Informações de identificação do empregador</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="tpInsc">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Tipo de Inscrição, conforme tabela 5.</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:byte">
                          <xs:pattern value="\d"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="nrInsc">
                      <xs:simpleType>
                        <xs:annotation>
                          <xs:documentation>Número de Inscrição</xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                          <xs:pattern value="\d{8,15}"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="infoComProd">
                <xs:annotation>
                  <xs:documentation>Informação da Comercialização de Produção</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="ideEstabel">
                      <xs:annotation>
                        <xs:documentation>Identificação do estabelecimento que comercializou a produção</xs:documentation>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="nrInscEstabRural">
                            <xs:simpleType>
                              <xs:annotation>
                                <xs:documentation>Número de Inscrição</xs:documentation>
                              </xs:annotation>
                              <xs:restriction base="xs:string">
                                <xs:pattern value="\d{11,15}"/>
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                          <xs:element name="tpComerc" maxOccurs="4">
                            <xs:annotation>
                              <xs:documentation>Registro que apresenta o valor total da comercialização por "tipo" de comercialização</xs:documentation>
                            </xs:annotation>
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="indComerc">
                                  <xs:simpleType>
                                    <xs:annotation>
                                      <xs:documentation>Indicativo de Comercialização</xs:documentation>
                                    </xs:annotation>
                                    <xs:restriction base="xs:byte">
                                      <xs:pattern value="\d"/>
                                    </xs:restriction>
                                  </xs:simpleType>
                                </xs:element>
                                <xs:element name="vrTotCom">
                                  <xs:simpleType>
                                    <xs:annotation>
                                      <xs:documentation>Valor Total da Comercialização.</xs:documentation>
                                    </xs:annotation>
                                    <xs:restriction base="xs:decimal">
                                      <xs:totalDigits value="14"/>
                                      <xs:fractionDigits value="2"/>
                                    </xs:restriction>
                                  </xs:simpleType>
                                </xs:element>
                                <xs:element name="ideAdquir" minOccurs="0" maxOccurs="9999">
                                  <xs:annotation>
                                    <xs:documentation>Identificação dos Adquirentes da Produção.</xs:documentation>
                                  </xs:annotation>
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element name="tpInsc">
                                        <xs:simpleType>
                                          <xs:annotation>
                                            <xs:documentation>Tipo de Inscrição, conforme tabela 5.</xs:documentation>
                                          </xs:annotation>
                                          <xs:restriction base="xs:byte">
                                            <xs:pattern value="\d"/>
                                          </xs:restriction>
                                        </xs:simpleType>
                                      </xs:element>
                                      <xs:element name="nrInsc">
                                        <xs:simpleType>
                                          <xs:annotation>
                                            <xs:documentation>Número de Inscrição</xs:documentation>
                                          </xs:annotation>
                                          <xs:restriction base="xs:string">
                                            <xs:pattern value="\d{8,15}"/>
                                          </xs:restriction>
                                        </xs:simpleType>
                                      </xs:element>
                                      <xs:element name="vrComerc">
                                        <xs:simpleType>
                                          <xs:annotation>
                                            <xs:documentation>Valor Bruto da Comercialização</xs:documentation>
                                          </xs:annotation>
                                          <xs:restriction base="xs:decimal">
                                            <xs:totalDigits value="14"/>
                                            <xs:fractionDigits value="2"/>
                                          </xs:restriction>
                                        </xs:simpleType>
                                      </xs:element>
                                      <xs:element name="nfs" minOccurs="0" maxOccurs="999">
                                        <xs:annotation>
                                          <xs:documentation>Detalhamento das notas fiscais relativas à comercialização de produção com o adquirente identificado no registro superior.</xs:documentation>
                                        </xs:annotation>
                                        <xs:complexType>
                                          <xs:sequence>
                                            <xs:element name="serie" minOccurs="0">
                                              <xs:simpleType>
                                                <xs:annotation>
                                                  <xs:documentation>Série da Nota Fiscal/Fatura</xs:documentation>
                                                </xs:annotation>
                                                <xs:restriction base="xs:string">
                                                  <xs:minLength value="1"/>
                                                  <xs:maxLength value="5"/>
                                                </xs:restriction>
                                              </xs:simpleType>
                                            </xs:element>
                                            <xs:element name="nrDocto">
                                              <xs:simpleType>
                                                <xs:annotation>
                                                  <xs:documentation>Número da NF/Fatura</xs:documentation>
                                                </xs:annotation>
                                                <xs:restriction base="xs:string">
                                                  <xs:minLength value="1"/>
                                                  <xs:maxLength value="20"/>
                                                </xs:restriction>
                                              </xs:simpleType>
                                            </xs:element>
                                            <xs:element name="dtEmisNF">
                                              <xs:simpleType>
                                                <xs:annotation>
                                                  <xs:documentation>Data de Emissão da Nota Fiscal/Fatura</xs:documentation>
                                                </xs:annotation>
                                                <xs:restriction base="xs:date">
                                                </xs:restriction>
                                              </xs:simpleType>
                                            </xs:element>
                                            <xs:element name="vlrBruto">
                                              <xs:simpleType>
                                                <xs:annotation>
                                                  <xs:documentation>Valor bruto</xs:documentation>
                                                </xs:annotation>
                                                <xs:restriction base="xs:decimal">
                                                  <xs:totalDigits value="14"/>
                                                  <xs:fractionDigits value="2"/>
                                                </xs:restriction>
                                              </xs:simpleType>
                                            </xs:element>
                                            <xs:element name="vrCPDescPR">
                                              <xs:simpleType>
                                                <xs:annotation>
                                                  <xs:documentation>Valor da Contribuição Previdenciária descontada pelo adquirente</xs:documentation>
                                                </xs:annotation>
                                                <xs:restriction base="xs:decimal">
                                                  <xs:totalDigits value="14"/>
                                                  <xs:fractionDigits value="2"/>
                                                </xs:restriction>
                                              </xs:simpleType>
                                            </xs:element>
                                            <xs:element name="vrRatDescPR">
                                              <xs:simpleType>
                                                <xs:annotation>
                                                  <xs:documentation>Valor da GILRAT incidente sobre a aquisição de produção rural de produtor rural pessoa física.</xs:documentation>
                                                </xs:annotation>
                                                <xs:restriction base="xs:decimal">
                                                  <xs:totalDigits value="14"/>
                                                  <xs:fractionDigits value="2"/>
                                                </xs:restriction>
                                              </xs:simpleType>
                                            </xs:element>
                                            <xs:element name="vrSenarDesc">
                                              <xs:simpleType>
                                                <xs:annotation>
                                                  <xs:documentation>Valor da contribuição destinada ao SENAR</xs:documentation>
                                                </xs:annotation>
                                                <xs:restriction base="xs:decimal">
                                                  <xs:totalDigits value="14"/>
                                                  <xs:fractionDigits value="2"/>
                                                </xs:restriction>
                                              </xs:simpleType>
                                            </xs:element>
                                          </xs:sequence>
                                        </xs:complexType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element name="infoProcJud" minOccurs="0" maxOccurs="10">
                                  <xs:annotation>
                                    <xs:documentation>Informações de Processos Judiciais com decisão/sentença favorável ao contribuinte e relativos à contribuição incidente sobre a comercialização.</xs:documentation>
                                  </xs:annotation>
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element name="tpProc">
                                        <xs:simpleType>
                                          <xs:annotation>
                                            <xs:documentation>Tipo de Processo</xs:documentation>
                                          </xs:annotation>
                                          <xs:restriction base="xs:byte">
                                            <xs:pattern value="\d"/>
                                          </xs:restriction>
                                        </xs:simpleType>
                                      </xs:element>
                                      <xs:element name="nrProc">
                                        <xs:simpleType>
                                          <xs:annotation>
                                            <xs:documentation>Número do Processo</xs:documentation>
                                          </xs:annotation>
                                          <xs:restriction base="xs:string">
                                            <xs:minLength value="1"/>
                                            <xs:maxLength value="20"/>
                                          </xs:restriction>
                                        </xs:simpleType>
                                      </xs:element>
                                      <xs:element name="codSusp">
                                        <xs:simpleType>
                                          <xs:annotation>
                                            <xs:documentation>Código do Indicativo da Suspensão</xs:documentation>
                                          </xs:annotation>
                                          <xs:restriction base="xs:integer">
                                            <xs:pattern value="\d{1,14}"/>
                                          </xs:restriction>
                                        </xs:simpleType>
                                      </xs:element>
                                      <xs:element name="vrCPSusp" minOccurs="0">
                                        <xs:simpleType>
                                          <xs:annotation>
                                            <xs:documentation>Valor da Contribuição Previdenciária com exigibilidade suspensa.</xs:documentation>
                                          </xs:annotation>
                                          <xs:restriction base="xs:decimal">
                                            <xs:totalDigits value="14"/>
                                            <xs:fractionDigits value="2"/>
                                          </xs:restriction>
                                        </xs:simpleType>
                                      </xs:element>
                                      <xs:element name="vrRatSusp" minOccurs="0">
                                        <xs:simpleType>
                                          <xs:annotation>
                                            <xs:documentation>Valor da contribuição para Gilrat com exigibilidade suspensa.</xs:documentation>
                                          </xs:annotation>
                                          <xs:restriction base="xs:decimal">
                                            <xs:totalDigits value="14"/>
                                            <xs:fractionDigits value="2"/>
                                          </xs:restriction>
                                        </xs:simpleType>
                                      </xs:element>
                                      <xs:element name="vrSenarSusp" minOccurs="0">
                                        <xs:simpleType>
                                          <xs:annotation>
                                            <xs:documentation>Valor da contribuição para o Senar com exigibilidade suspensa.</xs:documentation>
                                          </xs:annotation>
                                          <xs:restriction base="xs:decimal">
                                            <xs:totalDigits value="14"/>
                                            <xs:fractionDigits value="2"/>
                                          </xs:restriction>
                                        </xs:simpleType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="Id" type="xs:ID" use="required"/>
          </xs:complexType>
        </xs:element>
        <xs:element ref="ds:Signature"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="TIdeEveFopagMensal">
    <xs:annotation>
      <xs:documentation>Identificação do Evento Periódico</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="indRetif">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Indicativo de Retificação</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:byte">
            <xs:pattern value="\d"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="nrRecibo" minOccurs="0">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Recibo arquivo a ser retificado</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
            <xs:maxLength value="40"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="indApuracao">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Indicativo de período de apuração:
            1 - Mensal.</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:byte">
            <xs:pattern value="\d"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="perApur">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Período ao qual se referem as informações.</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:minLength value="4"/>
            <xs:maxLength value="7"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="tpAmb">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Tipo de ambiente</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:byte">
            <xs:pattern value="\d"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="procEmi">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Processo de emissão do evento</xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:byte">
            <xs:pattern value="\d"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="verProc">
        <xs:simpleType>
          <xs:annotation>
            <xs:documentation>Versão do processo de emissão do evento. </xs:documentation>
          </xs:annotation>
          <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
            <xs:maxLength value="20"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema>
