GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 25
→
Aula 1067 - Windev - Xml 9/... - Ler um Xml de Nota Fiscal Eletronica
Aula 1067 - Windev - Xml 9/... - Ler um Xml de Nota Fiscal Eletronica
Iniciado por amarildo, fev., 16 2017 11:31 AM - Sem resposta
Conecte-se…
amarildo
#1
Membro registado
535 mensagems
Popularité : +14 (14 votes)
Publicado em fevereiro, 16 2017 - 11:31 AM
//Ler um Xml de Nota Fiscal Eletronica
//Pegar Numero da Nota e data emissao
//Pegar dados dos Itens dos Produtos
//Ler Xml, Colocar dados e Preencher tabela com Produtos
xml_nfe
is
a
xmlDocument
=
XMLOpen
(
edT_xml
,
fromString
)
Trace
(
"Operacao:"
+
xml_nfe.NFe.infNFe.natOp
)
//Mostrar na Tela natOp
Trace
(
"Emitente:"
+
xml_nfe.NFe.infNFe.emit.xNome
)
Trace
(
"infnfe Id:"
+
xml_nfe.NFe.infNFe
..
Attribut
[
1
]
)
Trace
(
"infnfe Versao:"
+
xml_nfe.NFe.infNFe
..
Attribut
[
2
]
)
SAI_
NumeroNota
=
xml_nfe.NFe.infNFe.ide.nNF
_data_string
is string
=
xml_nfe.NFe.infNFe.ide.dhEmi
_data
is
Date
=
""
_data
..
Year
=
_data_string
[
[
1
TO
4
]
]
_data
..
Month
=
_data_string
[
[
6
TO
7
]
]
_data
..
Day
=
_data_string
[
[
9
TO
10
]
]
SAI_
data_emissao
=
_data
TableDeleteAll
(
TABLE_
itens_nota
)
// Limpa Tabela
det
is xmlNode
FOR
E
ACH det OF xml_nfe.NFe.infNFe on det
Trace
(
"ocor"
+
det
..
Occurrence
)
// Quantos itens tem
Trace
(
"nItem"
+
det
..
Attribut
[
1
]
)
// Mostrar o que tem nItem
Trace
(
"Imposto vTotTrib:"
+
det.imposto.vTotTrib
)
Trace
(
"Produto:"
+
det.prod.xProd
)
TableAddLine
(
TABLE_
itens_nota
)
// Adicionando a tabela
n
_ocorrencia
is int
=
TABLE_
itens_nota
..
Occurrence
//vou ter o numero atual linha tabela
TABLE_
itens_nota.COL_Iten
[
n
_ocorrencia
]
=
det
..
Attribut
[
1
]
TABLE_
itens_nota.COL_Produto
[
n
_ocorrencia
]
=
det.prod.xProd
TABLE_
itens_nota.COL_Valor_Tributo
[
n
_ocorrencia
]
=
det.imposto.vTotTrib
END
~
//<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
//<infNFe Id="NFe43161203850874000126550010000036321000145288" versao="3.10">
//<ide>
//<cUF>43</cUF>
//<cNF>00014528</cNF>
//<natOp>5.101 Venda de producao do estabelecimento</natOp>
//<indPag>0</indPag>
//<mod>55</mod>
//<serie>1</serie>
//<nNF>3632</nNF>
//<dhEmi>2016-12-08T10:06:14-02:00</dhEmi>
//</ide>
//<emit>
//<CNPJ>03850874000126</CNPJ>
//<xNome>Nh_MATOS INFORMATICA-SIMPLES</xNome>
//<xFant>JAIRO B. RIBEIRO 03850874000126</xFant>
//</emit>
//<dest>
//<CNPJ>89184238000128</CNPJ>
//<xNome>NF-E EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL</xNome>
//</dest>
//<det nItem="1">
//<prod>
//<cProd>1</cProd>
//<cEAN/>
//<xProd>A MATERIAL TESTE-codigo 1</xProd>
//</prod>
//<imposto>
//<vTotTrib>4.76</vTotTrib>
//</imposto>
//</det>
//<det nItem="2">
//<prod>
//<cProd>2</cProd>
//<cEAN/>
//<xProd>AMANGUEIRAx</xProd>
//</prod>
//<imposto>
//<vTotTrib>3.46</vTotTrib>
//</imposto>
//</det>
//<total>
//<ICMSTot>
//<vBC>0.00</vBC>
//<vICMS>0.00</vICMS>
//</total>
//<infAdic>
//<infCpl>DOCUMENTO ICM CODIGO 1</infCpl>
//</infAdic>
//</infNFe>
//</NFe>
//
http://windevdesenvolvimento.blogspot.com.br/2017/02/aula-1067-windev-xml-9-ler-um-xml-de.html
Mensagem modificada, fevereiro, 16 2017 - 11:38 AM
Denunciar
0
0
→ Voltar para WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto