FONTE NFE VB.NET

KILLER 13/04/2010 10:31:07
#339177
pessoal eu acho que o erro está no xml de retorno da versao 2.00

<?xml version=[Ô]1.0[Ô] encoding=[Ô]utf-8[Ô]?>
<consReciNFe xmlns=[Ô]http://www.portalfiscal.inf.br/nfe[Ô] versao=[Ô]2.00[Ô]>
<tpAmb>2</tpAmb>
<nRec>310000008554999</nRec>
</consReciNFe>

faca assim mesmo?
OTAVIOFAVERO 13/04/2010 12:48:52
#339197
alguem ja conseguiu selecionar certificado digital em formato A3???

alguem pode me ajudar???
KILLER 13/04/2010 15:59:43
#339216
pessoal consegui

obrigado pela atenção
DUHHH 16/04/2010 11:53:24
#339592
Quem tiver com alguma duvida posta que eu ajudo. Um cara pediu o codigo de como faço as coisas enviei a ele.
KILLER 20/04/2010 08:32:14
#339760
ai pessoal alguém sabe como fazer para quando der erro de validação avisar o usuário o que ele deve modificar,
por enquanto só fala a linha do erro, quero que avise que o erro é por exemplo no CNPJ, para ficar mais fácil de arrumar
parecido com o UniNFe faz

vlw
DANIELCPAETE 20/04/2010 08:48:02
#339761
Amigo se estiver usando o exemplo que coloquei a aqui no forum de uma olhada nesta rotina dentro do modulo de validação

    Private Sub reader_ValidationEventHandler(ByVal sender As Object, ByVal e As ValidationEventArgs)
Erro = (([Ô]Linha: [Ô] & e.Exception.LineNumber & [Ô] Coluna: [Ô]) + e.Exception.LinePosition & [Ô] Erro: [Ô]) + e.Exception.Message & vbCr & vbLf
End Sub


Aqui vem o nome do campo que possui erro é só tratar esta mensagem.
e.Exception.Message
KILLER 20/04/2010 09:19:06
#339768
vlw daniel vou dar uma olhada
GERSON 24/04/2010 20:03:43
#340142
Daniel,

Estou enviando um modelo de geração do xml na versão 2.0. Peguei esse exemplo e dei uma melhorada.

Agora eu estou precisando que alguém me ajude como passar um parâmetro para URL do Web Service. Olhei o do nosso amigo Looze e a lógica é adicionar Web Service para cada Estado e módulos. Eu queria uma ideia que fosse dinâmico.

Olhei o seu fonte e vi que vc colocou fixo a me.URL da classe web service, tem algum jeito de passar por parâmetros.

----------------
Public Class Cls_GerarXML20
Private dsNFe As New DataSet
Public _TotaisIndice As String

#Region [Ô]Variaveis para gerar a NF-e[Ô]
[ô]Objetos do tipo Datarow que representão
[ô]Novas linhas no dataset Carregado com o Schema XSD da Versão 2.00
[ô]da Nota Fiscal Eletronica
[ô]Com essas Datarow's manipulo os dados Indexando e inserindo valores
[ô]separadamente por Tabelas.Após as principais tabelas serem preenchidas
[ô]corretamente adiono as novas linhas ao dataset e gero um XML atravês dele.
[ô]
[ô]
[ô]
[ô]

Dim drNFe As DataRow = dsNFe.Tables([Ô]NFe[Ô]).NewRow
Dim drInfNfe As DataRow = dsNFe.Tables([Ô]InfNFe[Ô]).NewRow
Dim drNFref As DataRow = dsNFe.Tables([Ô]NFref[Ô]).NewRow
Dim dride As DataRow = dsNFe.Tables([Ô]ide[Ô]).NewRow
Dim dremit As DataRow = dsNFe.Tables([Ô]emit[Ô]).NewRow
Dim drenderEmit As DataRow = dsNFe.Tables([Ô]enderEmit[Ô]).NewRow
Dim drdest As DataRow = dsNFe.Tables([Ô]dest[Ô]).NewRow
Dim drenderDest As DataRow = dsNFe.Tables([Ô]enderDest[Ô]).NewRow
Dim drdet As DataRow = dsNFe.Tables([Ô]det[Ô]).NewRow
Dim drprod As DataRow = dsNFe.Tables([Ô]prod[Ô]).NewRow
Dim drmed As DataRow = dsNFe.Tables([Ô]med[Ô]).NewRow
Dim drarma As DataRow = dsNFe.Tables([Ô]arma[Ô]).NewRow
Dim drcomb As DataRow = dsNFe.Tables([Ô]comb[Ô]).NewRow
Dim drICMS00 As DataRow = dsNFe.Tables([Ô]ICMS00[Ô]).NewRow
Dim drICMS10 As DataRow = dsNFe.Tables([Ô]ICMS10[Ô]).NewRow
Dim drICMS20 As DataRow = dsNFe.Tables([Ô]ICMS20[Ô]).NewRow
Dim drICMS30 As DataRow = dsNFe.Tables([Ô]ICMS30[Ô]).NewRow
Dim drICMS40 As DataRow = dsNFe.Tables([Ô]ICMS40[Ô]).NewRow
Dim drICMS51 As DataRow = dsNFe.Tables([Ô]ICMS51[Ô]).NewRow
Dim drICMS60 As DataRow = dsNFe.Tables([Ô]ICMS60[Ô]).NewRow
Dim drICMS70 As DataRow = dsNFe.Tables([Ô]ICMS70[Ô]).NewRow
Dim drICMS90 As DataRow = dsNFe.Tables([Ô]ICMS90[Ô]).NewRow
Dim drICMSPart As DataRow = dsNFe.Tables([Ô]ICMSPart[Ô]).NewRow
Dim drICMSST As DataRow = dsNFe.Tables([Ô]ICMSST[Ô]).NewRow
Dim drICMSSN101 As DataRow = dsNFe.Tables([Ô]ICMSSN101[Ô]).NewRow
Dim drICMSSN102 As DataRow = dsNFe.Tables([Ô]ICMSSN102[Ô]).NewRow
Dim drICMSSN201 As DataRow = dsNFe.Tables([Ô]ICMSSN201[Ô]).NewRow
Dim drICMSSN202 As DataRow = dsNFe.Tables([Ô]ICMSSN202 [Ô]).NewRow
Dim drICMSSN500 As DataRow = dsNFe.Tables([Ô]ICMSSN500[Ô]).NewRow
Dim drICMSSN900 As DataRow = dsNFe.Tables([Ô]ICMSSN900[Ô]).NewRow
Dim drrefNF As DataRow = dsNFe.Tables([Ô]refNF[Ô]).NewRow
Dim drrefNFP As DataRow = dsNFe.Tables([Ô]refNFP[Ô]).NewRow
Dim drrefECF As DataRow = dsNFe.Tables([Ô]refECF[Ô]).NewRow
Dim dravulsa As DataRow = dsNFe.Tables([Ô]avulsa[Ô]).NewRow
Dim drretirada As DataRow = dsNFe.Tables([Ô]retirada[Ô]).NewRow
Dim drentrega As DataRow = dsNFe.Tables([Ô]entrega[Ô]).NewRow
Dim drDI As DataRow = dsNFe.Tables([Ô]DI[Ô]).NewRow
Dim dradi As DataRow = dsNFe.Tables([Ô]adi[Ô]).NewRow
Dim drveicProd As DataRow = dsNFe.Tables([Ô]veicProd[Ô]).NewRow
Dim drCIDE As DataRow = dsNFe.Tables([Ô]CIDE[Ô]).NewRow
Dim drIPI As DataRow = dsNFe.Tables([Ô]IPI[Ô]).NewRow
Dim drIPITrib As DataRow = dsNFe.Tables([Ô]IPITrib[Ô]).NewRow
Dim drIPINT As DataRow = dsNFe.Tables([Ô]IPINT[Ô]).NewRow
Dim drII As DataRow = dsNFe.Tables([Ô]II[Ô]).NewRow
Dim drISSQN As DataRow = dsNFe.Tables([Ô]ISSQN[Ô]).NewRow
Dim drPISAliq As DataRow = dsNFe.Tables([Ô]PISAliq[Ô]).NewRow
Dim drPISQtde As DataRow = dsNFe.Tables([Ô]PISQtde[Ô]).NewRow
Dim drPISNT As DataRow = dsNFe.Tables([Ô]PISNT[Ô]).NewRow
Dim drPISOutr As DataRow = dsNFe.Tables([Ô]PISOutr[Ô]).NewRow
Dim drPISST As DataRow = dsNFe.Tables([Ô]PISST[Ô]).NewRow
Dim drCOFINSAliq As DataRow = dsNFe.Tables([Ô]COFINSAliq[Ô]).NewRow
Dim drCOFINSQtde As DataRow = dsNFe.Tables([Ô]COFINSQtde[Ô]).NewRow
Dim drCOFINSNT As DataRow = dsNFe.Tables([Ô]COFINSNT[Ô]).NewRow
Dim drCOFINSOutr As DataRow = dsNFe.Tables([Ô]COFINSOutr[Ô]).NewRow
Dim drCOFINSST As DataRow = dsNFe.Tables([Ô]COFINSST[Ô]).NewRow
Dim drICMSTot As DataRow = dsNFe.Tables([Ô]ICMSTot[Ô]).NewRow
Dim drISSQNtot As DataRow = dsNFe.Tables([Ô]ISSQNtot[Ô]).NewRow
Dim drretTrib As DataRow = dsNFe.Tables([Ô]retTrib[Ô]).NewRow
Dim drtransp As DataRow = dsNFe.Tables([Ô]transp[Ô]).NewRow
Dim drtransporta As DataRow = dsNFe.Tables([Ô]transporta[Ô]).NewRow
Dim drretTransp As DataRow = dsNFe.Tables([Ô]retTransp[Ô]).NewRow
Dim drveicTransp As DataRow = dsNFe.Tables([Ô]veicTransp[Ô]).NewRow
Dim drreboque As DataRow = dsNFe.Tables([Ô]reboque[Ô]).NewRow
Dim drvol As DataRow = dsNFe.Tables([Ô]vol[Ô]).NewRow
Dim drlacres As DataRow = dsNFe.Tables([Ô]lacres[Ô]).NewRow
Dim drfat As DataRow = dsNFe.Tables([Ô]fat[Ô]).NewRow
Dim drdup As DataRow = dsNFe.Tables([Ô]dup[Ô]).NewRow
Dim drinfAdic As DataRow = dsNFe.Tables([Ô]infAdic[Ô]).NewRow
Dim drobsCont As DataRow = dsNFe.Tables([Ô]obsCont[Ô]).NewRow
Dim drobsFisco As DataRow = dsNFe.Tables([Ô]obsFisco[Ô]).NewRow
Dim drprocRef As DataRow = dsNFe.Tables([Ô]procRef[Ô]).NewRow
Dim drexporta As DataRow = dsNFe.Tables([Ô]exporta[Ô]).NewRow
Dim drcompra As DataRow = dsNFe.Tables([Ô]compra[Ô]).NewRow
Dim drcana As DataRow = dsNFe.Tables([Ô]cana[Ô]).NewRow
Dim drforDia As DataRow = dsNFe.Tables([Ô]forDia[Ô]).NewRow
Dim drdeduc As DataRow = dsNFe.Tables([Ô]deduc[Ô]).NewRow
Dim drICMS As DataRow = dsNFe.Tables([Ô]ICMS[Ô]).NewRow
Dim drImposto As DataRow = dsNFe.Tables([Ô]imposto[Ô]).NewRow
#End Region

Public WriteOnly Property l_SCHEMAxsd() As String
[ô]Get
[ô] Dim _xml As String
[ô] _xml = dsNFe.GetXml
[ô] _xml = Replace(_xml, [Ô]standalone=[Ô][Ô]yes[Ô][Ô][Ô], [Ô]encoding=[Ô][Ô]UTF-8[Ô][Ô][Ô])
[ô] _xml = Replace(_xml, [Ô]<NewDataSet xmlns:xsi=[Ô][Ô]http://www.w3.org/2001/XMLSchema-instance[Ô][Ô] xmlns=[Ô][Ô]http://www.portalfiscal.inf.br/nfe[Ô][Ô]>[Ô], [Ô][Ô])
[ô] _xml = Replace(_xml, [Ô]</NewDataSet>[Ô], [Ô]</NFe>[Ô])
[ô] Return _xml
[ô]End Get
Set(ByVal value As String)
If IO.File.Exists(value) = True And value.Substring(value.Length - 4) = [Ô].xsd[Ô] Then
dsNFe.ReadXmlSchema(value)
Else
MsgBox([Ô]Não consegui encontrar o Schema da NF-e 2.00[Ô])
End If
End Set
End Property

#Region [Ô]PRINCIPAIS FUNÇÕES PARA GERAR O XML[Ô]

Public Sub Gera_Indices(ByVal Indice As Integer)
With drNFe
.Item([Ô]Nfe_Id[Ô]) = Indice
.Table.Namespace = [Ô]http://www.portalfiscal.inf.br/nfe[Ô]
End With
dsNFe.Tables([Ô]Nfe[Ô]).Rows.Add(drNFe)

With drInfNfe

.Item([Ô]NFe_Id[Ô]) = drNFe.Item([Ô]Nfe_Id[Ô])
.Item([Ô]versao[Ô]) = [Ô]2.00[Ô]
End With
dsNFe.Tables([Ô]infNfe[Ô]).Rows.Add(drInfNfe)

End Sub

Public Sub NFRef(ByVal CAMPO_refNFe As String, Optional ByVal CAMPO_refCTe As String = [Ô][Ô])
With drNFref
.Item([Ô]refNFe[Ô]) = CAMPO_refNFe
[ô].Item([Ô]refCTe[Ô]) = CAMPO_refCTe
End With
dsNFe.Tables([Ô]NFref[Ô]).Rows.Add(drNFref)
End Sub

Public Sub Gerar_IDE(ByVal CAMPO_natOp As String, ByVal CAMPO_indPag As Integer, ByVal CAMPO_mod As String, _
ByVal CAMPO_serie As String, ByVal CAMPO_nNF As Integer, ByVal CAMPO_dEmi As Date, _
ByVal CAMPO_hSaiEnt As DateTime, ByVal CAMPO_dSaiEnt As Date, ByVal CAMPO_tpNF As Integer, _
ByVal CAMPO_cMunFG As Integer, ByVal CAMPO_tpImp As Integer, ByVal CAMPO_tpEmis As Integer, _
ByVal CAMPO_tpAmb As Integer, ByVal CAMPO_finNFe As Integer, ByVal CAMPO_procEmi As Integer, _
ByVal CAMPO_verProc As String, ByVal CAMPO_dhCont As String)


With dride
[ô].Item([Ô]cUF[Ô]) = CAMPO_cUF [ô]Codigo que deverá ser pego após Informar a UF do Emitente
[ô].Item([Ô]cNF[Ô]) = CAMPO_cNF [ô]Deverá ser inserido após o HASH da NF-e ser Gerado
.Item([Ô]natOp[Ô]) = CAMPO_natOp
.Item([Ô]indPag[Ô]) = CAMPO_indPag
.Item([Ô]mod[Ô]) = CAMPO_mod
.Item([Ô]serie[Ô]) = CAMPO_serie
.Item([Ô]nNF[Ô]) = CAMPO_nNF
.Item([Ô]dEmi[Ô]) = CAMPO_dEmi
.Item([Ô]dSaiEnt[Ô]) = CAMPO_dSaiEnt
.Item([Ô]hSaiEnt[Ô]) = CAMPO_hSaiEnt
.Item([Ô]tpNF[Ô]) = CAMPO_tpNF
.Item([Ô]cMunFG[Ô]) = CAMPO_cMunFG
.Item([Ô]tpImp[Ô]) = CAMPO_tpImp
.Item([Ô]tpEmis[Ô]) = CAMPO_tpEmis
[ô].Item([Ô]cDV[Ô]) = CAMPO_cDV [ô]Esse campo deverá ser inserido após ser gerado o Numero HASH da Nota
.Item([Ô]tpAmb[Ô]) = CAMPO_tpAmb
.Item([Ô]finNFe[Ô]) = CAMPO_finNFe
.Item([Ô]procEmi[Ô]) = CAMPO_procEmi
.Item([Ô]verProc[Ô]) = CAMPO_verProc
.Item([Ô]dhCont[Ô]) = CAMPO_dhCont
.Item([Ô]InfNFe_Id[Ô]) = drInfNfe.Item([Ô]infNFe_Id[Ô])
End With

End Sub

Public Sub Gerar_Emitente(ByVal CAMPO_CNPJ As String, ByVal CAMPO_CPF As String, ByVal CAMPO_xNome As String, _
ByVal CAMPO_xFant As String, ByVal CAMPO_IE As String, ByVal CAMPO_IEST As String, _
ByVal CAMPO_IM As String, ByVal CAMPO_xLgr As String, ByVal CAMPO_nro As String, _
ByVal CAMPO_xCpl As String, ByVal CAMPO_xBairro As String, ByVal CAMPO_xMun As String, _
ByVal CAMPO_UF As String, ByVal CAMPO_CEP As Integer, ByVal CAMPO_xPais As String, _
ByVal CAMPO_fone As Integer, Optional ByVal CAMPO_CRT As String = [Ô][Ô], Optional ByVal CAMPO_CNAE As String = [Ô][Ô])

With dremit
.Item([Ô]CNPJ[Ô]) = C
GERSON 24/04/2010 20:05:44
#340143
Segunda parte

With dremit
.Item([Ô]CNPJ[Ô]) = CAMPO_CNPJ
.Item([Ô]CPF[Ô]) = CAMPO_CPF
.Item([Ô]xNome[Ô]) = CAMPO_xNome
.Item([Ô]xFant[Ô]) = CAMPO_xFant
.Item([Ô]IE[Ô]) = CAMPO_IE
.Item([Ô]IEST[Ô]) = CAMPO_IEST
.Item([Ô]IM[Ô]) = CAMPO_IM
.Item([Ô]CNAE[Ô]) = CAMPO_CNAE
.Item([Ô]CRT[Ô]) = CAMPO_CRT
.Item([Ô]infNFe_Id[Ô]) = drInfNfe.Item([Ô]infNFe_Id[Ô])
End With

With drenderEmit
.Item([Ô]xLgr[Ô]) = CAMPO_xLgr
.Item([Ô]nro[Ô]) = CAMPO_nro
.Item([Ô]xCpl[Ô]) = CAMPO_xCpl
.Item([Ô]xBairro[Ô]) = CAMPO_xBairro
[ô].Item([Ô]cMun[Ô]) = [ô]FuncaoMunicipios(CAMPO_xMun)
.Item([Ô]xMun[Ô]) = CAMPO_xMun
.Item([Ô]UF[Ô]) = CAMPO_UF
.Item([Ô]CEP[Ô]) = CAMPO_CEP
.Item([Ô]cPais[Ô]) = 1058 [ô]FuncaoPais(CAMPO_xPais)
.Item([Ô]xPais[Ô]) = CAMPO_xPais
.Item([Ô]fone[Ô]) = CAMPO_fone
.Item([Ô]emit_Id[Ô]) = dremit.Item([Ô]emit_Id[Ô])
End With
[ô]Complementando as informações da TAG IDE
dsNFe.Tables([Ô]ide[Ô]).Rows(0).Item([Ô]cUF[Ô]) = [Ô]MG[Ô] [ô]FuncaoEstado(CAMPO_UF)
End Sub

Public Sub Gerar_destinatario(ByVal CAMPO_CNPJ As String, ByVal CAMPO_CPF As String, ByVal CAMPO_xNome As String, _
ByVal CAMPO_xFant As String, ByVal CAMPO_IE As String, ByVal CAMPO_ISUF As String, _
ByVal CAMPO_email As String, ByVal CAMPO_xLgr As String, ByVal CAMPO_nro As String, _
ByVal CAMPO_xCpl As String, ByVal CAMPO_xBairro As String, ByVal CAMPO_xMun As String, _
ByVal CAMPO_UF As String, ByVal CAMPO_CEP As Integer, ByVal CAMPO_xPais As String, _
ByVal CAMPO_fone As Integer)
With drdest
.Item([Ô]CNPJ[Ô]) = CAMPO_CNPJ
.Item([Ô]CPF[Ô]) = CAMPO_CPF
.Item([Ô]xNome[Ô]) = CAMPO_xNome
.Item([Ô]IE[Ô]) = CAMPO_IE
.Item([Ô]ISUF[Ô]) = CAMPO_ISUF
.Item([Ô]email[Ô]) = CAMPO_email
.Item([Ô]infNFe_Id[Ô]) = drInfNfe.Item([Ô]infNFe_Id[Ô])
End With

With drenderDest

.Item([Ô]xLgr[Ô]) = CAMPO_xLgr
.Item([Ô]nro[Ô]) = CAMPO_nro
.Item([Ô]xCpl[Ô]) = CAMPO_xCpl
.Item([Ô]xBairro[Ô]) = CAMPO_xBairro
[ô].Item([Ô]cMun[Ô]) = [ô]FuncaoMunicipios(CAMPO_xMun)
.Item([Ô]xMun[Ô]) = CAMPO_xMun
.Item([Ô]UF[Ô]) = CAMPO_UF
.Item([Ô]CEP[Ô]) = CAMPO_CEP
.Item([Ô]cPais[Ô]) = 1058 [ô]FuncaoPais(CAMPO_xPais)
.Item([Ô]xPais[Ô]) = CAMPO_xPais
.Item([Ô]fone[Ô]) = CAMPO_fone
.Item([Ô]dest_Id[Ô]) = drdest.Item([Ô]dest_Id[Ô])
End With

End Sub

Public Sub Gerar_Produtos(ByVal INDICE_Prod As Integer, ByVal CAMPO_cProd As Integer, ByVal CAMPO_cEAN As String, _
ByVal CAMPO_xProd As String, ByVal CAMPO_NCM As String, ByVal CAMPO_EXTIPI As String, _
ByVal CAMPO_CFOP As String, ByVal CAMPO_uCom As String, ByVal CAMPO_qCom As Double, _
ByVal CAMPO_vUnCom As Double, ByVal CAMPO_vProd As Double, ByVal CAMPO_cEANTrib As String, _
ByVal CAMPO_uTrib As String, ByVal CAMPO_qTrib As Double, ByVal CAMPO_vUnTrib As Double, _
ByVal CAMPO_vFrete As Double, ByVal CAMPO_vSeg As Double, ByVal CAMPO_vDesc As Double, _
Optional ByVal CAMPO_vOutro As Double = 0, Optional ByVal CAMPO_indTot As String = [Ô][Ô], _
Optional ByVal CAMPO_xPed As String = [Ô][Ô], Optional ByVal CAMPO_nItemPed As String = [Ô][Ô], Optional ByVal CAMPO_infAdProd As String = [Ô][Ô])



With drdet
.Item([Ô]nItem[Ô]) = INDICE_Prod + 1
.Item([Ô]det_Id[Ô]) = INDICE_Prod
.Item([Ô]infAdProd[Ô]) = CAMPO_infAdProd

End With

With drprod
.Item([Ô]cProd[Ô]) = CAMPO_cProd
.Item([Ô]cEAN[Ô]) = CAMPO_cEAN
.Item([Ô]xProd[Ô]) = CAMPO_xProd
.Item([Ô]NCM[Ô]) = CAMPO_NCM
.Item([Ô]EXTIPI[Ô]) = CAMPO_EXTIPI
.Item([Ô]CFOP[Ô]) = CAMPO_CFOP
.Item([Ô]uCom[Ô]) = CAMPO_uCom
.Item([Ô]qCom[Ô]) = CAMPO_qCom
.Item([Ô]vUnCom[Ô]) = CAMPO_vUnCom
.Item([Ô]vProd[Ô]) = CAMPO_vProd
.Item([Ô]cEANTrib[Ô]) = CAMPO_cEANTrib
.Item([Ô]uTrib[Ô]) = CAMPO_uTrib
.Item([Ô]qTrib[Ô]) = CAMPO_qTrib
.Item([Ô]vUnTrib[Ô]) = CAMPO_vUnTrib
.Item([Ô]vFrete[Ô]) = CAMPO_vFrete
.Item([Ô]vSeg[Ô]) = CAMPO_vSeg
.Item([Ô]vDesc[Ô]) = CAMPO_vDesc
.Item([Ô]vOutro[Ô]) = CAMPO_vOutro
.Item([Ô]indTot[Ô]) = CAMPO_indTot
.Item([Ô]xPed[Ô]) = CAMPO_xPed
.Item([Ô]nItemPed[Ô]) = CAMPO_nItemPed
.Item([Ô]det_Id[Ô]) = drdet.Item([Ô]det_Id[Ô])
End With

With drImposto

.Item([Ô]det_id[Ô]) = drdet.Item([Ô]det_Id[Ô])

End With

dsNFe.Tables([Ô]imposto[Ô]).Rows.Add(drImposto)

With drICMS

.Item([Ô]imposto_Id[Ô]) = drImposto.Item([Ô]imposto_Id[Ô])

End With

dsNFe.Tables([Ô]ICMS[Ô]).Rows.Add(drICMS)


End Sub

#End Region

#Region [Ô]FUNÇÕES QUE COMPLEMENTAM A DESCRIÇÃO DO PRODUTO[Ô]

Public Sub Complementar_Produto(ByVal MEDICAMENTO_nLote As String, ByVal MEDICAMENTO_qLote As Double, ByVal MEDICAMENTO_dFab As Date, ByVal MEDICAMENTO_dVal As Date, ByVal MEDICAMENTO_vPMC As Double)


With drmed
.Item([Ô]nLote[Ô]) = MEDICAMENTO_nLote
.Item([Ô]qLote[Ô]) = MEDICAMENTO_qLote
.Item([Ô]dFab[Ô]) = MEDICAMENTO_dFab
.Item([Ô]dVal[Ô]) = MEDICAMENTO_dVal
.Item([Ô]vPMC[Ô]) = MEDICAMENTO_vPMC
.Item([Ô]prod_Id[Ô]) = drprod.Item([Ô]prod_Id[Ô])
End With
End Sub

Public Sub Complementar_Produto(ByVal ARMA_tpArma As String, ByVal ARMA_nSerie As String, ByVal ARMA_nCano As String, ByVal ARMA_descr As String)


With drarma
.Item([Ô]tpArma[Ô]) = ARMA_tpArma
.Item([Ô]nSerie[Ô]) = ARMA_nSerie
.Item([Ô]nCano[Ô]) = ARMA_nCano
.Item([Ô]descr[Ô]) = ARMA_descr
.Item([Ô]prod_Id[Ô]) = drprod.Item([Ô]prod_Id[Ô])
End With

End Sub

Public Sub Complementar_Produto(ByVal COMBUSTIVEL_cProdANP As String, ByVal COMBUSTIVEL_CODIF As String, ByVal COMBUSTIVEL_qTemp As Double, ByVal COMBUSTIVEL_UFCons As String)

With drcomb

.Item([Ô]cProdANP[Ô]) = COMBUSTIVEL_cProdANP
.Item([Ô]CODIF[Ô]) = COMBUSTIVEL_CODIF
.Item([Ô]qTemp[Ô]) = COMBUSTIVEL_qTemp
.Item([Ô]UFCons[Ô]) = COMBUSTIVEL_UFCons
.Item([Ô]prod_Id[Ô]) = drprod.Item([Ô]prod_Id[Ô])
End With
End Sub

#End Region

#Region [Ô]FUNÇÕES PARA GERAR OS ICMS[Ô]
Public Sub Gerar_000(ByVal ICMS00_orig As Integer, ByVal ICMS00_CST As String, ByVal ICMS00_modBC As String, ByVal ICMS00_vBC As Double, ByVal ICMS00_pICMS As Double, ByVal ICMS00_vICMS As Double)


With drICMS00
.Item([Ô]orig[Ô]) = ICMS00_orig
.Item([Ô]CST[Ô]) = ICMS00_CST
.Item([Ô]modBC[Ô]) = ICMS00_modBC
.Item([Ô]vBC[Ô]) = ICMS00_vBC
.Item([Ô]pICMS[Ô]) = ICMS00_pICMS
.Item([Ô]vICMS[Ô]) = ICMS00_vICMS
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_010(ByVal ICMS10_orig As Integer, ByVal ICMS10_CST As String, ByVal ICMS10_modBC As String, _
ByVal ICMS10_vBC As Double, ByVal ICMS10_pICMS As Double, ByVal ICMS10_vICMS As Double, _
ByVal ICMS10_modBCST As String, ByVal ICMS10_pMVAST As Double, ByVal ICMS10_pRedBCST As Double, _
ByVal ICMS10_vBCST As Double, ByVal ICMS10_pICMSST As Double, ByVal ICMS10_vICMSST As Double)



With drICMS10
.Item([Ô]orig[Ô]) = ICMS10_orig
.Item([Ô]CST[Ô]) = ICMS10_CST
.Item([Ô]modBC[Ô]) = ICMS10_modBC
.Item([Ô]vBC[Ô]) = ICMS10_vBC
.Item([Ô]pICMS[Ô]) = ICMS10_pICMS
.Item([Ô]vICMS[Ô]) = ICMS10_vICMS
.Item([Ô]modBCST[Ô]) = ICMS10_modBCST
.Item([Ô]pMVAST[Ô]) = ICMS10_pMVAST
.Item([Ô]pRedBCST[Ô]) = ICMS10_pRedBCST
.Item([Ô]vBCST[Ô]) = ICMS10_vBCST
.Item([Ô]pICMSST[Ô]) = ICMS10_pICMSST
.Item([Ô]vICMSST[Ô]) = ICMS10_vICMSST
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_020(ByVal ICMS20_orig As Integer, ByVal ICMS20_CST As String, ByVal ICMS20_modBC As String, _
ByVal ICMS20_pRedBC As Double, ByVal ICMS20_vBC As Double, ByVal ICMS20_pICMS As Double, _
ByVal ICMS20_vICMS As Double)




With drICMS20
.Item([Ô]orig[Ô]) = ICMS20_orig
.Item([Ô]CST[Ô]) = ICMS20_CST
.Item([Ô]modBC[Ô]) = ICMS20_modBC
.Item([Ô]pRedBC[Ô]) = ICMS20_pRedBC
.Item([Ô]vBC[Ô]) = ICMS20_vBC
.Item([Ô]pICMS[Ô]) = ICMS20_pICMS
.Item([Ô]vICMS[Ô]) = ICMS20_vICMS
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With

End Sub
Public Sub Gerar_030(ByVal ICMS30_orig As Integer, ByVal ICMS30_CST As String, ByVal ICMS30_modBCST As String, _
ByVal ICMS30_pMVAST As Double, ByVal ICMS30_pRedBCST As Double, ByVal ICMS30_vBCST As Double, _
ByVal ICMS30_pICMSST As Double, ByVal ICMS30_vICMSST As Double)


With drICMS30
.Item([Ô]orig[Ô]) = ICMS30_orig
.Item([Ô]CST[Ô]) = ICMS30_CST
.Item([Ô]modBCST[Ô]) = ICMS30_modBCST
.Item([Ô]pMVAST[Ô]) = ICMS30_pMVAST
.Item([Ô]pRedBCST[Ô]) = ICMS30_pRedBCST
.Item([Ô]vBCST[Ô]) = ICMS30_vBCST
GERSON 24/04/2010 20:08:28
#340144
Terceira parte

.Item([Ô]pICMSST[Ô]) = ICMS30_pICMSST
.Item([Ô]vICMSST[Ô]) = ICMS30_vICMSST
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_040(ByVal ICMS40_orig As Integer, ByVal ICMS40_CST As String, ByVal ICMS40_vICMS As Double, ByVal ICMS40_motDesICMS As String)



With drICMS40
.Item([Ô]orig[Ô]) = ICMS40_orig
.Item([Ô]CST[Ô]) = ICMS40_CST
.Item([Ô]vICMS[Ô]) = ICMS40_vICMS
.Item([Ô]motDesICMS[Ô]) = ICMS40_motDesICMS
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With

End Sub
Public Sub Gerar_051(ByVal ICMS51_orig As Integer, ByVal ICMS51_CST As String, ByVal ICMS51_modBC As String, ByVal ICMS51_pRedBC As Double, _
ByVal ICMS51_vBC As Double, ByVal ICMS51_pICMS As Double, ByVal ICMS51_vICMS As Double)


With drICMS51
.Item([Ô]orig[Ô]) = ICMS51_orig
.Item([Ô]CST[Ô]) = ICMS51_CST
.Item([Ô]modBC[Ô]) = ICMS51_modBC
.Item([Ô]pRedBC[Ô]) = ICMS51_pRedBC
.Item([Ô]vBC[Ô]) = ICMS51_vBC
.Item([Ô]pICMS[Ô]) = ICMS51_pICMS
.Item([Ô]vICMS[Ô]) = ICMS51_vICMS
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_060(ByVal ICMS60_orig As Integer, ByVal ICMS60_CST As String, ByVal ICMS60_vBCSTRet As Double, ByVal ICMS60_vICMSSTRet As Double)



With drICMS60
.Item([Ô]orig[Ô]) = ICMS60_orig
.Item([Ô]CST[Ô]) = ICMS60_CST
.Item([Ô]vBCSTRet[Ô]) = ICMS60_vBCSTRet
.Item([Ô]vICMSSTRet[Ô]) = ICMS60_vICMSSTRet
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_070(ByVal ICMS70_orig As Integer, ByVal ICMS70_CST As String, ByVal ICMS70_modBC As String, ByVal ICMS70_pRedBC As Double, ByVal ICMS70_vBC As Double, ByVal ICMS70_pICMS As Double, ByVal ICMS70_vICMS As Double, _
ByVal ICMS70_modBCST As String, ByVal ICMS70_pMVAST As Double, ByVal ICMS70_pRedBCST As Double, _
ByVal ICMS70_vBCST As Double, ByVal ICMS70_pICMSST As Double, ByVal ICMS70_vICMSST As Double)



With drICMS70
.Item([Ô]orig[Ô]) = ICMS70_orig
.Item([Ô]CST[Ô]) = ICMS70_CST
.Item([Ô]modBC[Ô]) = ICMS70_modBC
.Item([Ô]pRedBC[Ô]) = ICMS70_pRedBC
.Item([Ô]vBC[Ô]) = ICMS70_vBC
.Item([Ô]pICMS[Ô]) = ICMS70_pICMS
.Item([Ô]vICMS[Ô]) = ICMS70_vICMS
.Item([Ô]modBCST[Ô]) = ICMS70_modBCST
.Item([Ô]pMVAST[Ô]) = ICMS70_pMVAST
.Item([Ô]pRedBCST[Ô]) = ICMS70_pRedBCST
.Item([Ô]vBCST[Ô]) = ICMS70_vBCST
.Item([Ô]pICMSST[Ô]) = ICMS70_pICMSST
.Item([Ô]vICMSST[Ô]) = ICMS70_vICMSST
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_090(ByVal ICMS90_orig As Integer, ByVal ICMS90_CST As String, ByVal ICMS90_modBC As String, _
ByVal ICMS90_vBC As Double, ByVal ICMS90_pRedBC As Double, ByVal ICMS90_pICMS As Double, _
ByVal ICMS90_vICMS As Double, ByVal ICMS90_modBCST As String, ByVal ICMS90_pMVAST As Double, _
ByVal ICMS90_pRedBCST As Double, ByVal ICMS90_vBCST As Double, ByVal ICMS90_pICMSST As Double, _
ByVal ICMS90_vICMSST As Double)



With drICMS90
.Item([Ô]orig[Ô]) = ICMS90_orig
.Item([Ô]CST[Ô]) = ICMS90_CST
.Item([Ô]modBC[Ô]) = ICMS90_modBC
.Item([Ô]vBC[Ô]) = ICMS90_vBC
.Item([Ô]pRedBC[Ô]) = ICMS90_pRedBC
.Item([Ô]pICMS[Ô]) = ICMS90_pICMS
.Item([Ô]vICMS[Ô]) = ICMS90_vICMS
.Item([Ô]modBCST[Ô]) = ICMS90_modBCST
.Item([Ô]pMVAST[Ô]) = ICMS90_pMVAST
.Item([Ô]pRedBCST[Ô]) = ICMS90_pRedBCST
.Item([Ô]vBCST[Ô]) = ICMS90_vBCST
.Item([Ô]pICMSST[Ô]) = ICMS90_pICMSST
.Item([Ô]vICMSST[Ô]) = ICMS90_vICMSST
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_ICMSPart(ByVal ICMSPart_orig As Integer, ByVal ICMSPart_CST As String, ByVal ICMSPart_modBC As String, _
ByVal ICMSPart_vBC As Double, ByVal ICMSPart_pRedBC As Double, ByVal ICMSPart_pICMS As Double, _
ByVal ICMSPart_vICMS As Double, ByVal ICMSPart_modBCST As String, ByVal ICMSPart_pMVAST As Double, _
ByVal ICMSPart_pRedBCST As Double, ByVal ICMSPart_vBCST As Double, ByVal ICMSPart_pICMSST As Double, ByVal ICMSPart_vICMSST As Double, _
ByVal ICMSPart_pBCOp As Double, ByVal ICMSPart_UFST As String)



With drICMSPart
.Item([Ô]orig[Ô]) = ICMSPart_orig
.Item([Ô]CST[Ô]) = ICMSPart_CST
.Item([Ô]modBC[Ô]) = ICMSPart_modBC
.Item([Ô]vBC[Ô]) = ICMSPart_vBC
.Item([Ô]pRedBC[Ô]) = ICMSPart_pRedBC
.Item([Ô]pICMS[Ô]) = ICMSPart_pICMS
.Item([Ô]vICMS[Ô]) = ICMSPart_vICMS
.Item([Ô]modBCST[Ô]) = ICMSPart_modBCST
.Item([Ô]pMVAST[Ô]) = ICMSPart_pMVAST
.Item([Ô]pRedBCST[Ô]) = ICMSPart_pRedBCST
.Item([Ô]vBCST[Ô]) = ICMSPart_vBCST
.Item([Ô]pICMSST[Ô]) = ICMSPart_pICMSST
.Item([Ô]vICMSST[Ô]) = ICMSPart_vICMSST
.Item([Ô]pBCOp[Ô]) = ICMSPart_pBCOp
.Item([Ô]UFST[Ô]) = ICMSPart_UFST
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])

