PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
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
Started by amarildo, Feb., 16 2017 11:31 AM - No answer
Connect yourself…
amarildo
#1
Registered member
535 messages
Popularité : +14 (14 votes)
Posted on February, 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
Message modified, February, 16 2017 - 11:38 AM
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text