GARANTIR DESCONTO

Fórum rotina nao da resultado esperado #276858

12/04/2005

0

amigos do forum a minha rotina nao da o resultado esperado o que esta errado

ao clicar do botao tem esta rotina

tbbaixa.Filtered := false;
tbbaixa.Filter := ´codlancamento= ´+QuotedStr(edit2.Text)+´ and ´+´codgeral= ´+QuotedStr(edit3.Text);
tbbaixa.Filtered := true;
if tbbaixa.RecordCount = 0 then
begin
end else
if not tblan003.Locate(´codlancamento;codgeral;codparcela´,VarArrayOf([edit2.Text,edit3.Text,edit4.Text]),[locaseinsensitive])then
begin
showmessage(´Registro Não Localizado Tente Novamente´);
edit2.SetFocus
end else
if tblan003.Locate(´codlancamento;codgeral;codparcela´,VarArrayOf([edit2.Text,edit3.Text,edit4.Text]),[locaseinsensitive])then
begin
edit2.Clear;
edit3.Clear;
edit4.Clear;
tbcaixa.Insert;
tbcaixacodlancamento.Value := tblan003codlancamento.Value;
tbcaixacodgeral.Value := tblan003codgeral.Value;
tbcaixacodparcela.Value := tblan003codparcela.Value;
tbcaixadvencimento.Value := tblan003dvencimento.Value;
tbcaixadpagamento.Value := strtodate(dateedit1.Text);
tbcaixavfixado.Value := tblan003vfixado.Value;
tbcaixaunica.Value := tblan003unica.Value;
tbcaixacodsitparcela.Value := tblan003codsitparcela.Value;
tbcaixanumabertura.Value := tblan003numabertura.Value;
tbcaixagerarlan.Value := tblan003gerarlan.Value;
tbcaixadesconto.Value := tblan003desconto.Value;
tbcaixatipodesconto.Value := tblan003tipodesconto.Value;
tbcaixaobservacao.Value := tblan003observacao.Value;
tbcaixacontrole.Value := tblan003controle.Value;
tbcaixavalordesconto.Value := tblan003valordesconto.Value;
tbcaixavtfixa.Value := tblan003vtfixa.Value;
tbcaixacodlote.Value := tblan003codlote.Value;
tbcaixacodespec1.Value := tblan003codespec1.Value;
tbcaixaValorEspec1.Value := tblan003ValorEspec1.Value;
tbcaixacodespec2.Value := tblan003codespec2.Value;
tbcaixavalorespec2.Value := tblan003valorespec2.Value;
tbcaixacodespec3.Value := tblan003codespec3.Value;
tbcaixavalorespec3.Value := tblan003valorespec3.Value;
tbcaixacodespec4.Value := tblan003codespec4.Value;
tbcaixavalorespec4.Value := tblan003valorespec4.Value;
tbcaixacodespec5.Value := tblan003codespec5.Value;
tbcaixavalorespec5.Value := tblan003valorespec5.Value;
tbcaixacodespec6.Value := tblan003codespec6.Value;
tbcaixavalorespec6.Value := tblan003valorespec6.Value;
tbcaixacodespec7.Value := tblan003codespec7.Value;
tbcaixavalorespec7.Value := tblan003valorespec7.Value;
tbcaixacodespec8.Value := tblan003codespec8.Value;
tbcaixavalorespec8.Value := tblan003valorespec8.Value;
tbcaixacodespec9.Value := tblan003codespec9.Value;
tbcaixavalorespec9.Value := tblan003valorespec9.Value;
tbcaixacodespec10.Value := tblan003codespec10.Value;
tbcaixavalorespec10.Value := tblan003valorespec10.Value;
if radiogroup1.ItemIndex = 0 then
tbcaixatipobaixa.Value := ´M´else
if radiogroup1.ItemIndex = 1 then
tbcaixatipobaixa.Value := ´A´else
if radiogroup1.ItemIndex = 2 then
tbcaixatipobaixa.Value := ´R´;
tbcaixavdescontolei.Value := tblan003vdescontolei.Value;
tbcaixavalorcustas.Value := tblan003valorcustas.Value;
tbcaixadbaixa.Value := tblan003dbaixa.Value;
tbcaixabarra.Value := tblan003barra.Value;
tbcaixacampo1.Value := tblan003campo1.Value;
tbcaixacampo2.Value := tblan003campo2.Value;
tbcaixacampo3.Value := tblan003campo3.Value;
tbcaixacampo4.Value := tblan003campo4.Value;
tbcaixabarracomp.Value := tblan003barracomp.Value;
TBCAIXA.Post;
tbcaixa.edit end else