End With
End Sub
Public Sub Gerar_ICMSST(ByVal ICMSST_orig As Integer, ByVal ICMSST_CST As String, ByVal ICMSST_vBCSTRet As Double, ByVal ICMSST_vICMSSTRet As Double, ByVal ICMSST_vBCSTDest As Double, ByVal ICMSST_vICMSSTDest As Double)



With drICMSST
.Item([Ô]orig[Ô]) = ICMSST_orig
.Item([Ô]CST[Ô]) = ICMSST_CST
.Item([Ô]vBCSTRet[Ô]) = ICMSST_vBCSTRet
.Item([Ô]vICMSSTRet[Ô]) = ICMSST_vICMSSTRet
.Item([Ô]vBCSTDest[Ô]) = ICMSST_vBCSTDest
.Item([Ô]vICMSSTDest[Ô]) = ICMSST_vICMSSTDest
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_ICMSSN101(ByVal ICMSSN101_orig As Integer, ByVal ICMSSN101_CSOSN As String, ByVal ICMSSN101_pCredSN As Double, ByVal ICMSSN101_vCredICMSSN As Double)


With drICMSSN101
.Item([Ô]orig[Ô]) = ICMSSN101_orig
.Item([Ô]CSOSN[Ô]) = ICMSSN101_CSOSN
.Item([Ô]pCredSN[Ô]) = ICMSSN101_pCredSN
.Item([Ô]vCredICMSSN[Ô]) = ICMSSN101_vCredICMSSN
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_ICMSSN102(ByVal ICMSSN102_orig As Integer, ByVal ICMSSN102_CSOSN As String)

