PAGUE 6 MESES
LEVE 12 MESES
GARANTIR DESCONTO

Fórum NFS-e de Curitiba #376274

24/04/2010

0

Pessoal eu mandei um e-mail ontem perguntando sobre a nota fiscal de serviços eletrônica (NFS-e) de Curitiba. Continuem fazendo meus testes, tanto em Delphi 7 e Delphi 2010.
Agora vai a dúvidas bem detalhada.

1 - Alguém já conseguiu implementar o acesso ao WebService de Curitiba, ou melhor, enviar as notas fiscais para a prefeitura sem usar nenhum componentes de terceiros?
2 - O WebService pede um certficado digital, como eu adiciono ele no envio dos dados no WebService?
3 - O Delphi 2010 importa de forma diferente o arquivo WSDL?

Sobre os erros:

Peguei o mesmo WSDL, e importei tanto no Delphi 7 e no Delphi 2010. Depois implementei o mesmo código nas duas IDE.
Quando mando fazer o seguinte linha de código:

Retorno := Envio.RecepcionarLoteRps(Lote);

dá erro.

No Delphi 7 dá o seguinte erro:
"Acess violation at adress 004036FC in module "Project.exe". Read of address 0000BCED.

No Delphi 2010, dá um erro diferente:
Internal error: data type kind Method (TAlignInsertBeforeEvent) canoot be converted to abd from text

O código está abaixo.

[]s

Marlon



unit Unit1;



interface



uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, 
Forms,

  Dialogs, StdCtrls, XSBuiltIns;



type

  TForm1 = class(TForm)

    Button1: TButton;

    procedure Button1Click(Sender: TObject);

  private

    { Private declarations }

    function fnValor(Valor : String) : TXSDecimal;

  public

    { Public declarations }

  end;



var

  Form1: TForm1;



implementation



uses nfsews;



{$R *.dfm}



procedure TForm1.Button1Click(Sender: TObject);

var

   Envio : nfseSoap;

   Retorno : EnviarLoteRpsResposta;

   Lote : EnviarLoteRpsEnvio;

   ListaRps : ArrayOfRps;

   Data : TXSDateTime;



begin

   Envio := GetnfseSoap;



   Retorno := EnviarLoteRpsResposta.Create;

   Lote := EnviarLoteRpsEnvio.Create;



   Lote.LoteRps := tcLoteRps.Create;

   Lote.Signature := SignatureType.Create;



   Lote.LoteRps.NumeroLote := 0;

   Lote.LoteRps.Cnpj := '000';

   Lote.LoteRps.QuantidadeRps := 1;



   SetLength(ListaRps, 1);

   ListaRps[0] := Rps.Create;

   ListaRps[0].InfRps := tcInfRps.Create;

   ListaRps[0].Signature := SignatureType.Create;

   ListaRps[0].InfRps.IdentificacaoRps := tcIdentificacaoRps.Create;





   ListaRps[0].InfRps.IdentificacaoRps.Numero := 1;

   ListaRps[0].InfRps.IdentificacaoRps.Serie := 'F';

   ListaRps[0].InfRps.IdentificacaoRps.Tipo := 1;



   Data.AsDateTime := Now();

   ListaRps[0].InfRps.DataEmissao := Data;

   ListaRps[0].InfRps.NaturezaOperacao := 1;

   ListaRps[0].InfRps.RegimeEspecialTributacao := 1;

   ListaRps[0].InfRps.OptanteSimplesNacional := 2;

   ListaRps[0].InfRps.IncentivadorCultural := 2;

   ListaRps[0].InfRps.Status := 1;



   ListaRps[0].InfRps.Servico := tcDadosServico.Create;

   ListaRps[0].InfRps.Servico.Valores := tcValores.Create;



   ListaRps[0].InfRps.Servico.Valores.ValorServicos := fnValor('1000');

   ListaRps[0].InfRps.Servico.Valores.ValorDeducoes := fnValor('0');

   ListaRps[0].InfRps.Servico.Valores.ValorPis := fnValor('0');

   ListaRps[0].InfRps.Servico.Valores.ValorCofins := fnValor('0');

   ListaRps[0].InfRps.Servico.Valores.ValorInss := fnValor('0');

   ListaRps[0].InfRps.Servico.Valores.ValorIr := fnValor('0');

   ListaRps[0].InfRps.Servico.Valores.ValorCsll := fnValor('0');

   ListaRps[0].InfRps.Servico.Valores.IssRetido := 2;

   ListaRps[0].InfRps.Servico.Valores.ValorIss := fnValor('50');

   ListaRps[0].InfRps.Servico.Valores.ValorIssRetido := fnValor('0');

   ListaRps[0].InfRps.Servico.Valores.OutrasRetencoes := fnValor('0');

   ListaRps[0].InfRps.Servico.Valores.BaseCalculo := fnValor('1000');

   ListaRps[0].InfRps.Servico.Valores.Aliquota := fnValor('5');

   ListaRps[0].InfRps.Servico.Valores.ValorLiquidoNfse := 
fnValor('950');

   ListaRps[0].InfRps.Servico.Valores.DescontoIncondicionado := 
fnValor('0');

   ListaRps[0].InfRps.Servico.Valores.DescontoCondicionado := 
fnValor('0');



   ListaRps[0].InfRps.Servico.ItemListaServico := '0107';

   ListaRps[0].InfRps.Servico.Discriminacao := 'Teste de envio de lote 
de RPS';

   ListaRps[0].InfRps.Servico.CodigoMunicipio := 1;



   ListaRps[0].InfRps.Prestador := tcIdentificacaoPrestador.Create;



   ListaRps[0].InfRps.Prestador.Cnpj := '000';

   ListaRps[0].InfRps.Prestador.InscricaoMunicipal := '000';



   ListaRps[0].InfRps.Tomador := tcDadosTomador.Create;

   ListaRps[0].InfRps.Tomador.IdentificacaoTomador := 
tcIdentificacaoTomador.Create;

   ListaRps[0].InfRps.Tomador.IdentificacaoTomador.CpfCnpj := 
tcCpfCnpj.Create;



   ListaRps[0].InfRps.Tomador.IdentificacaoTomador.CpfCnpj.Cpf := 
'035.954.159-30';

   ListaRps[0].InfRps.Tomador.RazaoSocial := 'Tomador de Serviços';



   ListaRps[0].InfRps.Tomador.Endereco := tcEndereco.Create;



   ListaRps[0].InfRps.Tomador.Endereco.Endereco := 'Rua sem nome';

   ListaRps[0].InfRps.Tomador.Endereco.Numero := '1';

   ListaRps[0].InfRps.Tomador.Endereco.Complemento := 'Apt. 1';

   ListaRps[0].InfRps.Tomador.Endereco.Bairro := 'Centro';

   ListaRps[0].InfRps.Tomador.Endereco.Uf := 'PR';

   ListaRps[0].InfRps.Tomador.Endereco.Cep := 0;



   ListaRps[0].InfRps.Tomador.Contato := tcContato.Create;



   ListaRps[0].InfRps.Tomador.Contato.Telefone := '00';

   ListaRps[0].InfRps.Tomador.Contato.Email := 'marlon.tiedt@gmail.com';



   Lote.LoteRps.ListaRps := ListaRps;

   Retorno := Envio.RecepcionarLoteRps(Lote);

end;



function TForm1.fnValor(Valor: String): TXSDecimal;

begin

   Result.DecimalString := Valor;

end;



end.

Marlon Tiedt

Marlon Tiedt

Responder

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar