Skip to content

Commit

Permalink
[UPD] Nota Técnica 2017.001 Validação GTIN
Browse files Browse the repository at this point in the history
  • Loading branch information
robmachado committed Dec 17, 2017
1 parent 0f30a75 commit cc4898d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
27 changes: 10 additions & 17 deletions schemes/PL_009_V4/leiauteNFe_v4.00.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<!-- PL_008g alterações de esquema decorrentes da - NT2015.002 - 15/07/2015 -->
<!-- PL_008h alterações de esquema decorrentes da - NT2015.003 - 17/09/2015 -->
<!-- PL_008i -->
<!-- PL_009-v4 alterações de esquema decorrentes da - NT2016.002 - 10/2017 -->
<!-- PL_009-v4a alterações de esquema decorrentes da - NT2017.001 - 10/2017 -->

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.portalfiscal.inf.br/nfe" xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:editix="http://www.portalfiscal.inf.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema_v1.01.xsd"/>
<xs:include schemaLocation="tiposBasico_v4.00.xsd"/>
Expand Down Expand Up @@ -802,7 +805,7 @@ Formato ”CFOP9999”.</xs:documentation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
<xs:pattern value="[0-9]{0}|[0-9]{8}|[0-9]{12,14}"/>
<xs:pattern value="SEM GTIN|[0-9]{0}|[0-9]{8}|[0-9]{12,14}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Expand Down Expand Up @@ -927,7 +930,7 @@ Formato ”CFOP9999”.</xs:documentation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
<xs:pattern value="[0-9]{0}|[0-9]{8}|[0-9]{12,14}"/>
<xs:pattern value="SEM GTIN|[0-9]{0}|[0-9]{8}|[0-9]{12,14}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Expand Down Expand Up @@ -1262,9 +1265,10 @@ Formato ”CFOP9999”.</xs:documentation>
</xs:element>
<xs:element minOccurs="0" name="cAgreg">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="20"/>
</xs:restriction>
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
<xs:pattern value="[0-9]{1,20}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
Expand Down Expand Up @@ -4941,7 +4945,7 @@ Substituição Tributaria;</xs:documentation>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="vPag" type="TDec_1302">
<xs:element name="vPag" type="TDec_1302">
<xs:annotation>
<xs:documentation>Valor do Pagamento. Esta tag poderá ser omitida quando a tag tPag=90 (Sem Pagamento), caso contrário deverá ser preenchida.</xs:documentation>
</xs:annotation>
Expand Down Expand Up @@ -6271,17 +6275,6 @@ alterado para tamanho variavel 1-4. (NT2011/004)</xs:documentation>
<xs:documentation>Tipo: Dados do IPI</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="0" name="clEnq">
<xs:annotation>
<xs:documentation>Classe de Enquadramento do IPI para Cigarros e Bebidas</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="TString">
<xs:minLength value="1"/>
<xs:maxLength value="5"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="CNPJProd" type="TCnpj">
<xs:annotation>
<xs:documentation>CNPJ do produtor da mercadoria, quando diferente do emitente. Somente para os casos de exportação direta ou indireta.</xs:documentation>
Expand Down
11 changes: 10 additions & 1 deletion schemes/PL_009_V4/tiposBasico_v4.00.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@
<xs:pattern value="0(\.[0-9]{2})?|100(\.00)?|[1-9]{1}[0-9]{0,1}(\.[0-9]{2})?"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TDec_0304Max100">
<xs:annotation>
<xs:documentation>Tipo Decimal com 3 inteiros (no máximo 100), com 4 decimais</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
<xs:pattern value="0(\.[0-9]{2})?|100(\.00)?|[1-9]{1}[0-9]{0,1}(\.[0-9]{4})?"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TDec_0302a04Max100">
<xs:annotation>
<xs:documentation>Tipo Decimal com 3 inteiros (no máximo 100), com até 4 decimais</xs:documentation>
Expand Down Expand Up @@ -503,7 +512,7 @@
</xs:annotation>
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
<xs:pattern value="[!-ÿ]{1}[ -ÿ]*[!-ÿ]{1}|[!-ÿ]{1}"/>
<xs:pattern value="[!-ÿ]{1}[ -ÿ]{0,}[!-ÿ]{1}|[!-ÿ]{1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TData">
Expand Down
4 changes: 2 additions & 2 deletions src/Make.php
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ public function tagprod(stdClass $std)
$this->dom->addChild(
$prod,
"cEAN",
$std->cEAN,
!empty($std->cEAN) ? $std->cEAN : 'SEM GTIN',
true,
$identificador . "[item $std->item] GTIN (Global Trade Item Number) do produto, antigo "
. "código EAN ou código de barras",
Expand Down Expand Up @@ -1649,7 +1649,7 @@ public function tagprod(stdClass $std)
$this->dom->addChild(
$prod,
"cEANTrib",
$std->cEANTrib,
!empty($std->cEANTrib) ? $std->cEANTrib : 'SEM GTIN',
true,
$identificador . "[item $std->item] GTIN (Global Trade Item Number) da unidade tributável, antigo "
. "código EAN ou código de barras",
Expand Down

3 comments on commit cc4898d

@eduardokum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boa tarde roberto, esse commit não quebra a compatibilidade com a versão 3.10? depois desse update a versão 3.10 da erro de validação do XML por conta do "SEM GTIN" não ser aceito para o padrão:

<xs:element name="cEAN">
	<xs:annotation>
		<xs:documentation>GTIN (Global Trade Item Number) do produto, antigo código EAN ou código de barras</xs:documentation>
	</xs:annotation>
	<xs:simpleType>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:pattern value="[0-9]{0}|[0-9]{8}|[0-9]{12,14}"/>
		</xs:restriction>
	</xs:simpleType>
</xs:element>

@robmachado
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ups !! bem lembrado, vou verificar isso !

@robmachado
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AJUSTADO !!! Obrigado Edu passou batido como estou testando o 4.00 nem percebi isso !! VALEU 👍

Please sign in to comment.