With drICMSSN102
.Item([Ô]orig[Ô]) = ICMSSN102_orig
.Item([Ô]CSOSN[Ô]) = ICMSSN102_CSOSN
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_ICMSSN201(ByVal ICMSSN201_orig As Integer, ByVal ICMSSN201_CSOSN As String, ByVal ICMSSN201_modBCST As String, _
ByVal ICMSSN201_pMVAST As Double, ByVal ICMSSN201_pRedBCST As Double, ByVal ICMSSN201_vBCST As Double, _
ByVal ICMSSN201_pICMSST As Double, ByVal ICMSSN201_vICMSST As Double, ByVal ICMSSN201_pCredSN As Double, _
ByVal ICMSSN201_vCredICMSSN As Double)


With drICMSSN201
.Item([Ô]orig[Ô]) = ICMSSN201_orig
.Item([Ô]CSOSN[Ô]) = ICMSSN201_CSOSN
.Item([Ô]modBCST[Ô]) = ICMSSN201_modBCST
.Item([Ô]pMVAST[Ô]) = ICMSSN201_pMVAST
.Item([Ô]pRedBCST[Ô]) = ICMSSN201_pRedBCST
.Item([Ô]vBCST[Ô]) = ICMSSN201_vBCST
.Item([Ô]pICMSST[Ô]) = ICMSSN201_pICMSST
.Item([Ô]vICMSST[Ô]) = ICMSSN201_vICMSST
.Item([Ô]pCredSN[Ô]) = ICMSSN201_pCredSN
.Item([Ô]vCredICMSSN[Ô]) = ICMSSN201_vCredICMSSN
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With