if tbbaixa.RecordCount <> 0 then
begin
if tbBaixa.Locate(´codlancamento;codgeral;codparcela´,VarArrayOf([edit2.Text,edit3.Text,edit4.Text]),[locaseinsensitive])then
begin
showmessage(´Parcela Já Baixada ´);
edit2.SetFocus
end else
if not tbBaixa.Locate(´codlancamento;codgeral;codparcela´,VarArrayOf([edit2.Text,edit3.Text,edit4.Text]),[locaseinsensitive])then
begin
if not tblan003.Locate(´codlancamento;codgeral;codparcela´,VarArrayOf([edit2.Text,edit3.Text,edit4.Text]),[locaseinsensitive])then
begin
showmessage(´Registro Não Localizado Tente Novamente´);
edit2.SetFocus
end else
if tblan003.Locate(´codlancamento;codgeral;codparcela´,VarArrayOf([edit2.Text,edit3.Text,edit4.Text]),[locaseinsensitive])then
begin
edit2.Clear;
edit3.Clear;
edit4.Clear;
tbcaixa.Insert;
tbcaixacodlancamento.Value := tblan003codlancamento.Value;
tbcaixacodgeral.Value := tblan003codgeral.Value;
tbcaixacodparcela.Value := tblan003codparcela.Value;
tbcaixadvencimento.Value := tblan003dvencimento.Value;
tbcaixadpagamento.Value := strtodate(dateedit1.Text);
tbcaixavfixado.Value := tblan003vfixado.Value;
tbcaixaunica.Value := tblan003unica.Value;
tbcaixacodsitparcela.Value := tblan003codsitparcela.Value;
tbcaixanumabertura.Value := tblan003numabertura.Value;
tbcaixagerarlan.Value := tblan003gerarlan.Value;
tbcaixadesconto.Value := tblan003desconto.Value;
tbcaixatipodesconto.Value := tblan003tipodesconto.Value;
tbcaixaobservacao.Value := tblan003observacao.Value;
tbcaixacontrole.Value := tblan003controle.Value;
tbcaixavalordesconto.Value := tblan003valordesconto.Value;
tbcaixavtfixa.Value := tblan003vtfixa.Value;
tbcaixacodlote.Value := tblan003codlote.Value;
tbcaixacodespec1.Value := tblan003codespec1.Value;
tbcaixaValorEspec1.Value := tblan003ValorEspec1.Value;
tbcaixacodespec2.Value := tblan003codespec2.Value;
tbcaixavalorespec2.Value := tblan003valorespec2.Value;
tbcaixacodespec3.Value := tblan003codespec3.Value;
tbcaixavalorespec3.Value := tblan003valorespec3.Value;
tbcaixacodespec4.Value := tblan003codespec4.Value;
tbcaixavalorespec4.Value := tblan003valorespec4.Value;
tbcaixacodespec5.Value := tblan003codespec5.Value;
tbcaixavalorespec5.Value := tblan003valorespec5.Value;
tbcaixacodespec6.Value := tblan003codespec6.Value;
tbcaixavalorespec6.Value := tblan003valorespec6.Value;
tbcaixacodespec7.Value := tblan003codespec7.Value;
tbcaixavalorespec7.Value := tblan003valorespec7.Value;
tbcaixacodespec8.Value := tblan003codespec8.Value;
tbcaixavalorespec8.Value := tblan003valorespec8.Value;
tbcaixacodespec9.Value := tblan003codespec9.Value;
tbcaixavalorespec9.Value := tblan003valorespec9.Value;
tbcaixacodespec10.Value := tblan003codespec10.Value;
tbcaixavalorespec10.Value := tblan003valorespec10.Value;
if radiogroup1.ItemIndex = 0 then
tbcaixatipobaixa.Value := ´M´else
if radiogroup1.ItemIndex = 1 then
tbcaixatipobaixa.Value := ´A´else
if radiogroup1.ItemIndex = 2 then
tbcaixatipobaixa.Value := ´R´;
tbcaixavdescontolei.Value := tblan003vdescontolei.Value;
tbcaixavalorcustas.Value := tblan003valorcustas.Value;
tbcaixadbaixa.Value := tblan003dbaixa.Value;
tbcaixabarra.Value := tblan003barra.Value;
tbcaixacampo1.Value := tblan003campo1.Value;
tbcaixacampo2.Value := tblan003campo2.Value;
tbcaixacampo3.Value := tblan003campo3.Value;
tbcaixacampo4.Value := tblan003campo4.Value;
tbcaixabarracomp.Value := tblan003barracomp.Value;
TBCAIXA.Post;
tbcaixa.edit;
end;
end;
end;

nao sei se esta certo os ifs begin etc ou nao pode ser feito assim eu gostaria que alguem analisasse para mim e agradeço a ajuda de todos quem sabe algum dia estaremos ajudando alguem


Famatec

Famatec

Responder

Posts

12/04/2005

Rjun

amigos do forum a minha rotina nao da o resultado esperado o que esta errado


Seria bom se você falasse qual o resultado esperado e qual o resulado obtido.


Responder

Gostei + 0

12/04/2005

Famatec

o resultado esperado é o seguinte estou fazendo um filtro na tabela de baixa e se nao tiver nenhum registro pode fazer a localizacao na tabela de lançamento e se o filtro tiver o resultado com o codparcela igual 0 entao foi baixado pela unica e se o filtro tiver como resultado o codparcela igual a 1 ate 6 entao tem a localização na tabela baixa e encontarndo por exemplo a parcela 6 da localizaçao da mensagem de paga e no caso de nao localização entao faz abusca na tabela de lançamento ??????


Responder

Gostei + 0

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

Aceitar