Italo,
A linha 2848 não foi alterada conforme o diff abaixo. A modificação foi no else nas linhas 2853 e 2854.
--- C:/Users/Lucas/AppData/Local/Temp/ACBrNFSeWebServices.pas-rev7359.svn000.tmp.pas qui ago 28 17:51:07 2014
+++ C:/work/libs/acbr/Fontes/ACBrNFSe/ACBrNFSeWebServices.pas ter set 2 08:44:18 2014
@@ -2850,8 +2850,8 @@
Self.ConsNfseRps.RazaoSocial := '';
end
else begin
- Self.ConsNfseRps.Cnpj := TACBrNFSe( FACBrNFSe ).NotasFiscais.Items[0].NFSe.PrestadorServico.IdentificacaoPrestador.Cnpj;
- Self.ConsNfseRps.InscricaoMunicipal := TACBrNFSe( FACBrNFSe ).NotasFiscais.Items[0].NFSe.PrestadorServico.IdentificacaoPrestador.InscricaoMunicipal;
+ Self.ConsNfseRps.Cnpj := TACBrNFSe( FACBrNFSe ).NotasFiscais.Items[0].NFSe.Prestador.Cnpj;
+ Self.ConsNfseRps.InscricaoMunicipal := TACBrNFSe( FACBrNFSe ).NotasFiscais.Items[0].NFSe.Prestador.InscricaoMunicipal;
Self.ConsNfseRps.RazaoSocial := TACBrNFSe( FACBrNFSe ).NotasFiscais.Items[0].NFSe.PrestadorServico.RazaoSocial;
end;
Fiz a alteração, pois qdo faço: ACBrNFse1.NotasFiscais.LoadFromFile a function TNFSeR.LerRPS_ABRASF_V1 da unit pnfsNFSeR:
if (Leitor.rExtrai(3, 'Prestador') <> '') or (Leitor.rExtrai(2, 'Prestador') <> '')
then begin
NFSe.Prestador.Cnpj := Leitor.rCampo(tcStr, 'Cnpj');
NFSe.Prestador.InscricaoMunicipal := Leitor.rCampo(tcStr, 'InscricaoMunicipal');
end; // fim Prestador
O Cnpj e a inscrição é atribuída em NFSe.Prestador.CNPJ, não em NFSe.PrestadorServico.IdentificacaoPrestador.Cnpj. Aí a consulta após o concelamento estava sendo feita com o parametro CNPJ em branco.
Já na function TNFSeR.LerRPS_ABRASF_V2, o CNPJ é atribúido tanto em NFSe.Prestador.CNPJ quanto em NFSe.PrestadorServico.IdentificacaoPrestador.Cnpj.
Conforme:
if (Leitor.rExtrai(3, 'Prestador') <> '') or (Leitor.rExtrai(2, 'Prestador') <> '')
then begin
NFSe.PrestadorServico.IdentificacaoPrestador.InscricaoMunicipal := Leitor.rCampo(tcStr, 'InscricaoMunicipal');
NFSe.Prestador.InscricaoMunicipal := NFSe.PrestadorServico.IdentificacaoPrestador.InscricaoMunicipal;
if (VersaoXML = '1') or (FProvedor = proDigifred)
then begin
if (Leitor.rExtrai(4, 'CpfCnpj') <> '') or (Leitor.rExtrai(3, 'CpfCnpj') <> '')
then begin
NFSe.PrestadorServico.IdentificacaoPrestador.Cnpj := Leitor.rCampo(tcStr, 'Cpf');
if NFSe.PrestadorServico.IdentificacaoPrestador.Cnpj = ''
then NFSe.PrestadorServico.IdentificacaoPrestador.Cnpj := Leitor.rCampo(tcStr, 'Cnpj');
end;
end
else begin
NFSe.PrestadorServico.IdentificacaoPrestador.Cnpj := Leitor.rCampo(tcStr, 'Cnpj');
end;
NFSe.Prestador.Cnpj := NFSe.PrestadorServico.IdentificacaoPrestador.Cnpj;
end; // fim Prestador
Por isso a alteração não irá conflitar com outros provedores, pois a variável, NFSe.Prestador.Cnpj será atribuída tanto para TNFSeR.LerRPS_ABRASF_V1, quanto para TNFSeR.LerRPS_ABRASF_V2.
Procede ?
De qq forma fiquei na dúvida pois na class TNFSe tem uma redundância ??:
property Prestador: TIdentificacaoPrestador read FPrestador write FPrestador;
property PrestadorServico: TDadosPrestador read FPrestadorServico write FPrestadorServico;
e a TDadoPrestador também tem uma propriedade TIdentificaoPrestador:
property IdentificacaoPrestador: TIdentificacaoPrestador read FIdentificacaoPrestador write FIdentificacaoPrestador;
Lucas