End Sub
Public Sub Gerar_ICMSSN202(ByVal CMSSN202_orig As Integer, ByVal CMSSN202_CSOSN As String, ByVal CMSSN202_modBCST As String, ByVal CMSSN202_pMVAST As Double, _
ByVal CMSSN202_pRedBCST As Double, ByVal CMSSN202_vBCST As Double, ByVal CMSSN202_pICMSST As Double, ByVal CMSSN202_vICMSST As Double)



With drICMSSN202
.Item([Ô]orig[Ô]) = CMSSN202_orig
.Item([Ô]CSOSN[Ô]) = CMSSN202_CSOSN
.Item([Ô]modBCST[Ô]) = CMSSN202_modBCST
.Item([Ô]pMVAST[Ô]) = CMSSN202_pMVAST
.Item([Ô]pRedBCST[Ô]) = CMSSN202_pRedBCST
.Item([Ô]vBCST[Ô]) = CMSSN202_vBCST
.Item([Ô]pICMSST[Ô]) = CMSSN202_pICMSST
.Item([Ô]vICMSST[Ô]) = CMSSN202_vICMSST
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])
End With
End Sub
Public Sub Gerar_ICMSSN500(ByVal ICMSSN500_orig As Integer, ByVal ICMSSN500_CSOSN As String, ByVal ICMSSN500_vBCSTRet As Double, ByVal ICMSSN500_vICMSSTRet As Double)


