Ir para conteúdo
  • Cadastre-se

dev botao

Nfc-E Tag Transp


Ver Solução Respondido por Leonardo Gregianin,
  • Este tópico foi criado há 4017 dias atrás.
  • Talvez seja melhor você criar um NOVO TÓPICO do que postar uma resposta aqui.

Recommended Posts

  • Membros Pro
Postado

Estou criando o XML da NFC-e

 

Quando envio recebo a mensagem que a tag abaixo não deve existir no xml, se alguém puder mim dá uma força eu agradeço.

 

<transp>

     <modFrete>0</modFrete>

</transp.>

 

porem não informo nada ref Transp. como o código abaixo

 

with DataModule1.ACBrNFe2.NotasFiscais.Add.NFe do
        begin
           infNFe.Versao := 3;
           Ide.verProc   := '2.0';
           Ide.cNF       := StrToInt(EdtNumeroNFE.Text); //Caso não seja preenchido será gerado um número aleatório pelo componente
           Ide.natOp     := 'VENDA';
           palavra       :='PRAZO';
           if AnsiContainsStr(UpperCase(EdtFPagto.Text), palavra) then//PRAZO
           begin
              TpoPag        :='PRAZO';
              Ide.indPag    := ipPrazo;
           end else begin
              Ide.indPag    := ipVista;
              TpoPag        :='VISTA';
           end;
           Ide.modelo    := 65;
           Ide.serie     := 1;
           Ide.nNF       := StrToInt(EdtNumeroNFE.Text);
           Ide.dEmi      := EdtDataEmissao.Date;
           Ide.dSaiEnt   := EdtSaida.Date;
           Ide.hSaiEnt   := EdtHoraEmissao.Time ;
           Ide.tpNF      := tnSaida;
           if vsIDFE = 1 then
           begin
              Ide.tpEmis            := teNormal;
           end else if vsIDFE =2 then
           begin
                Ide.tpEmis          := teDPEC;
           end else if vsIDFE =3 then
           begin
                Ide.tpEmis          := teContingencia;
           end else if vsIDFE =4 then
           begin
                Ide.tpEmis          := teSCAN;
           end else if vsIDFE =5 then
           begin
                Ide.tpEmis          := teFSDA;
           end;
           if vsIDAB = 0 then
           begin
              Ide.tpAmb             := taHomologacao;
           end else begin
              Ide.tpAmb             := taProducao;
           end;

           Ide.cUF       := StrToInt(vsEdtIBGEUF); //PegaEstado(UFEmpresa);
           Ide.cMunFG    := StrToInt(vsedtIBGECidade);
           Ide.finNFe    := fnNormal  ;
           Ide.tpImp     := tiNFCe;
           Ide.indFinal  := cfConsumidorFinal;
           Ide.indPres   := pcPresencial;

           //     Ide.dhCont := date;
           //     Ide.xJust  := 'Justificativa Contingencia';

            Emit.CNPJCPF           := vsedtCNPJ;
            Emit.IE                := vsEdtIE ;
            Emit.xNome             := vsEdtRazao;
            Emit.xFant             := vsEdtFantasia;

            Emit.EnderEmit.fone    := vsEdtTelefone;
            Emit.EnderEmit.CEP     := StrToInt(vsEdtCep);
            Emit.EnderEmit.xLgr    := vsEdtEndereco;
            Emit.EnderEmit.nro     := vsEdtNumero;
            Emit.EnderEmit.xCpl    := '';
            Emit.EnderEmit.xBairro := vsEdtBairro;
            Emit.EnderEmit.cMun    := StrToInt(vsedtIBGECidade);
            Emit.EnderEmit.xMun    := vsEdtCidade;
            Emit.EnderEmit.UF      := vsEdtUF;
            Emit.enderEmit.cPais   := 1058;
            Emit.enderEmit.xPais   := 'BRASIL';

            Emit.IEST              := '';
            if vsCRT = '1' then
            begin
               Emit.CRT               := crtSimplesNacional;
            end else if vsCRT = '2' then
            begin
               Emit.CRT               := crtSimplesExcessoReceita;
            end else begin
               Emit.CRT               := crtRegimeNormal;
            end;

            if EdtNomeCliente.Text <> '' then
            begin
              Dest.CNPJCPF           := EdtCNPJCliente.Text ;
              Dest.ISUF              := '';
              Dest.xNome             := EdtNomeCliente.Text  ;
              Dest.EnderDest.Fone    := '';
              Dest.EnderDest.CEP     := StrToInt(EdtCep.Text);
              Dest.EnderDest.xLgr    := EdtLogradouro.Text ;
              Dest.EnderDest.nro     := EdtNumero.Text ;
              Dest.EnderDest.xCpl    := '';
              Dest.EnderDest.xBairro := EdtBairro.Text  ;
              Dest.EnderDest.cMun    := StrToInt(edtIBGECidade.Text);
              Dest.EnderDest.xMun    := EdtCidade.Text;
              Dest.EnderDest.UF      := EdtUF.Text ;
              Dest.EnderDest.cPais   := 1058;
              Dest.EnderDest.xPais   := 'BRASIL';
            end;
            if edtTotalAliqIPTA.Value > 0 then
            begin
                perca :=  (edtTotalAliqIPTA.Value / EditValorTotalNota.Value) * 100;
                InfAdic.infCpl     := 'Val.Aprox.Tributos R$ ' + FormataFloat('V',edtTotalAliqIPTA.Value ) + '(' + FormataFloat('V',perca) + '%)Fonte IBPT';
            end;
            InfAdic.infAdFisco :=  '';
            while not CDSNFeDetalhe.Eof do
            begin
              with Det.Add do
              begin
                 Prod.nItem    := CDSNFeDetalheITEM.AsInteger;
                 Prod.cProd    := CDSNFeDetalheIDPRODUTO.AsString ;
                 if CDSNFeDetalheGTIN.AsString <> '' then
                 begin
                    Prod.cEAN     := CDSNFeDetalheGTIN.AsString;;
                 end;
                 Prod.xProd    := CDSNFeDetalheDESCRICAO.AsString;
                 Prod.NCM      := CDSNFeDetalheNCM.AsString; // Tabela NCM disponível em  http://www.receita.fazenda.gov.br/Aliquotas/DownloadArqTIPI.htm
                 Prod.EXTIPI   := '';
                 Prod.CFOP     := CDSNFeDetalheCFOP.AsString;
                 Prod.uCom     := CDSNFeDetalheUN.AsString;
                 Prod.qCom     := CDSNFeDetalheQTDE.AsFloat;
                 Prod.vUnCom   := StrToFloat(CDSNFeDetalheVALOR.AsString);
                 Prod.vProd    := CDSNFeDetalheTOTALITEM.AsFloat;
                 if CDSNFeDetalheVALICMS.AsFloat > 0 then
                 begin
                   if CDSNFeDetalheGTIN.AsString  <> '' then
                   begin
                       Prod.cEANTrib  := CDSNFeDetalheGTIN.AsString ;
                   end else begin
                      Prod.cEANTrib  := '';
                   end;
                 end else begin
                    Prod.cEANTrib  := '';
                 end;
                 Prod.uTrib     := CDSNFeDetalheUN.AsString;;
                 Prod.qTrib     := CDSNFeDetalheQTDE.AsFloat;
                 Prod.vUnTrib   := StrToFloat(CDSNFeDetalheVALOR.AsString);

                 Prod.vDesc     := 0;
                 with Imposto do
                 begin
                    if CDSNFeDetalheVALORIBPT.AsFloat > 0 then
                    begin
                        vTotTrib := CDSNFeDetalheVALORIBPT.AsFloat ;
                    end;
                    with ICMS do
                    begin
                       if RegimeEmpresa <> '1' then
                       begin
                          capote :=CDSNFeDetalheCST.AsString;
                          if capote = '00' then
                          begin
                            CST       :=cst00;
                            orig      := oeNacional;
                            modBC     := dbiValorOperacao;
                            vBC       := CDSNFeDetalheBASEICMS.AsFloat;
                            pICMS     := CDSNFeDetalheALIQSAIDA.AsFloat;
                            vICMS     := CDSNFeDetalheVALICMS.AsFloat;
                          end;
                          if capote = '10' then
                          begin
                            CST       := cst10;
                            orig      := oeNacional;
                            modBCST   := dbisMargemValorAgregado;
                            vBC       := CDSNFeDetalheBASEICMS.AsFloat;
                            pICMS     := CDSNFeDetalheALIQSAIDA.AsFloat;
                            vICMS     := CDSNFeDetalheVALICMS.AsFloat;
                            pMVAST    := CDSNFeDetalheMVA.AsFloat;
                            vBCST     := CDSNFeDetalheBASECALST.AsFloat;
                            pICMSST   := CDSNFeDetalheALIQSAIDA.AsFloat;
                            vICMSST   := CDSNFeDetalheVALORST.AsFloat;
                          end;
                          if capote = '20' then
                          begin
                            CST       :=cst20;
                            orig      := oeNacional;
                            modBCST   := dbisMargemValorAgregado;
                            pRedBC    := CDSNFeDetalheBCALREDUCAO.AsFloat;
                            vBC       :=CDSNFeDetalheBASEICMS.AsFloat;
                            pICMS     := CDSNFeDetalheALIQSAIDA.AsFloat;
                            vICMS     := CDSNFeDetalheVALICMS.AsFloat;
                          end;
                          if capote = '30' then
                          begin
                             CST       :=cst30;
                             orig      := oeNacional;
                             modBCST   := dbisMargemValorAgregado;
                             pMVAST    := CDSNFeDetalheMVA.AsFloat;
                             pRedBCST  := CDSNFeDetalheBCALREDUCAO.AsFloat;
                             vBCST     := CDSNFeDetalheBASECALST.AsFloat;
                             pICMSST   := CDSNFeDetalheALIQSAIDA.AsFloat;
                             vICMSST   := CDSNFeDetalheVALORST.AsFloat;
                          end;
                          if capote = '40' then
                          begin
                              CST       :=cst40;
                              ICMS.orig := oeNacional;
                          end;
                          if capote = '41' then
                          begin
                              CST       :=cst41;
                              orig      := oeNacional;
                          end;
                          if capote = '50' then
                          begin
                              CST       :=cst50;
                              orig      := oeNacional;
                          end;
                          if capote = '51' then
                          begin
                              CST       :=cst51;
                              orig      := oeNacional;
                              modBCST   := dbisMargemValorAgregado;
                              pRedBC    := CDSNFeDetalheBCALREDUCAO.AsFloat;
                              vBC       := CDSNFeDetalheBASEICMS.AsFloat;
                              pICMS     := CDSNFeDetalheALIQSAIDA.AsFloat;
                              vICMS     := CDSNFeDetalheVALICMS.AsFloat;
                          end;
                          if capote = '60' then
                          begin
                              CST       :=cst60;
                              orig      := oeNacional;
                              vBCSTRet  := 0;
                              vICMSSTRet:= 0;
                          end;
                          if capote = '70' then
                          begin
                              CST       :=cst70;
                              orig      := oeNacional;
                              modBCST   := dbisMargemValorAgregado;
                              orig      := oeNacional;
                              pRedBC    := CDSNFeDetalheALIQSAIDA.AsFloat;//verificar
                              vBC       := CDSNFeDetalheBASEICMS.AsFloat;
                              pICMS     := CDSNFeDetalheALIQSAIDA.AsFloat;
                              vICMS     := CDSNFeDetalheVALICMS.AsFloat;
                              pMVAST    := CDSNFeDetalheMVA.AsFloat;
                              pRedBCST  := CDSNFeDetalheBCALREDUCAO.AsFloat;
                              vBCST     := CDSNFeDetalheBASECALST.AsFloat;
                              pICMSST   := CDSNFeDetalheALIQSAIDA.AsFloat; //verificar
                              vICMSST   := CDSNFeDetalheVALORST.AsFloat;
                          end;
                          if capote = '90' then
                          begin
                              CST       := cst90;
                              orig      := oeNacional;
                              modBCST   := dbisMargemValorAgregado;
                              vBC       := CDSNFeDetalheBASEICMS.AsFloat;
                              pRedBC    := CDSNFeDetalheALIQSAIDA.AsFloat;//verificar
                              pICMS     := CDSNFeDetalheALIQSAIDA.AsFloat;//verificar
                              vICMS     := CDSNFeDetalheVALICMS.AsFloat;
                              pMVAST    := CDSNFeDetalheMVA.AsFloat;
                              pRedBCST  := CDSNFeDetalheBCALREDUCAO.AsFloat;
                              vBCST     := CDSNFeDetalheBASECALST.AsFloat;
                              pICMSST   := CDSNFeDetalheALIQSAIDA.AsFloat;//verificar
                              vICMSST   := CDSNFeDetalheVALORST.AsFloat;
                           end;
                       end else begin  // simples nacional
                           capote := copy(CDSNFeDetalheCSOSN.AsString,2,3);
                           if capote = '101' then
                           begin
                              CSOSN        :=csosn101;
                              orig         := oeNacional;
                              pCredSN      := 0;
                              vCredICMSSN  := 0;
                           end;
                            //csosn 102,103,300,400
                           if (capote = '102') or (capote = '103') or (capote = '300') or (capote = '400') then
                           begin
                              CSOSN      :=csosn102;
                              ICMS.orig  := oeNacional;
                           end;
                            //csosn 201
                           if capote = '201' then
                           begin
                              CSOSN        :=csosn201;
                              orig         := oeNacional;//(oeNacional, oeEstrangeiraImportacaoDireta, oeEstrangeiraAdquiridaBrasil)
                              modBCST      := dbisMargemValorAgregado;//a definir (dbisPrecoTabelado, dbisListaNegativa, dbisListaPositiva, dbisListaNeutra, dbisMargemValorAgregado, dbisPauta)
                              pMVAST       := CDSNFeDetalheMVA.AsFloat;
                              pRedBCST     := CDSNFeDetalheBCALREDUCAO.AsFloat;
                              vBCST        := CDSNFeDetalheBASECALST.AsFloat;
                              pICMSST      := CDSNFeDetalheALIQSAIDA.AsFloat;
                              vICMSST      := CDSNFeDetalheVALORST.AsFloat;
                              pCredSN      := 0;
                              vCredICMSSN  := 0;
                           end;
                            //csosn 202 e 203
                           if (capote = '202') or (capote = '203') then
                           begin
                              CSOSN        :=csosn202;
                              orig         := oeNacional;
                              modBCST      := dbisMargemValorAgregado;
                              pMVAST       := CDSNFeDetalheMVA.AsFloat;
                              pRedBCST     := CDSNFeDetalheBCALREDUCAO.AsFloat;
                              vBCST        := CDSNFeDetalheBASECALST.AsFloat;
                              pICMSST      := CDSNFeDetalheALIQSAIDA.AsFloat;
                              vICMSST      := CDSNFeDetalheVALORST.AsFloat;
                           end;
                           //csosn 500
                           if capote = '500' then
                           begin
                              CSOSN        :=csosn500;
                              ICMS.orig    := oeNacional;
                              vBCSTRet     := 0;
                              vICMSSTRet   := 0;
                           end;
                            //csosn 900
                           if capote = '900' then
                           begin
                              CSOSN        := csosn900;
                              orig         := oeNacional;
                              modBCST      := dbisMargemValorAgregado;
                              vBC          := CDSNFeDetalheBASEICMS.AsFloat;
                              pRedBC       := CDSNFeDetalheALIQSAIDA.AsFloat;// verificar
                              pICMS        := CDSNFeDetalheALIQSAIDA.AsFloat;
                              vICMS        := CDSNFeDetalheVALICMS.AsFloat;
                              pMVAST       := CDSNFeDetalheMVA.AsFloat;
                              pRedBCST     := CDSNFeDetalheBCALREDUCAO.AsFloat;
                              vBCST        := CDSNFeDetalheBASECALST.AsFloat;
                              pICMSST      := CDSNFeDetalheALIQSAIDA.AsFloat;//verificar
                              vICMSST      := CDSNFeDetalheVALORST.AsFloat;
                              pCredSN      := 0;
                              vCredICMSSN  := 0;
                           end;
                       end;
                    end;
                  end;
              end;
              CDSNFeDetalhe.Next ;
             end ;
             Total.ICMSTot.vBC     := EditBCIcms.Value ;
             Total.ICMSTot.vICMS   := EditValorIcms.Value ;
             Total.ICMSTot.vBCST   := EditBCIcmsSt.Value ;
             Total.ICMSTot.vST     := EditValorIcmsSt.Value ;
             Total.ICMSTot.vProd   := EditTotalProdutos.Value ;
             Total.ICMSTot.vDesc   := EditValorDesconto.Value ;
             //Total.ICMSTot.vII     := 0;
             //Total.ICMSTot.vIPI    := 0;
             Total.ICMSTot.vNF     := EditValorTotalNota.Value ;
             with pag.Add do //PAGAMENTOS apenas para NFC-e
             begin
               if TpoPag ='PRAZO' then
               begin
                  tPag := fpOutro;
               end else begin
                  tPag := fpDinheiro;
               end;
               vPag := EditValorTotalNota.Value;
             end;

         end;

 

o XML gerado está anexo

 

13131165198962000142650010000000011000000019-NFe.xml

  • Este tópico foi criado há 4017 dias atrás.
  • Talvez seja melhor você criar um NOVO TÓPICO do que postar uma resposta aqui.

Crie uma conta ou entre para comentar

Você precisar ser um membro para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar Agora
×
×
  • Criar Novo...

Informação Importante

Colocamos cookies em seu dispositivo para ajudar a tornar este site melhor. Você pode ajustar suas configurações de cookies, caso contrário, assumiremos que você está bem para continuar.