Jump to content

dev botao

Bloco P


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

Recommended Posts

Fiz o codigo abaixo para retornar os dados para geracao do bloco p mais o arquivo txt gerado não está imprimindo os valores correspondentes.

Alguem pode me informar se deixei de declarar alguma função?

procedure TfrmSPEDPISCONFIS.GerarBlocoP;

VAR RegistroAtual : string;

p100 : integer;

begin

TRY

// Alimenta o componente com informações para gerar todos os registros do

// Bloco P.

with ACBrSPEDPisCofins1.Bloco_P do

begin

with RegistroP001New do

begin

RegistroAtual := 'P001';

with RegistroP010New do

begin

cdsRegistroNv2.Close;

cdsRegistroNv2.CommandText := 'SELECT * FROM SPEDREGISTROP010('+ IntToStr(Empresa.KeyValue) +');';

cdsRegistroNv2.Open;

CNPJ := cdsRegistroNv2.FieldByName('CNPJ').AsString; //'';

lblStatus.Caption := 'Gerando Bloco P - Registro P100';

pbPrincipal.Position := 0;

Refresh;//Application.ProcessMessages;

cdsRegistroNv2.Close;

cdsRegistroNv2.CommandText := 'SELECT * FROM SPEDREGISTROP100('+ QuotedStr(FormatDateTime('mm/dd/yyyy', Inicio.Date)) +','+ QuotedStr(FormatDateTime('mm/dd/yyyy', Fim.Date)) +');';

cdsRegistroNv2.Open;

cdsRegistroNv2.First;

pbPrincipal.Max := cdsRegistroNv2.RecordCount;

if cdsRegistroNv2.RecordCount > 0 then

IND_MOV := imComDados

ELSE

IND_MOV := imSemDados;

end;

for P100 := 0 to cdsRegistroNv2.RecordCount -1 do

begin

RegistroAtual := 'P100:' + cdsRegistroNv2.FieldByName('COD_ATIV_ECON').AsString;

with RegistroP100New do

begin

DT_INI := Inicio.Date;

DT_FIM := Fim.Date;

VL_REC_TOT_EST := cdsRegistroNv2.FieldByName('VL_REC_TOT_EST').AsCurrency;

COD_ATIV_ECON := cdsRegistroNv2.FieldByName('COD_ATIV_ECON').AsString;

VL_REC_ATIV_ESTAB := cdsRegistroNv2.FieldByName('VL_REC_ATIV_ESTAB').AsCurrency;

VL_EXC := cdsRegistroNv2.FieldByName('VL_EXEC').AsCurrency;

VL_BC_CONT := cdsRegistroNv2.FieldByName('VL_BC_CONT').AsCurrency;

ALIQ_CONT := cdsRegistroNv2.FieldByName('ALIQ_CONT').AsCurrency;

VL_CONT_APU := cdsRegistroNv2.FieldByName('VL_CONT_APU').AsCurrency;

COD_CTA := '';

end;

cdsRegistroNv2.Next;

end;

end;

end;

except

on E : Exception do

begin

frmErroSPED.mmErro.Lines.Add('Erro ao gerar o registro: ' + RegistroAtual);

raise Exception.Create(E.Message);

end;

end;

end;

Link to comment
Share on other sites

  • Consultores

Por favor, reformule seu post. Ele não dá informações necessárias sobre o problema.

Você até se contradisse:

Título do post:Bloco P Não está imprimindo no txt

Primeira frase do post:Bloco p está imprimindo no arquivo TXT

[]'s

Consultor SAC ACBr

Elton
Profissionalize o ACBr na sua empresa, conheça o ACBr Pro.

Projeto ACBr     Telefone:(15) 2105-0750 WhatsApp(15)99790-2976.

Um engenheiro de Controle de Qualidade(QA) entra num bar. Pede uma cerveja. Pede zero cervejas.
Pede 99999999 cervejas. Pede -1 cervejas. Pede um jacaré. Pede asdfdhklçkh.
Link to comment
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.