With drICMSSN500
.Item([Ô]orig[Ô]) = ICMSSN500_orig
.Item([Ô]CSOSN[Ô]) = ICMSSN500_CSOSN
.Item([Ô]vBCSTRet[Ô]) = ICMSSN500_vBCSTRet
.Item([Ô]vICMSSTRet[Ô]) = ICMSSN500_vICMSSTRet
.Item([Ô]ICMS_id[Ô]) = drICMS.Item([Ô]ICMS_Id[Ô])

End With
End Sub
Public Sub Gerar_ICMSSN900(ByVal ICMSSN900_orig As Integer, ByVal ICMSSN900_CSOSN As String, ByVal ICMSSN900_modBC As String, ByVal ICMSSN900_vBC As Double, ByVal ICMSSN900_pRedBC As Double, _
ByVal ICMSSN900_pICMS As Double, ByVal ICMSSN900_vICMS As Double, ByVal ICMSSN900_modBCST As String, ByVal ICMSSN900_pMVAST As Double, ByVal ICMSSN900_pRedBCST As Double, _
ByVal ICMSSN900_vBCST As Double, ByVal ICMSSN900_pICMSST As Double, ByVal ICMSSN900_vICMSST As Double, ByVal ICMS
Página 6 de 228 [2276 registro(s)]
Faça seu login para responder