Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NotaF.NFe.Dest.CNPJCPF := NotaCLI_CPF_CNPJ.AsString;
- if Length(SoNumeros(NotaCLI_CPF_CNPJ.AsString)) = 14 then
- begin
- if SoNumeros(NotaCLI_RG_INSC.AsString) <> '' then
- begin
- NotaF.NFe.Dest.IE := SoNumeros(NotaCLI_RG_INSC.AsString);
- NotaF.NFe.Dest.indIEDest := inContribuinte;
- end
- else
- begin
- if (NotaCOD_CFOP.AsString.Substring(0,1) = '6') and (NotaSN_CONSUMIDOR.AsString = 'S') then
- NotaF.NFe.Dest.indIEDest := inNaoContribuinte
- else
- begin
- if AceitaIsento(NotaCLI_ESTADO.AsString) then
- NotaF.NFe.Dest.indIEDest := inIsento
- else
- NotaF.NFe.Dest.indIEDest := inNaoContribuinte
- end;
- end;
- end
- else
- begin
- if (NotaSN_PRODUTOR_RURAL.AsString = 'S') and ((NotaCLI_RG_INSC.AsString <> '') and (NotaCLI_RG_INSC.AsString <> 'ISENTO')) then
- begin
- NotaF.NFe.Dest.IE := SoNumeros(NotaCLI_RG_INSC.AsString);
- NotaF.NFe.Dest.indIEDest := inContribuinte;
- end
- else
- NotaF.NFe.Dest.indIEDest := inNaoContribuinte;
- end;
- end;
- UF_NIsento: array[0..10] of string = ('AM','MT','MS','GO','SP','MG','BA','CE','PE','RN','SE');
- function AceitaIsento(Estado: string): Boolean;
- var i: Integer;
- begin
- Result := True;
- for i := Low(UF_NIsento) to High(UF_NIsento) do
- if Estado = UF_NIsento[i] then
- begin
- Result := False;
- Break;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement